Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Mar 02, 2021 12:29 pm

Greetings,

I get multiple PDF/a files, which need some further editing. To accomplish this, I want to remove the Pdf/A Complliance. Used language is VB.NET.

Is this possible with Spire.Pdf?

So far I tried setting the Conformance Level to None before saving with no effect.

Another approach of mine was extracting the XMPData, rewriting it and updating:
Code: Select all
Dim meta As XmpMetadata = pdfIn.XmpMetaData
Dim value As String = meta.XmlData.InnerXml.ToString
[removing "pdfaid:part" and "pdfaid:conformance" nodes from value]
pdfIn.XmpMetaData.XmlData.LoadXml(value)


But when I load the PDF up again, the previous XMP-Data and PDF/a compliance remains.

Am I using the wrong approach?

Thank you,
F.Brischwein

fbrischwein
 
Posts: 2
Joined: Tue Mar 02, 2021 12:04 pm

Wed Mar 03, 2021 5:46 am

Hello Brischwein,

Thanks for your inquiry.
Please refer to the following code to convert PDF/A files to regular PDF files. If this does not solve your problem, please provide us with your input file and we will investigate further. You could upload it here or send it to us ([email protected]) via email. Thanks in advance.
Code: Select all
        Dim input As String = "PDFA3A.pdf"
        Dim doc As PdfDocument = New PdfDocument
        doc.LoadFromFile(input)
        Dim newDoc As PdfNewDocument = New PdfNewDocument
        newDoc.CompressionLevel = PdfCompressionLevel.None
        For Each page As PdfPageBase In doc.Pages
            Dim size As SizeF = page.Size
            Dim p As PdfPageBase = newDoc.Pages.Add(size, New Spire.Pdf.Graphics.PdfMargins(0))
            page.CreateTemplate.Draw(p, 0, 0)
        Next
        newDoc.Save("PDFAToPdf-result.pdf")


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Mar 03, 2021 1:25 pm

Hello Brian,

it works like a charm.

Thank you very much,
F.Brischwein

fbrischwein
 
Posts: 2
Joined: Tue Mar 02, 2021 12:04 pm

Thu Mar 04, 2021 10:35 am

You are welcome.
If you encounter any issues related to our products in the future, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF

cron