AddPDFCreatorPrinter via clsPDFCreator in vbscript

 Hello,

 

After installing PDFCreator 1.3.1, i havec a problem to create new printer using VBScript, method cAddPDFCreatorPrinter. It doesn't install printer and non error is returned.

Looking at the source code in class clsPDFCreator, old method is used to Install Printer.

Replacing the code "InstallPrinter" by "InstallWindowsPrinter" in cAddPDFCreatorPrinter, it's OK. Could you please update the code for future versions ?

 

For the moment, i must reinstall PDFCreator 1.2.3.

 

Grégory CARNET

 

 

 

 

 cAddPDFCreatorPrinter() seems to not work in version 1.3.2.

 

Tested with vb script or c# program, same result: nothing seem to happen and the PDFCreator log shows

 18/04/2012 17:53:21: InstallPrinter [NEWPRINTER]: 1796: Le port spécifié est inconnu.

 

"Le port spécifié est inconnu" means "Unknown port".

 

 Cheers

 Workaround: as the GUI works to create a new printer, I used AutoIt to create a new printer "automatically". 

 

```

Run("C:\Program Files\PDFCreator\PDFCreator.exe", "C:\Program Files\PDFCreator");
WinWaitActive("PDFCreator");
Sleep(200);

Display the Printers dialogbox

Send("!p");
Sleep(200);
Send("{ENTER}");
Sleep(500);

Setting the new printer name and validating

Send("+{TAB}");
Sleep(200);
Send("MY_NEW_PRINTER_NAME");
Sleep(200);
Send("+{TAB}");
Sleep(200);
Send("{SPACE}");

Wait for the system to create the new printer

Sleep(4000);

Close Printer dialogbox and PDFCreator

Send("!{F4}");
Sleep(200);
Send("!{F4}");
Sleep(2000);

Optional: assign a profile to the new printer

RegWrite("HKEY_CURRENT_USER\SOFTWARE\PDFCreator\Printers", "MY_NEW_PRINTER_NAME", "REG_SZ", "PROFILE_NAME");

<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>

This problem is fixed in the next version.