Convert PDF/A and PDF/UA to PDF in Java

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.

  1. Open the source PDF/A file in a Document instance.
  2. Call removePdfaCompliance() to detach the archival compliance profile from the loaded document.
  3. 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.

  1. Open the source PDF/UA file in a Document instance.
  2. Call removePdfUaCompliance() to remove the accessibility compliance profile from the document metadata and structure requirements.
  3. 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());
    }
}