startprint() error

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
alexmak
Posts: 12
Joined: Mon Jan 23 2006

startprint() error

Post by alexmak »

When I call the startprint("", true) to display the printer select dialog and cancel out of the printer select, I get an error. Do you have anything built in to trap this error? This function does not return anything, maybe it should?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You can use the Try ... Catch or On Error ... Goto to catch the error generated and handle.

Hope this helps.
anshuman82
Posts: 21
Joined: Mon Feb 12 2007
Contact:

Unable to catch error when cancel button is clicked

Post by anshuman82 »

I am using following code to print the current page but I am unable to catch the error when Cancel button is clicked on Print Dialog. The contol never reaches to ErrorHandler.

Please help me out as i dont want to application to crash

With PDFCreactiveX1
On Error GoTo ErrorHandler
.StartPrint "", True

.PrintPage .CurrentPage
.ClearPage .CurrentPage
.EndPrint
End With

Exit Sub

ErrorHandler:
Err.Raise Err.Number, Err.Source, Err.Description
Err.Number
Anshuman
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello Anshuman,

I replied to your original post in this forum http://www.amyuni.com/forum/viewtopic.php?t=2123

hope this helps.
anshuman82
Posts: 21
Joined: Mon Feb 12 2007
Contact:

Unable to catch error when cancel button is clicked

Post by anshuman82 »

I am able to catch the unhandled error.
It was VB IDE settings which was not allowing the error to be handled
Anshuman
Post Reply