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.

Mon Oct 13, 2025 10:23 pm

I run a process that will convert 15k - 400k pdf files from normal pdf to pdf/a. From the examples on the website, I would have to re-instantuate the PdfStandardsConverter for every single file which totally destroys the GC gen 2, and slows things down.

Normally.. in C#, you create the object once, then run converters/processes against/with that object per file.

PdfStandardsConverter converter = new (InFile); <--- on every file.

Normally in C# is...

PdfStandardsConverter converter = new() <-- called once...

converter.convert(InFile, Outfile) <--- called per file.

This is with the newest version of the library. Are there plans to allow something like this? The library is a GC killer right now :(

SOADRB01
 
Posts: 5
Joined: Thu Oct 03, 2024 4:55 pm

Tue Oct 14, 2025 9:50 am

Hello,

Thank you for your inquiry.
Our Dev team has analyzed that the method PdfStandardsConverter converter = new PdfStandardsConverter("path") simply registers the file path of the PDF document and does not have a significant impact on processing performance. Therefore, changing the approach to PdfStandardsConverter converter = new PdfStandardsConverter(); converter.convert(InFile, OutFile) will not notably alter the conversion speed. If this method is causing considerable performance issues in your workflow, please share your test files with us. We will conduct further investigation. Please upload the files to your cloud storage and share the download link with us as attachments, or send them directly to my email at [email protected]. Thanks in advance.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 331
Joined: Mon Apr 14, 2025 3:33 am

Tue Oct 14, 2025 5:20 pm

Good Morning,

We are a government agency. The test files contains HIPAA and PII data. I can't send copies over without an agreement in place. The act of recreating the converter for every file is what causes the GC to crazy. This is what happens to any object that gets recreated thousands of times in C#. That was why I was asking if there was a possibility to creating what I mentioned previously. The conversion itself is roughly 150ms per pdf. While I cannot do anything about the speed of the converter, that one change should fix the GC issue :)

SOADRB01
 
Posts: 5
Joined: Thu Oct 03, 2024 4:55 pm

Wed Oct 15, 2025 3:37 am

Hello,

Thank you for your feedback.
The PdfStandardConverter implements the IDisposable interface. You can use the following code to release memory resources:

Code: Select all
PdfStandardsConverter converter = new PdfStandardsConverter("path");
converter.ToPdfA1A("Outfile");
converter.Dispose();


Could you please test this in your environment? We look forward to your test feedback.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 331
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.PDF