EnablePrinter()

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
nzhong
Posts: 2
Joined: Mon May 12 2003

EnablePrinter()

Post by nzhong »

I'm trying the DocConerter2.1 Dev version on Window2000. My target is to convert a .doc to a .pdf in my application.

I followed the step-by-step instruction listed in page 5 of "Common Drinver Interface 210.pdf" developer manual.
In Step 2, I choosed running install.exe to install "My PDF Printer". In step 4, I registered CDINF210.dll as a COM object.

Then in my application(C# .net), I refrenced the "Common Driver" COM object, and did the following steps:
CDIntfExClass _pdfPrinter = new CDIntfExClass();
_pdfPrinter.DriverInit("My PDF Driver");
_pdfPrinter.FileNameOptionsEx = 1 + 2;
_pdfPrinter.DefaultFileName = outputFileName;
..... // Do a print job, E.g, calling wordApplication.print() to print a .doc to
// the PDF printer.
_pdfPrinter.FileNameOptions = 0;
_pdfPrinter.DriverEnd();

By this far, I think I've done all the steps listed in the developer manual. However it didn't work after I ran it.

After some tries, I found out that it will work if I add a call to EnablePrinter(...) after calling DriverInit(...).

Is it right? Do I have to call EnablePrinter() even I choose runing install.ext to install the printer driver? If yes, do I just need to call EnablePrinter() once in my program, or I need to call it everytime when I want to do a print job?

-Nancy
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

You need to call EnablePrinter() before each printout.

Hope this helps.
Post Reply