Save PDF in specific version

Help
Thilo
2011-03-07
2014-01-17
  • Thilo
    Thilo
    2011-03-07

    Hi folks,

    can anyone give me directions on how to save a newly created PDF in a specific PDF version, let's say 1.5, using the C# version of Clown PDF?

    I'll be thankful for any hints!

     
  • Daniel Kraus
    Daniel Kraus
    2014-01-17

    Hey there,

    I'm trying to do the same in Java. Unfortunately it seems like only increasing the version number works. In addition to that, File#getVersion() returns something different my OS or my PDF reader tells me about the current PDF version. Basically I'm doing something like:

    File pdf = new File(file.getAbsolutePath); // "file" is the java.io.File representation.
    Document document = pdf.getDocument();
    
    // Modification...
    
    document.setVersion(version);
    pdf.save(serializationMode);
    pdf.close();
    

    To see the full source code go to https://bitbucket.org/beatngu13/pdfbookmarkwizard, org.bitbucket.beatngu13.pdfbookmarkwizard.Wizard.java is where the magic happens... I'm using PDF Clown 0.1.2.

    Thanks in advance!