public class PdfCompliance
Example:
Document doc = new Document(getMyDir() + "Images.docx");
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setImageCompression(PdfImageCompression.JPEG);
pdfSaveOptions.getDownsampleOptions().setDownsampleImages(false);
doc.save(getArtifactsDir() + "PdfSaveOptions.ImageCompression.pdf", pdfSaveOptions);
PdfSaveOptions pdfSaveOptionsA1B = new PdfSaveOptions();
pdfSaveOptionsA1B.setCompliance(PdfCompliance.PDF_A_1_B);
pdfSaveOptionsA1B.setImageCompression(PdfImageCompression.JPEG);
pdfSaveOptionsA1B.getDownsampleOptions().setDownsampleImages(false);
// Use JPEG compression at 50% quality to reduce file size
pdfSaveOptionsA1B.setJpegQuality(100);
pdfSaveOptionsA1B.setImageColorSpaceExportMode(PdfImageColorSpaceExportMode.SIMPLE_CMYK);
doc.save(getArtifactsDir() + "PdfSaveOptions.ImageCompression.PDF_A_1_B.pdf", pdfSaveOptionsA1B);
PdfSaveOptions pdfSaveOptionsA1A = new PdfSaveOptions();
pdfSaveOptionsA1A.setCompliance(PdfCompliance.PDF_A_1_A);
pdfSaveOptionsA1A.setExportDocumentStructure(true);
pdfSaveOptionsA1A.setImageCompression(PdfImageCompression.JPEG);
pdfSaveOptionsA1A.getDownsampleOptions().setDownsampleImages(false);
doc.save(getArtifactsDir() + "PdfSaveOptions.ImageCompression.PDF_A_1_A.pdf", pdfSaveOptionsA1A);
Field Summary | ||
---|---|---|
static final int | PDF_17 | |
The output file will comply with the PDF 1.7 standard.
|
||
static final int | PDF_15 | |
The output file will comply with the PDF 1.5 standard.
|
||
static final int | PDF_A_1_A | |
The output file will comply with the PDF/A-1a standard.
This level includes all the requirements of PDF/A-1b and additionally requires
that document structure be included (also known as being "tagged"),
with the objective of ensuring that document content can be searched and repurposed.
|
||
static final int | PDF_A_1_B | |
The output file will comply with the PDF/A-1b standard.
PDF/A-1b has the objective of ensuring reliable reproduction of the
visual appearance of the document.
|
public static final int PDF_17
public static final int PDF_15
public static final int PDF_A_1_A
public static final int PDF_A_1_B