PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

PdfFilePrinter
https://forum.pdfsharp.net/viewtopic.php?f=2&t=254
Page 1 of 1

Author:  jra2007 [ Mon Nov 05, 2007 6:39 pm ]
Post subject:  PdfFilePrinter

When I am trying to execute the following code,

Dim printer As PdfFilePrinter = New PdfFilePrinter("C:\TEMP\OutboundCorrespondence\" + _PdfOutputFile, _
PrinterName)

Try
printer.Print()


Catch ex As Exception
Console.WriteLine("Error: " + ex.Message)
End Try

I get the following exception

--------------------------------------------------------------

System.ComponentModel.Win32Exception: The system cannot find the path specified
at PdfSharp.Pdf.Printing.PdfFilePrinter.Print(Int32 milliseconds)
at PdfSharp.Pdf.Printing.PdfFilePrinter.Print()
at Bcbst.IM.Services.OutboundCorrespondence.PdfBatch.MergeAndPrint() in C:\Documents and Settings\J59546A\My Documents\Visual Studio 2005\Projects\OutboundCorrespondenceService\PdfBatch.vb:line 194

Author:  stebo0728 [ Tue Nov 04, 2008 10:52 pm ]
Post subject:  PathToAdobeReader

hey, you have to set the static variable of PdfFilePrinter.PathToAdobeReader to the either adobereader or acrobat executable file before you call Print(), are you doing this? also you need to define the default printer name if you do not use the Print method that calls for a printer name

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/