Printer not activated, error code -22

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
peatc
Posts: 2
Joined: Fri Feb 11 2005

Printer not activated, error code -22

Post by peatc »

I've recently downloaded the demo developer of the pdf converter to evaluate, but cannot get started with it.

This is the (Navision) code I am using:

vPDFPrinterCntrl.DriverInit('Amyuni PDF Converter');
vPDFPrinterCntrl.EnablePrinter('Evaluation Version Developer',vKey);
vPDFPrinterCntrl.DefaultDirectory('c:\temp');
vPDFPrinterCntrl.DefaultFileName('c:\temp\amyuniop.pdf');
vPDFPrinterCntrl.FileNameOptions:= 1+2;
vPDFPrinterCntrl.SetDefaultPrinter;

// code to run report here

vPDFPrinterCntrl.RestoreDefaultPrinter;

Just after the printing in progress dialog pops up I get the error message 'Printer not activated, error code -22'.

In the code above vKey is a text string holding the key as obtained from the Install.ini file. The printer name is exactly as it is shown in the windows control panel. Am I missing something?

Thanks.
peatc
Posts: 2
Joined: Fri Feb 11 2005

Post by peatc »

After the weekend break I've had another look at this and immediately saw that I had made an error in specifying the Key, and now have this code working
Post Reply