Hello,
I am trying to print a pdf document with the sample code
PdfDocument doc = new PdfDocument();
//Load file
doc.LoadFromFile("PrintWithoutPrintDialog.pdf");
//Set the print controller without printing process dialog
doc.PrintSettings.PrintController = new StandardPrintController();
//Print all pages with default printer
doc.Print();
but when it hits the doc.Print(); I get a Exception
System.Runtime.InteropServices.ExternalException occurred
HResult=0x80004005
Message=A generic error occurred in GDI+.
Source=System.Drawing
StackTrace:
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.FillPath(Brush brush, GraphicsPath path)
at sprᷦ.ᜀ(sprᲵ A_0, spr A_1, Graphics A_2, PointF A_3)
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ᷦ.ᜀ(spr⁏ A_0, String A_1, String A_2)
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()
at Print_PDF.Program.Main(String[] args) in C:\Users\Public\Customers\XXXXXX\Docs\PDF_Printing\Source\Print_PDF\Print_PDF\Program.cs:line 28
any help would be appreciated.
Thanks
Mike K