We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF/A2b validation problem

Hi

Apose.Pdf validates the attached PDF as not valid according to PDF/A2b standard, whereas Adobe Preflight validates it without any conformance issues, see attached screenshot. This seems to be a bug with validation of AcroForm in the Aspose.Pdf Validation routine.

best regards
Alex

Public_EPoststelle_Hauptdokument.zip (2.9 MB)
82030F7F.PNG (12.6 KB)

validation log:

    <Compliance Name="Log" Operation="Validation" Target="PDF/A-2B">
    	<Version>1.0</Version>
    	<copyright>Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved.</copyright>
    	<Date>08.05.2018 09:54:10</Date>
    	<file Version="1,4" Name="test.pdf" Pages="4">
    		<Catalog>
    			<Problem Severity="Error" Clause="6.9" Convertable="False">Acroform is enabled</Problem>
    			<Header />
    			<Fonts>
    				<Problem Severity="Error" Clause="6.3.6" ObjectID="1437" Page="4" Convertable="True">Width information for glyphs is inconsistent in embedded font 'LiberationSans-Italic'</Problem>
				<Problem Severity="Error" Clause="6.3.6" ObjectID="1438" Page="4" Convertable="True">Width information for glyphs is inconsistent in embedded font 'LiberationSans-Bold'</Problem>
				<Problem Severity="Error" Clause="6.3.6" ObjectID="1439" Page="4" Convertable="True">Width information for glyphs is inconsistent in embedded font 'LiberationSans'</Problem>
			</Fonts>
			<trailer />
			<Metadata />
			<objects />
			<xObjects />
			<actions />
		</Catalog>
	</file>
</Compliance>

@Alexander_Winkelmeyer

Thanks for your inquiry.

Please note that the conversion log shows the errors which API encounters during conversion process. However they have been resolved in output PDF document after conversion is complete. Furthermore, in order to validate the PDF/A compliance, you should use Document.Validate() method which will return true or false accordingly.

bool isValid = pdfDocument.Validate(PdfFormatConversionOptions.Default);

If above line of code returns isValid as false, it means the PDF document does not validate the PDF/A compliance. In event of any further query, please feel free to ask.

Thanks for answer.

Yes Document.Validate() returns false for the attached document, but Adobe Preflight says its valid!
If Adobe Preflight says its valid, then Document.Validate() should say it too.

best regards
Alex

@Alexander_Winkelmeyer

Thanks for getting back to us.

Please use following complete code snippet, in order to convert PDF document into PDF/A-2B and validate it after. We have tested the code snippet with one of our sample files and Document.Validate() method is returning true in that case. If you still observe any issue at your side, please share respective input PDF document with us, so that we can log an investigation ticket accordingly.

Document doc = new Document(dataDir + "Public_EPoststelle_Hauptdokument_2.pdf");
doc.Convert(dataDir + "validationlog.xml", PdfFormat.PDF_A_2B, ConvertErrorAction.Delete);
doc.Save(dataDir + "output_pdfa.pdf");
doc = new Document(dataDir + "output_pdfa.pdf");
bool validate = doc.Validate(dataDir + "validationlog.xml", PdfFormat.PDF_A_2B);

Hi @asad.ali

Sorry but you get me wrong. I don’t want to convert the PDF document. I just want to validate it using the Document.Validate() method, but it returns false instead of true. I also checked the PDF document with Adobe Preflight and its totally valid.

best regards
Alex

@Alexander_Winkelmeyer

Thanks for writing back.

We managed to observe that API was unable to validate the PDF document. Hence, we have logged an issue as PDFNET-44832 in our issue tracking system. We will further look into the details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.