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