PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Automated testing - Random values
   PostPosted: 25 Nov 2013, 16:02 
Hello,

We would like to do byte-to-byte comparison of expected and generated PDF files in our automated testing suite.

As explained in the official documentation of PD4ML, we have overridden the PD4ML_DOCUMENT_DATE attribute : http://pd4ml.com/api/org/zefer/pd4ml/PD ... UMENT_DATE

However, we have found other attributes that absolutely need to be overridden to make our tests pass.

1) At the bottom of the PDF file, the "/ID [GENERATED_NUMBER]" metadata is generated randomly.

Please advise how we can override this value with a fixed user provided value.

2) The order of the embedded object declaration (/XObject metadata) is random.

Sometimes we have :

Code:
/XObject <<
      /img1 4 0 R
      /img2 5 0 R
      /img0 3 0 R
      /img3 2 0 R
   >>


Other times :
Code:
/XObject <<
      /img3 2 0 R
      /img1 4 0 R
      /img2 5 0 R
      /img0 3 0 R
   >>


And so on.

We use Velocity with CSS attributes to embed images so the order of inclusion should not be random.

Please advise how we can fix the order of the /img elements.

Thanks


  Subject: Re: Automated testing - Random values
   PostPosted: 25 Nov 2013, 17:09 
Some time ago we specially addressed automatic testing issues.

A JVM parameter like -Dpd4ml.document.id=0123456789abcdef (16 chars) should help to resolve /ID [GENERATED_NUMBER] issue.

Also the image references are sorted by original image paths. Can it be that the paths differ from test to test?


  Subject: Re: Automated testing - Random values
   PostPosted: 25 Nov 2013, 17:45 
Thanks for your answer.

Setting the system property solved the random ID issue.

Concerning image paths, they are defined in a static CSS file.

This CSS file is located in a fixed directory. The images also.

I would have looked at the source code in debug to understand the issue but I do not have access to the source code.

Could you think of anything else that would randomize this list?

Thanks for your help.


  Subject: Re: Automated testing - Random values
   PostPosted: 25 Nov 2013, 17:57 
Obviously it would make sense to sort the image references by image IDs. I've just corrected the code in the development build, and it seems XObject dictionary appears sorted now.


  Subject: Re: Automated testing - Random values
   PostPosted: 25 Nov 2013, 19:25 
Would you know in which version and/or at which time this fix would be released?


  Subject: Re: Automated testing - Random values
   PostPosted: 25 Nov 2013, 19:46 
We could send you an interim development build. Contact support pd4ml com. Currently the image reference sorting is the only difference from v385fx3


  Subject: Re: Automated testing - Random values
   PostPosted: 26 Nov 2013, 12:27 
Would you have an idea when this would be released? 1 month, 6 months, a year?


  Subject: Re: Automated testing - Random values
   PostPosted: 27 Nov 2013, 10:05 
~1 month

But definitely this year.


  Subject: Re: Automated testing - Random values
   PostPosted: 27 Nov 2013, 11:12 
Awesome thanks.



[Reply]     [ 9 posts ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share