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.

Thu Oct 23, 2025 9:46 am

Hi

We use Spire.Pdf to generate Pdf Files from Html-Strings, using the ChromeHtmlConverter:
https://www.e-iceblue.com/Tutorials/NET/Spire.PDF-for-.NET/Program-Guide/Conversion/C-Convert-HTML-to-PDF-using-ChromeHtmlConverter.html

Unfortunatly we ran in some Problems. Our service runs inside a Linux-Container, but the Problem also appears when we run our software in windows 10, 64-bit debugging with VS.
This Problem can happen at any time, but we were able to reproduce it by sending multiple requests in short notice (5x per script) on the endpoint of our service.

This seems to crash either chrome or the ChromeHtmlConverter itself.
At first the requests seem to get lost, we dont run into any exception which our code could catch, we dont run into any timeout which we set for the ChromeHtmlConverter.
We never get a response from the converter.ConvertToPdf call and also the output Log just stops at a specific point.

This is only reproducable in our linux container:
Once an error occured, later calls fail with the exception "No valid Base64", which is not true since the exact same request works other times.
The service doesnt "fix" itself anymore, once it is in this state only a restart of the container fixes this issue.

Can you please support us in this case?

How to reproduce under Windows:
- Have Chrome installed
- Create new Solution with a Project "ASP.NET Core Web API" with these options:
-> Framework: Net 8.0
-> Authentication Type: None
-> Configure for HTTPS
-> Enable OpenAPI Support
-> UseControllers
- Install "Spire.PDFfor.NETStandard" Version 11.9.17 with nuget
- Create a simple class & interface with a parameterless void, with the Code from your page (Including the Logger, so under "Generate Output Logs During HTML to PDF Conversion in C#"), modify definition of ouputFile & logFilePath accordingliy:
Code: Select all
   string guid = Guid.NewGuid().ToString();
   string outputFile = $"{guid}_HtmlToPDF.pdf";
   
   // Specify the log file path
   string logFilePath = $"{guid}_Logs.txt";

- Register Interface in startup as Transient:
Code: Select all
builder.Services.AddTransient<IPdfConverter, PdfConverter>();

- Create controller with parameterless HttpGet Function, inject interface & call the function.
Code: Select all
   [ApiController]
   [Route("[controller]")]
   public class HtmlController(IPdfConverter pdfConverter) : ControllerBase
   {
   
       [HttpGet]
       public async Task<ActionResult> Hello()
       {
           try
           {
               pdfConverter.ConvertHtmlToPdf();
               return this.Ok();
           }
           catch(Exception ex) {
               return this.StatusCode(500, ex.Message);
           }
       }
   }

- Create a Script which instantly calls this Endpoint 5x

The Result should be that only 2-3 pdfs are generated, while the other 2-3 Log-Files look like the attached File.

I could provide a dockerfile as well in the future for linux but i guess ist the same issue since the Logs from ChromeHtmlConverter.Logger stop at the same time.

BEKB
 
Posts: 23
Joined: Wed Dec 16, 2015 2:36 pm

Fri Oct 24, 2025 3:52 am

Hello,

Thank you for your inquiry.
Based on my initial testing, I'm still unable to reproduce the issue you described. Could you please provide your complete, runnable project, input files, output files, and your Dockerfile? This information will help us investigate your issue more accurately and offer an effective solution. You may upload the files as attachments, send them directly to my email: [email protected] or upload the file to your cloud storage drive and share the download link with us. Thanks in advance.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Mon Oct 27, 2025 8:29 am

Hi Talia
Please find the attached file, including the project and some 2 scripts to reproduce the issue.
You just need to start up the app & run the 5_times.ps1 script once, which should result in 2-3 pdfs & 5 log files inside the project folder, so 2-3 requests should get lost.

I left pdfs & logs from 1 run of the script inside the project, so you can check it as well.
I also tried to keep the project as simple as possible, to make sure no other component is causing the issue.

I dont have a dockerfile ready, but i will try to upload one as soon as possible.

Best regards,
Till

BEKB
 
Posts: 23
Joined: Wed Dec 16, 2015 2:36 pm

Mon Oct 27, 2025 10:19 am

Dear Till,

Thank you for your sharing.
I have logged this issue into our bug tracking system with the ticket SPIREPDF-7803. Our dev team will investigate it, once there is any update, I will notify you immediately. To assist us in resolving this matter efficiently, we would greatly appreciate it if you could share any additional test files related to this issue, such as a Dockerfile. Thank you for your patience and cooperation.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Tue Oct 28, 2025 11:37 am

Hi Talia
Thanks for keeping me up to date, can i see this ticket SPIREPDF-7803 somewhere?

I attached another zip, this time its a project including a dockerfile & again the script files.
You should be able to start the project with docker desktop, it works when using the swagger to run the requests one at a time (Logs & Pdf-File will be visible in the directory again).
If you run the script 5_times.ps1 again (maybe you need to adjust the port in request.ps1), the application will most of the time not return a single ok request.
There are exceptions, they are logged:
Code: Select all
System.Exception: Google Chrome exited unexpectedly
   at Spire.Additions.Chrome.ChromeHtmlConverter.ConvertToPdf(String input, String outputFile, ConvertOptions options)


After 1-2 of these i get these Exceptions:
Code: Select all
System.Exception: Cannot access a disposed object.
Object name: 'System.Net.WebSockets.ClientWebSocket'.
   at Spire.Additions.Chrome.ChromeHtmlConverter.党()
   at Spire.Additions.Chrome.ChromeHtmlConverter.Dispose()
   at Spire.Additions.Chrome.ChromeHtmlConverter.ConvertToPdf(String input, String outputFile, ConvertOptions options)


Sometimes my debugging-session also crashed.
Thanks for taking another look.

BEKB
 
Posts: 23
Joined: Wed Dec 16, 2015 2:36 pm

Wed Oct 29, 2025 10:09 am

Hello,

Thank you for sharing the additional details.
I have reproduced the issues in Docker and documented the issues you encountered with Docker in our internal tracking system under ticket SPIREPDF-7803. Our development team will now conduct further investigation and work on implementing the fixes. Please note that SPIREPDF-7803 is managed within our internal system and is not accessible through external platforms. Rest assured that we will promptly notify you as soon as there are any updates regarding this matter. We truly appreciate your understanding and continued support.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Mon Nov 24, 2025 4:05 pm

Hi Talia

Do you have any update on this issue or an estimate on when i can expect one?

Thanks,
Till

BEKB
 
Posts: 23
Joined: Wed Dec 16, 2015 2:36 pm

Tue Nov 25, 2025 1:14 am

Hello,

Thanks for your following up.
Apologies, but we haven't made significant progress on issue SPIREPDF-7803 yet. I have followed up with our dev team and urged them to speed up the investigation. Once the problem is resolved, I will update you immediately. Please allow us more time, your understanding is greatly appreciated.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Fri Dec 05, 2025 8:29 am

Dear Till,

Thank you for your patience.
Our Dev team has analyzed the files you provided and identified the cause of the issue. The issue(SPIREPDF-7803) arises from a conflict between your concurrent requests and the operational principle of ChromeHtmlConverter. The conversion process of Spire.PDF, which transforms HTML to PDF, follows an independent sequence: it sends a request, performs the conversion, then sends a data receipt request and finally receives the data. Your script currently dispatches five requests simultaneously, causing subsequent requests to interrupt the execution of prior ones. We recommend that you either wait for each conversion to complete fully before initiating the next request, or implement independent process locking for each conversion task to ensure proper isolation and execution order. Thank you for your understanding and support.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Wed Dec 31, 2025 4:14 pm

Hi Talia

Unfortunately this doesnt really help. We can reproduce this issue by calling the Api multiple times.
But in our productive environment this issue also happens randomly without multiple calls being made at the same time. We just dont see a pattern or reason why this happens, so this is why we used this way to reproduce it.

Also we tried exactly what you are suggesting:
We locked the conversion in our code, only running the next conversion once the previous one was finished.
The error still occured, just less reliable.
We used the semaphore-class and in another attempt the lock-statement. In both cases the execution waited until the previous one was finished but we still ran into the same problem. Even if we added another second between the finished execution and the next, we still encountered these errors.

Could you provide a working example of this?

Thanks, Till

BEKB
 
Posts: 23
Joined: Wed Dec 16, 2015 2:36 pm

Fri Jan 02, 2026 3:03 am

Hi,

Thank you for your feedback. I will forward it to the developers for further investigation.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3047
Joined: Wed Jun 27, 2012 8:50 am

Mon Jan 26, 2026 4:34 pm

Hi Amy

Do you have any updates on this matter?

This issue is urgent for us, i would like to point out that this is a productive issue, crashing our services.
Luckily the amount of users is quite low at the moment since the serivce is in an introduction phase & we can manually restart the containers..
But as soon as the amount of users increases (which will be soon), we cant keep this solution running like this.

If this issue cant be resolved, we will have to look for alternative solutions.
Initially we tried to get the QT-Plugin working, but according to this post we switched our approach to the ChromeToHtmlConverter:
compatibility-of-spire-pdf-with-linux-docker-containers-t13464.html

Thanks for your help,
Till

BEKB
 
Posts: 23
Joined: Wed Dec 16, 2015 2:36 pm

Tue Jan 27, 2026 10:08 am

Hello,

Thank you for your follow-up.
Our development team has completed the investigation into this issue and is currently adjusting the internal code. I have urged them to expedite the fix. Once the issue is resolved, we will provide you with the hotfix version as soon as possible. Thank you for your understanding.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Tue Feb 17, 2026 12:33 pm

Hi Talia

Any indication on when this fix will come?
Your last post sounded like you found the issue in the code and the fix should be available soon, its been another 3 weeks.

Thanks, Till

BEKB
 
Posts: 23
Joined: Wed Dec 16, 2015 2:36 pm

Wed Feb 18, 2026 2:03 am

Hello,

Thank you for following up.
Regarding issue SPIREPDF-7803, due to its complexity, the solution our development team previously attempted was found to have issues during subsequent testing. Our dev team are still conducting further processing. Please bear with us for a little more time. Thank you again for your patience and support.
Sincerely,
Talia
E-iceblue support team
User avatar

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

Return to Spire.PDF

cron