Upgrade -Printer not activated error

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
kmcveigh
Posts: 4
Joined: Thu Dec 20 2012

Upgrade -Printer not activated error

Post by kmcveigh »

I have just moved an old Omnis Studio application from a Win2003 32bit terminal server over to a new Win2008 R2 64bit terminal server.
The old server had Amyuni PDF Creator 2.50b
On the new server I downloaded and installed a trial version of 4.5.2.9
I changed the User and activation code in my application to match the trail one.
I also changed my code to use the newer dll (CDIntfEx.CDIntfEx.4.5)

Walking through the code it has no problem initializing and enabling the pdf printer
but when I try and print the report it returns a "Printer not Avtive -41" error.

The application is 32bit running on a 64bit system.
Kim McVeigh
Simon Fraser University
Burnaby, British Columbia Canada
Rich
Posts: 76
Joined: Thu Jun 16 2011

Re: Upgrade -Printer not activated error

Post by Rich »

To ensure that the Amyuni PDF printer is installed correctly you can try the following:

'--------------------CUT and SAVE with VBS extension ----START-------------------------

Dim PDF
Set PDF = CreateObject ("CDintfex.Cdintfex.4.5")

with PDF

'Change to the printer you normally install
.DriverInit "Amyuni PDF Converter"
.SetDefaultPrinter

.DefaultDirectory = "C:\amyuni\"
.DefaultFileName = "C:\amyuni\code.pdf"
.FileNameOptions = 3
.EnablePrinter "License to","Activation code"
.BatchConvert "C:\amyuni\test.txt"

.RestoreDefaultPrinter
.FileNameOptions = 0

end with

Set PDF = Nothing
'--------------------CUT and SAVE with VBS extension ----END-------------------------

You would need to do the following:

* copy and paste the above and save it as code.vbs
* change the name of the printer in the script to the one that you installed
* populate the License to and Activation code to the ones you downloaded in the eval version for 4.5
* create a decent sized text file to be converted to PDF

By doing this it ensures that the PDF printer is installed correctly. If so, then you would need to revisit your code and look at how you are enabling the printer.
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - http://www.amyuni.com
kmcveigh
Posts: 4
Joined: Thu Dec 20 2012

Re: Upgrade -Printer not activated error

Post by kmcveigh »

Converting your VB into C# (sorry but we are a C# shop now) I got the following

string licenseTo = "Amyuni PDF Converter Evaluation";
string activateCode = "07EFCDAB0100010025AFF1806CB8441306C5739F7DC52654D393BA9CECBA2ADE79E3762A64FFC3540A8A5F4A5811BE3204A0A439F5BA";

var PDF = new CDIntfEx.CDIntfEx();
string err;

PDF.DriverInit("Amyuni PDF Converter");
PDF.SetDefaultPrinter();
PDF.DefaultDirectory = @"C:\Users\kmcveigh\Desktop";
PDF.DefaultFileName = @"C:\Users\kmcveigh\Desktop\Test.pdf";
PDF.FileNameOptions = 3;
PDF.EnablePrinter(licenseTo, activateCode);
err = PDF.GetLastErrorMsg();
MessageBox.Show(err, "EnablePrinter", MessageBoxButtons.OK, MessageBoxIcon.Error);

PDF.BatchConvert(@"C:\Users\kmcveigh\Desktop\Server List.txt");
err = PDF.GetLastErrorMsg();
MessageBox.Show(err, "BatchConvert", MessageBoxButtons.OK, MessageBoxIcon.Error);

PDF.RestoreDefaultPrinter();
PDF.FileNameOptions = 0;
PDF.DriverEnd();

I used this on a button click of a windows form.
I added a Reference to C:\Windows\SysWOW64\cdintf450.dll (CDIntfEx)

When I run it I get a success message from the EnablePrinter.
But the BatchConvert triggers a "Printer not activated, error code -41".

I triple checked the activation code.
Kim McVeigh
Simon Fraser University
Burnaby, British Columbia Canada
Rich
Posts: 76
Joined: Thu Jun 16 2011

Re: Upgrade -Printer not activated error

Post by Rich »

Within the evaluation package that you downloaded there is a Sample folder that contains projects for C#, MFC and VB.NET. It will show you how to enable the printer and a few other basic functions for our PDF printer that you can build upon.

Error code -41: The "error code -41" is generated when calling the EnablePrinter() function with activation information from a previous version of the PDF Converter.
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - http://www.amyuni.com
kmcveigh
Posts: 4
Joined: Thu Dec 20 2012

Re: Upgrade -Printer not activated error

Post by kmcveigh »

I redownloaded the evaluation package.
I reinstalled this package on a different terminal server.
I modified the supplied C# sample to use the activation code and License To name.
When I run this sample it returns the error "Printer not activated, error code -41".

Here is my code change to the C# sample:
const string PDFprinter = "Amyuni PDF Converter";
const string strLicenseTo = "Amyuni PDF Converter Evaluation";
const string strActivationCode = "07EFCDAB0100010025AFF1806CB8441306C5739F7DC52654D393BA9CECBA2ADE79E3762A64FFC3540A8A5F4A5811BE3204A0A439F5BA";

Have made in error copying the name or code?
Is there anyway of verifying what the activation code is inside the installed printer?
Kim McVeigh
Simon Fraser University
Burnaby, British Columbia Canada
kmcveigh
Posts: 4
Joined: Thu Dec 20 2012

Re: Upgrade -Printer not activated error

Post by kmcveigh »

Found the problem!

I needed to add the license information to a command line execution of the installer.
Like so:

Install.exe -N "Amyuni PDF Converter Evaluation" -C "07EFCDAB0100010025AFF1806CB8441306C5739F7DC52654D393BA9CECBA2ADE79E3762A64FFC3540A8A5F4A5811BE3204A0A439F5BA"

Thanks for patience and help on this.
I'll get the boss to send off a purchase order...
Kim McVeigh
Simon Fraser University
Burnaby, British Columbia Canada
Post Reply