PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) General questions / FAQ Trouble understanding differencies between Linux and Windows

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #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,

    #29620

    There 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]

    #29621

    Thanks 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,

    #29622

    To 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.

    #29623

    Thanks 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,

    #29624

    In 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.

    #29625

    Thank a lot for all your answers.

    All given solutions seems perfect !

    Can’t wait to see your new release !

    #29626

    Hi !

    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,

    #29627

    Hi,

    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,

    #29628

    v396 should do the trick (when “pd4ml.document.id” property is defined).

    #29629

    It’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,

    #29630

    Please publish a sample PDF, generated with your actual PD4ML version, which illustrates the problem.

    #29631

    Hi !

    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,

    #29618

    Thus ?

    #29617

    Could you tell me if we can overwrite JDK and OS version now ?

    Thanks in advance,

Viewing 15 posts - 1 through 15 (of 17 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.