I'm using Spire.PDF to write some simple code to generate PDFA documents.
1. Is it possible to create a PDFA and add custom properties to it?
The following code creates a PDFA but doesn't add the custom property test-ing to the document.
If I add the custom property before changing the conformance level the property test-ing is added but the document is no longer saved as a PDFA.
- Code: Select all
Dim originalDocument As New PdfDocument
originalDocument.LoadFromFile("...\originalDocument.pdf", FileFormat.PDF)
Dim PDFADocument As New PdfNewDocument
'PDFADocument.DocumentInformation.SetCustomerDefined("test", "ing")
PDFADocument.Conformance = PdfConformanceLevel.Pdf_A1B
For Each page As PdfPageBase In originalDocument.Pages
Dim size As SizeF = page.Size
Dim p As PdfPageBase = PDFADocument.Pages.Add(size, New Spire.Pdf.Graphics.PdfMargins(0))
page.CreateTemplate().Draw(p, 0, 0)
Next
PDFADocument.DocumentInformation.SetCustomerDefined("test", "ing")
PDFADocument.Save("...\PDFADocument.pdf")
Thanks,
Ryan