PD4ML v4 › Forums › PD4ML v3 Archived Forums (Read Only) › PD4ML Tips & Tricks › Automated testing – Random values This topic has 8 replies, 2 voices, and was last updated Nov 25, 201314:02:10 by Anonymous. Viewing 9 posts - 1 through 9 (of 9 total) Author Posts Anonymous November 25, 2013 at 14:02 #26892 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/PD4Constants.html#PD4ML_DOCUMENT_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 : /XObject <<<br /> /img1 4 0 R<br /> /img2 5 0 R<br /> /img0 3 0 R<br /> /img3 2 0 R<br /> >><br /> Other times : <br /> /XObject <<<br /> /img3 2 0 R<br /> /img1 4 0 R<br /> /img2 5 0 R<br /> /img0 3 0 R<br /> >> 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 PD4ML November 25, 2013 at 15:09 #29440 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? Anonymous November 25, 2013 at 15:45 #29441 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. PD4ML November 25, 2013 at 15:57 #29442 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. Anonymous November 25, 2013 at 17:25 #29443 Would you know in which version and/or at which time this fix would be released? PD4ML November 25, 2013 at 17:46 #29444 We could send you an interim development build. Contact support pd4ml com. Currently the image reference sorting is the only difference from v385fx3 Anonymous November 26, 2013 at 10:27 #29445 Would you have an idea when this would be released? 1 month, 6 months, a year? PD4ML November 27, 2013 at 08:05 #29446 ~1 month But definitely this year. Anonymous November 27, 2013 at 09:12 #29447 Awesome thanks. Author Posts Viewing 9 posts - 1 through 9 (of 9 total) The forum ‘PD4ML Tips & Tricks’ is closed to new topics and replies.