Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Can not print to PDF device. Please use EO.Pdf to render HTML page to PDF Options
Emad Khalil
Posted: Monday, October 1, 2018 10:41:48 AM
Rank: Newbie
Groups: Member

Joined: 10/1/2018
Posts: 1
Hi

I'm using EO.Pdf to programatically produce pdf from html, then print it..

Code: C#
SavePDF(PDFFilePath, TempFolderPath);
PdfDocument PDFDoc = new PdfDocument(PDFFilePath);

PrinterSettings settings = WebView.GetDefaultPrinterSettings();
// set the settings from a custom print dialog
settings.PrinterName = printDialog.SelectedPrinter;
settings.DefaultPageSettings.PaperSize = new PaperSize();
settings.DefaultPageSettings.PaperSize.RawKind = printDialog.SelectedPaperSize;
settings.DefaultPageSettings.Landscape = printDialog.SelectedPaperOrientation.IsLandscape;
settings.PrintToFile = true;

PDFDoc.Print(settings, null);


It works fine when i print from a normal printer or "XPS document writer", but when i choose "Microsoft Print to PDF" it gives the following crash:


Code: C#
Exception:
System.Exception: Can not print to PDF device. Please use EO.Pdf to render HTML page to PDF.
   at EO.WebBrowser.WebView.a(PrinterSettings A_0, PageSettings A_1)
   at EO.Internal.y9.a(PrinterSettings A_0, PageSettings A_1)
   at EO.WinForm.PdfViewer.Print(PrinterSettings printerSettings, PageSettings pageSettings)
   at EO.Pdf.PdfDocument.d.a()
   at EO.Base.WaitableTask.a.a(WaitableTask A_0)
   at EO.Base.WaitableTask.i()
   at EO.Internal.y9.a(Boolean A_0)
   at EO.Internal.y9.e.a()
   at EO.WebBrowser.WebView.w()
   at EO.WebBrowser.WebView.o.a(IntPtr A_0, Int32 A_1, IntPtr A_2, IntPtr A_3, Boolean& A_4)
   at EO.Internal.x.l.a(IntPtr A_0, Int32 A_1, IntPtr A_2, IntPtr A_3, IntPtr A_4, IntPtr A_5)
   at EO.Internal.x.b(c& A_0)
   at EO.Internal.x.a(c& A_0)
   at EO.Internal.x.a(Int32 A_0)
   at EO.Base.ThreadRunnerBase.c(Boolean A_0)
   at EO.Base.ThreadRunnerBase.b(Boolean A_0)



The error happened on Windows 10, EO.pdf version is 18.1.91.0

Thanks
eo_support
Posted: Monday, October 1, 2018 10:56:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,678
Hi,

You can not print a PDF file to another PDF file. The purpose of the print feature is to print to a real printer.

Thanks!
Fabien
Posted: Tuesday, October 2, 2018 3:35:17 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2014
Posts: 109
Hi,

Some of our customers ask us to print in PDF with their printer as they do with any program on Windows 10. Could you consider "unlocking" this feature.

Thank you.
eo_support
Posted: Tuesday, October 2, 2018 9:14:09 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,678
Wouldn't it be easier if you just give the PDF file directly to your customer instead of having to go through another printer device to get another PDF file? What's the purpose of trying to print a PDF file through a PDF printer in order to get another PDF file?
Fabien
Posted: Monday, October 8, 2018 3:04:43 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2014
Posts: 109
Hi,

For my part, I was talking about EO.WebBrowser in which you put the same restriction on the use of a virtual printer.

We can't create a PDF edition of all the screens in your app just because you lock a Windows 10 feature... some of our customers just want to save in pdf what they see on their screen but they can't.

Thanks
eo_support
Posted: Monday, October 8, 2018 8:35:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,678
You will need a license for EO.Pdf to convert any web page to PDF. What we can do is to enable this feature on EO.WebBrowser if you also also have an EO.Pdf license. In your case, since you have been an EO.WebBrowser license for a long time, we can upgrade your EO.WebBrowser license to EO.Total just for the price difference (the current subscription expiration date will stay the same after the upgrade). Please let us know if this works for you.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.