Convert PDF/A and PDF/UA to PDF in Java
Contents
[
Hide
]
Aspose.PDF for Java can convert standards-compliant PDF variants back to a regular PDF document.
Convert PDF/A to standard PDF
Use this example when an archival PDF/A document should be downgraded to a standard PDF.
- Open the source PDF/A file in a
Documentinstance. - Call
removePdfaCompliance()to detach the archival compliance profile from the loaded document. - Save the resulting standard PDF file without the PDF/A restriction set.
public static void convertPdfAToPdf(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
document.removePdfaCompliance();
document.save(outputFile.toString());
}
}
Convert PDF/UA to standard PDF
Use this example when an accessible PDF/UA document should be converted back to a standard PDF.
- Open the source PDF/UA file in a
Documentinstance. - Call
removePdfUaCompliance()to remove the accessibility compliance profile from the document metadata and structure requirements. - Save the resulting PDF document as a regular PDF file.
public static void convertPdfUaToPdf(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
document.removePdfUaCompliance();
document.save(outputFile.toString());
}
}