Printer not activated, error code -20 with Windows Vista

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
chrisg
Posts: 8
Joined: Thu Dec 21 2006

Printer not activated, error code -20 with Windows Vista

Post by chrisg »

I am testing the latest version of the PDF printer driver (developer version - demo) on Windows Vista. I am getting error code -20 when I am logged in as an administrator user. The printer is getting installed (I can see it in the list of installed printers). The unique thing here is that if I then run our executable by right clicking and selecting "run as administrator" everything works correctly and without any errors or problems.

Since it runs when I "run as administrator" we can rule out an incorrect activation code.

What else could I be missing?

Thanks for any help,

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

Post by Joan »

Hello Chris,

When precisely are you getting error code -20?
chrisg
Posts: 8
Joined: Thu Dec 21 2006

Post by chrisg »

I can't say specifically. However, I can say that the printer initializes OK and the call to EnablePrinter is OK as well. In fact, it comes after the second call to EnablePrinter which is right before the print starts. We have a dialog on our screen that says that it is printing page 1. The printer is showing up in our list of installed printers at this point.

Again, note that running the application with the "run as administrator" works OK.
chrisg
Posts: 8
Joined: Thu Dec 21 2006

Post by chrisg »

I should also add that the error message comes up BEFORE the DEMO dialog box.
chrisg
Posts: 8
Joined: Thu Dec 21 2006

Post by chrisg »

I have now tried this with the full version 2.51 and the same problem exists. Again, running as administrator via right-clicking on the EXE works. Running the exe directly does not even though the user is an administrator.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

We will check this and get back to you.
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

The "Printer not activated. Error code -20" typically is generated when the PDF Converter encounters an issue with the activation code used to enable the printer. Either an incorrect activation code was used to install the printer or the PDF Converter is unable to read the activation code (activation code registry entry was not found).

Can you elaborate on how you installed the printer? Also, can you further explain what you mean by "running as administrator via right-clicking on the EXE"

Thanks
chrisg
Posts: 8
Joined: Thu Dec 21 2006

Post by chrisg »

The computer in question is connected to a network. The login I am using has Administrator rights to the machine and the network. However when I run our executable (we are using the Document Converter 2.51 developer edition), I get the stated error.

If I then right click on the executable, there is an option called "run as administrator". When I run the program that way, everything works as expected.

That proves that the activation code is correct since it works in that last case.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

By executable you mean your application or the exe installer of the Document Converter? Are you calling PDFDriverInit in your application?

I believe this is related to UAC.
User Account Control (UAC): this is a new concept to increase the security in windows vista. By default vista will run each application as a standard user even if you are logged in as Administrator. When trying to install an application that requires administrative privileges you are required to confirm this action.

If you are getting a message asking you to confirm if you effectively launched a given action while the application is running, the time you respond to the message and the application continues is definitely more than the tim the printer is activated by EnablePrinter, so the printer is un-activated by the time you respond to the message.

You can turn off UAC for a given account under Vista and check if you will still get this problem.
chrisg
Posts: 8
Joined: Thu Dec 21 2006

Post by chrisg »

Yes, our executable means a program we wrote.

Turning off UAC did the trick. So between that and the "run as administrator" option, I think we have enough to work with to figure out the best way for us to proceed.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Turning UAC off is helping because UAC ask the user for permission to proceed, the time needed to get the question and reply to it cause the printer to deactivate.

If you don't want to turn UAC off you can call EnablePrinter when catching the EnablePre() event generated by the driver.

Hope this helps.
jezekjkr
Posts: 11
Joined: Thu Feb 08 2007

VISTA developer print

Post by jezekjkr »

I have the same problem. On Vista driverInit not work because UAC
How I may use developer version to print on VISTA?
Only install PDF printer external (install.exe from Amyuni) and use it from our program?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

DriverInit will work under Vista, it is only PDFDriverInit that will not work if UAC is enabled.

To use the PDF Converter under Vista programatically you can do one of the following:

1 - Run Install.exe to install the Driver.
In your application Call DriverInit ad not PDFDriverInit

2 - Call PDFDriverInit in your application followd by DriverInit (The printer is installed the first time you run your application but will stay on the system even when closing your application)
In this case the first time you run your application you should disable UAC and then you can enable it back.

3 - Call PDFDriverInit alone to install a printer each time the application runs , in this case UAC should be disabled from the user account and the user should have administrative rights.

Important Notes:

A - Functions PDFDriverInit and / or DriverInit should be called Once in your application, when lunching your application and not each time you print.

B - While using the PDF Converter on Windows 2000 and above developers and end users are advised to install the printer on the system once when launching the application for the first time and keep it there even after the application ends (i.e: use 1 or 2 from above) more information are available on the installation section of the Developers' manual "Common Driver Interface 250.pdf" that you get with the product.

Hope this helps.
Hope this helps.
Post Reply