HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Trouble understanding differencies between Linux and Windows
- This topic has 16 replies, 3 voices, and was last updated Mar 14, 2016
10:15:31 by amayet.
-
AuthorPosts
-
February 19, 2015 at 10:31#26972
Hi,
I’m actually using your library (v3.9.4 Pro) in my professionnal context to
generate some pdf.Thus, I’ve tried to build unit test to ensure the non regression of our
pdf.I’ve got an issues regarding the size of generated byte from windows and
linux.The size of the file is always greater on Linux than on Windows but I can’t
figure out why.When I compare my two files (the one generated from Linux vs the one
generated from windows) using a pdf comparaison tools I can’t see
differences whereas when I’m comparing using binary tools I see few
differences :The size of lenght on linux is greater by 13.
Their is always differences on the first stream.
Their is always differences on the xref.
Their is always differences on the number return by the starxref.I’d like to know if you are able to oriente me and help me solving this
issues.Best regards,
February 19, 2015 at 14:58#29620There is a minor difference in diagnostics data of the PDFs (encapsulated to the first PDF content object):
[language=java:2h90ify6]% PD4ML version: 394 Pro DMS
% JDK version: 1.7.0_51
% OS version: Linux 3.2.0-76-generic-pae
% File encoding: UTF-8
% insets: java.awt.Insets[top=0,left=0,bottom=0,right=0]
% size: java.awt.Dimension[width=595,height=842]
% ttf: java:
% pro version[/language:2h90ify6][language=java:2h90ify6]% PD4ML version: 394 Pro DMS
% JDK version: 1.7.0_71
% OS version: Windows 7 6.1
% File encoding: UTF-8
% insets: java.awt.Insets[top=0,left=0,bottom=0,right=0]
% size: java.awt.Dimension[width=595,height=842]
% ttf: java:
% pro version[/language:2h90ify6]The difference explains also a shift in the object offset table (XREF).
Also the documents should differ in DOCIDs – unique document identifiers.
Probably a better way to compare the documents would be to use PD4Document API to collect metadata (i.e. number of pages) and to extract particular page content.
[language=java:2h90ify6]PD4Document doc1 = new PD4Document(new URL(“file:o:/work/testdata/testsuite/pdf/doc5enc.pdf”), password);
int pagenum = doc1.getNumberOfPages();
String content = doc1.getPageContent(1);
String outlines = doc1.dumpOutlines();
String author = doc1.getAuthor()[/language:2h90ify6]February 19, 2015 at 15:11#29621Thanks a lot for your answer.
We actually already override the following elements :
parametreDefaut.put(PD4Constants.PD4ML_DOCUMENT_DATE, (new LocalDateTime(0,1,1,0,0,0)).toString());
parametreDefaut.put(PD4Constants.PD4ML_IDS_AS_DESTINATIONS, “SIGEF”);
System.setProperty(“pd4ml.document.id”, “0123456789abcdef”);Can you tell us how to override the OS and the JDK ? And what do you use to decode the “pdf content object” ?
Best regards,
February 19, 2015 at 15:29#29622To decompress entire PDF you may use
http://sourceforge.net/projects/multivalent/java -Xmx192m -cp Multivalent20060102.jar tool.pdf.Uncompress -exact file.pdf
If a particular page is needed to be decoded:
[language=java:16hhkgtu]PD4Document doc1 = new PD4Document(new URL(“file.pdf”), password);
String content = doc1.getPageContent(1);[/language:16hhkgtu]For the time being it is not possible to disable JDK/OS diag output. But we could add the switch in the next versions.
February 19, 2015 at 15:55#29623Thanks for all your informations again.
Could you add the switch for those elements in the next versions :
callParameters.append( “% PD4ML version: ” + getVersion() + “n” );
callParameters.append( “% JDK version: ” + System.getProperty( “java.version” ) + “n” );
callParameters.append( “% OS version: ” + System.getProperty( “os.name” ) + ” ” );
callParameters.append( System.getProperty( “os.version” ) + “n” );It’s actually all we need to ensure our long terme binary comparaison and non regression on our file.
Furthermore, are you able to tell me when the next version will be available ?
Best regards,
February 20, 2015 at 11:25#29624In the next version it will suppress the version-, JVM- and OS- specific info when a document ID is overridden with System.setProperty(“pd4ml.document.id”, “…..”) call.
Normally we publish monthly maintenance updates. The most recent release was few days ago. I expect a new version is to be available close to the middle of March.
February 20, 2015 at 13:14#29625Thank a lot for all your answers.
All given solutions seems perfect !
Can’t wait to see your new release !
March 9, 2015 at 16:03#29626Hi !
We’ve tried your new version 3.9.5, it doesn’t allow to overwrite pdf metadata.
Furthermore, when we look at the source code, we don’t see any change regarding our case.
Thus, could you give us some precision regarding which version will “permit the suppression of the version-, JVM- and OS- specific info when a document ID is overridden with System.setProperty(“pd4ml.document.id”, “…..”) call” and when it’ll be able.Best regards,
May 20, 2015 at 08:16#29627Hi,
Having no answer since a while I contact you again.
When does the release containing the switch for those elements will be available ?
callParameters.append( “% PD4ML version: ” + getVersion() + “n” );
callParameters.append( “% JDK version: ” + System.getProperty( “java.version” ) + “n” );
callParameters.append( “% OS version: ” + System.getProperty( “os.name” ) + ” ” );
callParameters.append( System.getProperty( “os.version” ) + “n” );Best regards,
May 20, 2015 at 11:56#29628v396 should do the trick (when “pd4ml.document.id” property is defined).
June 5, 2015 at 13:23#29629It’s still not working.
We’ve tried using the new version and defining “pd4ml.document.id” :
System.setProperty(“pd4ml.document.id”, “0123456789abcdef”);
but it doesn’t allow us to override the JDK version or either the OS version.
Any other idea or other version in preparation ?
Best regards,
June 5, 2015 at 13:26#29630Please publish a sample PDF, generated with your actual PD4ML version, which illustrates the problem.
June 24, 2015 at 11:13#29631Hi !
We are trying to make binary comparaison on our pdf file to ensure non regression test.
As asked, two pdf which permit to understand well our problem.
From the unzipped pdf generated from linux we get the following header :
‘qn% PD4ML version: 396 Pro DMSn% JDK version: 1.7.0_79n% OS version: Linux 3.13.0-53-genericn% File encoding: UTF-8n%From the unzipped pdf generated from windows we get the following header :
‘qn% PD4ML version: 396 Pro DMSn% JDK version: 1.7.0_71n% OS version: Windows 7 6.1n% File encoding: windows-1252n%Thus, we still have some problem regarding binary comparaison. In fact the actual version of PD4ML doesn’t allow us to overwrite the data of the pdf regarding those 3 elements :
callParameters.append( “% JDK version: ” + System.getProperty( “java.version” ) + “n” );
callParameters.append( “% OS version: ” + System.getProperty( “os.name” ) + ” ” );
callParameters.append( System.getProperty( “os.version” ) + “n” );Hoping the release allowing this overwrite will be able soon.
Best regards,
October 14, 2015 at 15:47#29618Thus ?
March 11, 2016 at 16:04 -
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.