Hello,
english - Copy (2) (1).pdf (445.3 KB)
With Aspose.Drawing.PDF 25.12, when loading the attached PDF (version 1.5) and calling Document Convert method with PdfFormat.PDF_A_1A, PdfFormat.PDF_A_1B, PdfFormat.PDF_A_2A, PdfFormat.PDF_A_2B, the target PDF version is not changed and PDF version is still 1.5.
copyDoc.Convert(log, fmt, ConvertErrorAction.None) // with fmt is one of the previous target version.
copyDoc.Save (“c:\temp\target.pdf”)
@tfipsrd
-
The behavior you are observing—where the PDF version remains 1.5 after converting to PDF/A-1a, PDF/A-1b, PDF/A-2a, or PDF/A-2b—is consistent with how Aspose.PDF handles version preservation during conversion. When using Document.Convert() to convert to a PDF/A format, the base PDF version of the source document is retained rather than being updated to align with the underlying PDF version associated with the PDF/A standard (e.g., PDF 1.4 for PDF/A-1) .
-
As noted in community discussions, Aspose.PDF may produce PDF/A-1 output using PDF 1.7, even though the PDF/A-1 specification is based on PDF 1.4. There is currently no direct option to control the base PDF version during PDF/A conversion, which may lead to outputs that do not meet strict compliance requirements regarding the base version .
-
To help ensure conformance with the expected base PDF version, it is recommended to first convert the document to the desired PDF version before applying PDF/A compliance. For example:
- For PDF/A-1a or PDF/A-1b (intended for PDF 1.4), first convert the document to PDF 1.4 using
PdfFormat.v_1_4, then apply the PDF/A-1 conversion.
- For PDF/A-2a or PDF/A-2b (based on PDF 1.7), ensure the document is in PDF 1.7 format prior to conversion if strict version alignment is required.
Example:
using (var document = new Document("input.pdf"))
{
// Step 1: Convert to PDF 1.4
document.Convert(Stream.Null, PdfFormat.v_1_4, ConvertErrorAction.Delete);
// Step 2: Convert to PDF/A-1a (the document version is preserved)
document.Convert(log, PdfFormat.PDF_A_1A, ConvertErrorAction.None);
document.Save("output.pdf");
}
This two-step approach helps ensure the final document uses the appropriate base PDF version .
- The fact that your output PDF retains version 1.5 is consistent with this behavior. While the content may meet PDF/A structural requirements, the version mismatch could result in validation failures with strict PDF/A validators. Applying the two-step conversion process above may resolve this issue .
Note: Execution of the provided code was not completed due to an execution error, so the code remains a hypothesis based on documented patterns.