Hi,
I encountered an error when I try to print a PDF document with this code:
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"c:\temp\a4.pdf");
PrintDocument pd = new PrintDocument();
pd = doc.PrintDocument;
pd.Print();
pd.Dispose();
doc.Close();
I received this error:
Source=System.Drawing
StackTrace:
à System.Drawing.Drawing2D.GraphicsPath.GetLastPoint()
à Spire.Pdf.General.Render.Font.Type1CFont.ᜀ(ᜀ A_0, GraphicsPath A_1, FlPoint A_2)
à Spire.Pdf.General.Render.Font.Type1CFont.ᜀ(Int32 A_0, Int32 A_1)
à Spire.Pdf.General.Render.Font.Type1CFont.GetOutline(String name, Single width, TypeEncodingCmap type)
à Spire.Pdf.General.Render.Font.OutlineFont.GetGlyph(Char src, String name, TypeEncodingCmap type)
à Spire.Pdf.General.Render.Font.PDFFontViewer.GetCachedGlyph(Char src, String name, TypeEncodingCmap type)
à Spire.Pdf.General.Render.Font.PDFFontEncoding.ᜁ(PDFFontViewer A_0, Char A_1)
à Spire.Pdf.General.Render.Font.PDFFontEncoding.GetGlyphs(PDFFontViewer font, String text)
à Spire.Pdf.General.Render.Font.PDFFontViewer.GetGlyphs(String text)
à spr᭖.ᜀ(spr᪠ A_0, spr᱁ A_1, Graphics A_2, PointF A_3)
à spr᱁.ᜁ(Graphics A_0, spr᪠ A_1, Boolean A_2)
à spr᪠.ᜀ(String A_0, spr᭖ A_1, String A_2, Boolean A_3)
à spr᪠.ᜀ(String[] A_0, String A_1)
à spr᪠.ᜀ(sprᯞ A_0)
à spr᪠.ᜆ(Boolean A_0)
à spr᪠.()
à Spire.Pdf.PdfDocument.ᜀ(Object A_0)
à Spire.Pdf.PdfDocument.OnPrintPage(Object sender, PrintPageEventArgs e)
à System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
à System.Drawing.Printing.PrintController.Print(PrintDocument document)
à System.Drawing.Printing.PrintDocument.Print()
à ConsoleApplication3.Program.Main(String[] args) dans c:\Users\philippe\Documents\Visual Studio 2013\Projects\ConsoleApplication3\ConsoleApplication3\Program.cs:ligne 19
à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
InnerException:
I upload the PDF document.
Can you help me?
Regards,
Philippe