Fix PDF/A conversion status check in PDFMerger

Previously, the code checked the status of the original document
after converting the merged PDF to PDF/A, which could miss
conversion errors. Now, it correctly checks the status of the
merged PDF to ensure the conversion succeeded.
This commit is contained in:
2026-03-10 04:07:28 +01:00
parent 466d0a3a7a
commit b20aafe7a5

View File

@@ -56,7 +56,7 @@ Public Class PDFMerger
' Convert to PDF/A ' Convert to PDF/A
oMergedPDF.ConvertToPDFA(oFinalStream, PDFAConformanceLevel, ALLOW_VECTORIZATION, ALLOW_RASTERIZATION) oMergedPDF.ConvertToPDFA(oFinalStream, PDFAConformanceLevel, ALLOW_VECTORIZATION, ALLOW_RASTERIZATION)
oStatus = oDocumentPDF.GetStat() oStatus = oMergedPDF.GetStat()
If oStatus <> GdPictureStatus.OK Then If oStatus <> GdPictureStatus.OK Then
Throw New MergeDocumentException($"Document could not be converted to PDF/A: {oStatus}") Throw New MergeDocumentException($"Document could not be converted to PDF/A: {oStatus}")
End If End If