Users might need to change the file version of PDF documents for reasons such as compatibility with other software, or compatibility with features supported in the file version… Note that by default, when jPDFProcess creates a PDF document, the file version number is set to 1.7.
Here is sample Java code to change the file version number of a PDF document using jPDFProcess.
Warning: Changing the file version will not make the PDF document compatible with that version. It will only change the version number in the PDF file.
// Load existing PDF document // (alternatively Create new PDF document by leaving the file path null) PDFDocument pdfDoc = new PDFDocument("c:/test/doc.pdf", null); // Change to version 1.3 pdfDoc.setPDFFileVersion(1,3); pdfDoc.saveDocument("c:/test/doc1.3.pdf"); // Change to version 1.4 pdfDoc.setPDFFileVersion(1,4); pdfDoc.saveDocument("c:/test/doc1.4.pdf"); // Change to version 1.5 pdfDoc.setPDFFileVersion(1,5); pdfDoc.saveDocument("c:/test/doc1.5.pdf"); // Change to version 1.6 pdfDoc.setPDFFileVersion(1,6); pdfDoc.saveDocument("c:/test/doc1.6.pdf"); // Change to version 1.7 pdfDoc.setPDFFileVersion(1,7); pdfDoc.saveDocument("c:/test/doc1.7.pdf"); // Change to version 2.0 pdfDoc.setPDFFileVersion(2,0); pdfDoc.saveDocument("c:/test/doc2.0.pdf"); |