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 Sep 09, 2021 9:48 am

Hi,

We are using spire to pdf and xls files.
The code was working for a long time without issues, but now it throws following error (seemingly at random times):
Code: Select all
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, PointF point, StringFormat format)
at spr?.?(Graphics A_0, spr? A_1, Boolean A_2)
at spr?.?(Graphics A_0, spr? A_1, Boolean A_2)
at spr?.?(String A_0, spr? A_1, String A_2, Boolean A_3)
at spr?.?(String[] A_0, String A_1)
at spr?.?(spr? A_0)
at spr?.?(Boolean A_0)
at spr?.?()
at spr?.?(PrintPageEventArgs A_0, PdfPageBase A_1, RectangleF A_2)
at spr?.?(PrintPageEventArgs A_0)
at spr?.?(Object A_0, PrintPageEventArgs A_1)
at System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintDocument._OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at spr?.?()
at Spire.Pdf.PdfDocument.Print()

or
Code: Select all
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, PointF point, StringFormat format)
at spr?.?(Graphics A_0, spr? A_1, Boolean A_2, Boolean A_3)
at spr?.?(Graphics A_0, spr? A_1, Boolean A_2, Boolean A_3)
at spr?.?(String A_0, spr? A_1, String A_2, Boolean A_3)
at spr?.?(String[] A_0, String A_1)
at spr?.?(spr? A_0)
at spr?.?()
at spr?.?(Boolean A_0)
at spr?.?(Graphics A_0, spr? A_1, spr? A_2)
at spr?.?(String[] A_0)
at spr?.?(spr? A_0)
at spr?.?()
at spr?.?(Boolean A_0)
at spr?.?(Graphics A_0, spr? A_1, spr? A_2)
at spr?.?(String[] A_0)
at spr?.?(spr? A_0)
at spr?.?()
at spr?.?(Boolean A_0)
at spr?.?(Graphics A_0, spr? A_1, spr? A_2)
at spr?.?(String[] A_0)
at spr?.?(spr? A_0)
at spr?.?()
at spr?.?(Boolean A_0)
at spr?.?(Graphics A_0, spr? A_1, spr? A_2, spr? A_3, Image A_4)
at spr?.?(PrintPageEventArgs A_0, PdfPageBase A_1, RectangleF A_2)
at spr?.?(PrintPageEventArgs A_0)
at spr?.?(Object A_0, PrintPageEventArgs A_1)
at System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintDocument._OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at Spire.Pdf.PdfDocument.Print()

We have tried to replicate it unsuccessfully and only the european production environment is affected (the load on this environment is significantly higher).
We have tried:
- updating the spire packages spire.xls and spire.pdf to the latest versions
- updating the spire package spire.xls and removing the spire.pdf package (as it doesn't seem to contain anything necesairy to make it work)
- removing both and using the lastest version of spire.office
all of these changes worked during testing, but made the error seem more frequent on the live environment.
The problem also does not lie with the documents printed as these have been tested extensively.

Is there any knowns issues when using printing under high load?

Kind regards,

Chris Brouwers

brouwerschris
 
Posts: 4
Joined: Thu May 20, 2021 8:51 am

Fri Sep 10, 2021 3:57 am

Hello Chris,

Thanks for your inquiry.
I will post this issue to our Dev team, and they will further troubleshoot the internal code to try to locate the issue. At the same time, to help us better investigate, please provide us with the following information. Thanks in advance for your assistance.

1. Your complete code.
2. The detailed information of the european production environment, including OS information (e.g. Win10, 64bit) and region settings (e.g. Ireland, English).
3. Your project type (e.g. ASP.NET Web) and your project target framework (e.g. .NET Framework 4.5).
4. Your printer name (e.g. HP LaserJet P1007).


Sincerely,
Brian
E-iceblue support team
User avatar

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

Mon Sep 13, 2021 9:33 am

Hello Brian,

1. Is there an email where I can send a simplified version of the code to? Company policy does not allow for sharing code.
2. The application is deployed on a windows server 2016, 64 bit
3. The project is a .Net Framework 4.6.1 Console application which will we deployed as a windows service which will trigger the code to run every 10 seconds.
4. There is a large amount of printers we print to, a lot of different kinds aswell, some of which include:
- Kyocera_P6026
- Kyocera TASKalfa 3252ci KX
- Kyocera ECOSYS M2030dn KX

Kind regards,

Chris Brouwers

brouwerschris
 
Posts: 4
Joined: Thu May 20, 2021 8:51 am

Mon Sep 13, 2021 9:43 am

Hello,

Thanks for your response.
You could send your complete code or your runnable project to us(support@e-iceblue.com) via email. Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Tue Oct 05, 2021 7:40 am

Hello Brian,

Do you have any updates on this issue?

Kind regards,

Chris Brouwers

brouwerschris
 
Posts: 4
Joined: Thu May 20, 2021 8:51 am

Tue Oct 05, 2021 9:26 am

Hi Chris,

Thanks for your following up.
I'm sorry that the issue has not been resolved. And now we are on the China's National Day Holiday from 01/10/2021 to 07/10/2021(GMT+8:00), I will urge our Dev team to investigate it ASAP once we back to office on 08/10/2021. Apologize for the delay.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Thu Oct 21, 2021 7:25 am

Hello Brian,

The holidays have been over for a while now.
Is there any new available by any chance?

Kind regards,

Chris Brouwers

brouwerschris
 
Posts: 4
Joined: Thu May 20, 2021 8:51 am

Thu Oct 21, 2021 10:53 am

Hello Chris,

Thanks for your follow up.
According to the information you provided, our Dev team has simulated more tests, but unfortunately we did not reproduce your issue. They analyzed your error message and code, combined with the content code of our product, and suspected that the problem may be caused by insufficient system memory.
Does the server in your European environment have less memory available compared to other servers? Please try adding the code "doc.Close();" and "doc.Dispose();" to release resources to see if the issue still occurs?

Anyway, our Dev team will also continue to investigate to locate the cause. We sincerely apologize for the inconvenience caused to you.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Return to Spire.PDF