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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user