VC++ app - StartDoc fails when used with DoPrintDialog()

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
Ankur Saxena
Posts: 6
Joined: Mon Jun 20 2005

VC++ app - StartDoc fails when used with DoPrintDialog()

Post by Ankur Saxena »

I am working on a VC++ application. Application works fine when i do the printing through EnablePrinter() but StartDoc() gives an error if i use the DoPrintDialog().

DoPrintDialog() opens the print dialog then i select the PDF converter printer. But StartDoc returns an error.

Can anybody tell me why it does not give any error with the EnablePrinter() and gives error with DoPrintDialog()?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

The printer needs to be activated right before printing. This is why you are getting an error when using DoPrintDialog().

Hope this helps.
Ankur Saxena
Posts: 6
Joined: Mon Jun 20 2005

Post by Ankur Saxena »

Can you please tell me the activation process. Is it a call to the EnablePrinter() API or something else?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

The Activation Process is a call to the EnablePrinter() API, you need to call this API when catching the EnablePre() event generated by the driver or right before printing.

The Developer version of the PDF Converter can't be used to let your users print directly from Windows applications like Word, Excel, ect... so in this case printing will not work.

I suggest that you send us an e-mail to support@amyuni.com to give us more details about how you are using the PDF Printer and we will help you to activate it properly and we will let you know which license is the more appropriate for your scenario.
Ankur Saxena
Posts: 6
Joined: Mon Jun 20 2005

Post by Ankur Saxena »

Regarding printing, my application opens standard printing dialog box (DoPrintDlg()). Now i can select the "Amyuni PDF converter" from the printer list. But after clicking the OK button, my application fails at the StartDoc() function. In this case, i am not making a call to the DriverInit() and EnablePrinter() APIs. I have tried with these APIs also but no success.

Will it be possible to select the PDF converter from the standard printing dialog box and do the printing for me?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

This is possible if your application prints reports generated by the application itself or a specific document that is opened throught the application.

This is not possible however if the application enables the users to choose any document (Word or Excel lets say) and print it.
Ankur Saxena
Posts: 6
Joined: Mon Jun 20 2005

Post by Ankur Saxena »

Thanks for your inputs !!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

As a general info, i want to add that if the developer has an application that enable the users to print from Excel, Word or any other Windows application directly and he or she wants to integrate our driver in that application they can check with our Sales Department sales@amyuni.com for royalty bases licenses.

Best Regards.
Andy Bantly
Posts: 7
Joined: Fri Aug 05 2005
Contact:

You don't have to pay those royalties

Post by Andy Bantly »

Most Microsoft Products are OLE enabled products. If you are familiar with the COM interface IPrint, then you can print your Microsoft office documents using your own created printer DC. When you use your PDF printer device for this then you can cause the other programs to create PDF output for you.
Post Reply