Thanks for your console application, it worked indeed, there were no validation errors anymore. When I followed this up, I found that I tested the conversion at different locations of my code, just a bit unorganized. So at one place it worked, but in the context of the code below it didn't. The point was that setting the zoom level of the PDF document broke the PDF/A validation:
- Code: Select all
Dim pdfDoc As New PdfDocument
pdfDoc.LoadFromXPS(My.Computer.FileSystem.SpecialDirectories.Desktop + "\xpsExport.xps")
Dim page As PdfPageBase = .Pages(0)
Dim dest As New General.PdfDestination(page, New System.Drawing.PointF(-40.0F, -40.0F))
dest.Mode = General.PdfDestinationMode.FitToPage
Dim gotoaction As New Actions.PdfGoToAction(dest)
'---> this breaks the PDF/A validation!
pdfDoc.AfterOpenAction = gotoaction
'---------------------------------------------
Using pdfStream As New IO.MemoryStream
pdfDoc.SaveToStream(pdfStream)
Dim newDOC = New Conversion.PdfStandardsConverter(pdfStream)
newDOC.ToPdfA3B(My.Computer.FileSystem.SpecialDirectories.Desktop + "\pdfA_Test.pdf")
End Using
When commenting out the line 'pdfDoc.AfterOpenAction = gotoaction', validation passes again nicely. Hopefully you can reproduce this.