Welcome Guest Search | Active Topics | Sign In | Register

EO.Pdf, PdfDocument, Print() function just process hangs Options
John
Posted: Thursday, February 23, 2023 4:43:25 AM
Rank: Newbie
Groups: Member

Joined: 2/23/2023
Posts: 6
Hello.
I have problems with PdfDocument.

I have code:
Code: Visual Basic.NET
Dim document As New PdfDocument("c:\\temp\\testPdf.pdf")
AddHandler EO.Base.Runtime.Exception, AddressOf EOException

Dim printSettings As New PrinterSettings With {
     .PrinterName = "Microsoft Print to PDF",
     .PrintFileName = "c:\\temp\\testPrint.pdf",
     .PrintToFile = True
}
document.Print(printSettings).WaitOne() '<- the process freezes here
RemoveHandler EO.Base.Runtime.Exception, AddressOf EOException

My system do nothing. Just wait document.Print(printSettings).WaitOne().
I don't have errors in EOException method.

In the future I will print documents on a real printer, but for development and testing I will use this approach with "Microsoft Print to PDF".

What am I doing wrong?
How should pdf files be printed?
eo_support
Posted: Thursday, February 23, 2023 9:50:08 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

Please try the same code on a regular printer. Our code does not allow you to use "Microsoft Print to PDF" device unless you have an EO.Pdf license. So if you use a regular printer it should work.

An exception will be thrown internally when you try to use "Microsoft Print to PDF" printer without an EO.Pdf license, but the current version did not properly propagate this exception back to your code. We will fix this problem in our next build.

Thanks!
John
Posted: Thursday, February 23, 2023 9:59:42 AM
Rank: Newbie
Groups: Member

Joined: 2/23/2023
Posts: 6
I am currently using the trial version of your product.
For example, when I create PDF files I see this text "Created with EO.Pdf for .NET trial version. https://www.essentialobjects.com".
In the trial version of the product the code above should freeze when printing in "Microsoft Print to PDF"?
eo_support
Posted: Thursday, February 23, 2023 9:10:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
John wrote:
I am currently using the trial version of your product.
For example, when I create PDF files I see this text "Created with EO.Pdf for .NET trial version. https://www.essentialobjects.com".

This is normal. Once you apply a license key, this message will go away.

John wrote:
In the trial version of the product the code above should freeze when printing in "Microsoft Print to PDF"?

This is correct. Again once you apply a license key, it will work correctly.

However in our next build, even if you don't apply a license key, it will NOT freeze, it will throw an exception with message "Can not print to PDF device" instead.
John
Posted: Monday, February 27, 2023 7:21:39 AM
Rank: Newbie
Groups: Member

Joined: 2/23/2023
Posts: 6
It works correctly with the license.
Thanks for the answers!
eo_support
Posted: Monday, February 27, 2023 11:00:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great. Thank you very much for your business!


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.