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 Jul 12, 2022 4:05 pm

Hello,

I'm trying to find a solution for converting a PDF to a PDF/A-3A in .NET. When testing .NET PdfStandardsConverter with an input PDF containing JavaScript, I noted the result still contained JavaScript. To check on this further, I ran the result through a PDF-A validator and it is not a valid PDF-A. I get the following issues noted:

Screen Shot 2022-07-12 at 8.56.07 AM.png


I'm using the latest version of Spire.PDF (v8.7.2.1040). My code is the following and I've attached the input and output PDFs of my test case in a zip file.

Code: Select all
string inputFile = @"input.pdf";
string outputFolder = @"Output\";
PdfStandardsConverter converter = new PdfStandardsConverter(inputFile);
converter.ToPdfA3A(outputFolder + "ToPdfA3A.pdf");


Is there something more I need to be doing to generate valid PDF-A files?
Last edited by jasonjtyler on Wed Jul 13, 2022 3:44 pm, edited 1 time in total.

jasonjtyler
 
Posts: 2
Joined: Tue Jul 12, 2022 3:45 pm

Wed Jul 13, 2022 6:08 am

Hello Jason Tyler,

Thanks for your message. I did notice that the converted PDFA3A file is failed to pass the verification. However, when I directly convert your "input.pdf" to PDFA3A by Adobe Preflight, there also are some errors, it can not be converted successfully. Anyway, I have logged your file issue into our bug tracking system with the ticket SPIREPPT-5432. Our Dev team will do more investigations to check if there is any approach to generate a valid PDFA3A file. Once there is any update, I will inform you asap.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Wed Jul 13, 2022 3:43 pm

Thanks for your time on this. That's odd about the PDF. I received it as a PDF I should use for testing removal of JavaScript, so I cannot speak to its origins. If it turns out this PDF/A simply cannot be converted because it itself is invalid in some way, that's understandable but I need to know the conversion was not successfully so that I can reject the file. If the PDF cannot be successfully converted to a valid PDF/A format, it would be really helpful to get some kind of failure or error code.

I also wanted to note that I tried only removing JavaScript using:

Code: Select all
PdfDocument doc = new PdfDocument("input.pdf");
bool result = doc.RemoveDocumentJavaScript();
Console.WriteLine(result);
doc.SaveToFile("Output\\no-js.pdf");


This also fails to remove the JavaScript. result is false, and no-js.pdf still contains the JavaScript. I'm not sure if it's related to the same issue but seems it may be.

Thanks again!
Jason

jasonjtyler
 
Posts: 2
Joined: Tue Jul 12, 2022 3:45 pm

Thu Jul 14, 2022 8:55 am

Hello Jason Tyler,

Thanks for your reply.
Our Dev team is doing more investigations to locate the cause of the verification failure. If the failure is caused by the original PDF itself, I also have requested our Dev team to check whether our product can throw some errors.
Besides, when removing the JavaScript, it did return 'false' as you mentioned that. I have logged this issue into our bug tracking system with the other ticket SPIREPDF-5344. Our Dev team will investigate together.
I will let you know once there is any progress about your issues.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Wed Aug 17, 2022 9:51 am

Hello Jason Tyler,

Thanks for your patience!
Glad to inform you that we just released Spire.PDF Pack(Hot Fix) Version:8.8.6 which fixes the issue with SPIREPDF-5342. Please download the new version from the following links to test.
Website download link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget download link: https://www.nuget.org/packages/Spire.PDF/8.8.6

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Return to Spire.PDF