|
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?
|
|
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!
|
|
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"?
|
|
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.
|
|
Rank: Newbie Groups: Member
Joined: 2/23/2023 Posts: 6
|
It works correctly with the license. Thanks for the answers!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Great. Thank you very much for your business!
|
|