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.
Fri Jan 08, 2016 3:43 pm
Occasionally we encounter files like the one included in the attached zip file that produce an Overflow error from the System.Drawing assembly when printing with Spire.PDF.
Is there any setting to print the file and avoid the error?
Here is the code I use to print using Spire.PDF.
- Code: Select all
/// <summary>
/// Returns a <see cref="System.Boolean"/> indicating success of printing using the Spire.Pdf library.
/// <para>Spire.Pdf (http://www.e-iceblue.com/Introduce/pdf-for-net-introduce.html) converts the pdf document to a set of
/// images and uses the System.Drawing.Printing.PrintDocument class to send it to the printer.</para>
/// </summary>
/// <param name="DocumentFilePath">A <see cref="System.String"/> indicating the absolute path to the file.</param>
/// <param name="PrinterName">A <see cref="System.String"/> of the verified printer to receive this file.</param>
/// <returns>a <see cref="System.Boolean"/> indicating success of printing using the Spire.Pdf library</returns>
public static bool PrintUsingSpirePDF(string DocumentFilePath, string PrinterName)
{
bool result = true;
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile(DocumentFilePath);
doc.PrinterName = PrinterName;
System.Drawing.Printing.PrintDocument printDoc = doc.PrintDocument;
printDoc.Print();
doc.Close();
doc.Dispose();
return result;
}
Login to view the files attached to this post.
-

thomas.christ
-
- Posts: 2
- Joined: Tue Sep 15, 2015 8:51 pm
Mon Jan 11, 2016 2:50 am
Hi,
Thanks for your posting.
I have recreated the error with your pdf document, sorry for the inconvenience. The issue has been forwarded to our dev team.
We will inform you when it is resolved.
Best Regards,
Amy
E-iceblue support team
-


amy.zhao
-
- Posts: 3043
- Joined: Wed Jun 27, 2012 8:50 am
Mon Feb 01, 2016 8:46 am
Hi,
Thanks for waiting.
Your issue has been resolved. Welcome to download and test
Spire.PDF Pack(Hot Fix) Version:3.6.135.
Best Regards,
Amy
E-iceblue support team
-


amy.zhao
-
- Posts: 3043
- Joined: Wed Jun 27, 2012 8:50 am
Thu Feb 04, 2016 8:24 am
Hi,
Did new version resolve your issue?
Thanks for your feedback.
Best Regards,
Amy
E-iceblue support team
-


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