Printer not Activated 3.00 to 4.5 upgrade...

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
acwilkins
Posts: 4
Joined: Thu Sep 17 2009

Printer not Activated 3.00 to 4.5 upgrade...

Post by acwilkins » Tue Mar 26 2013

I have read through countless posts and all the documentation several times. This was supposed to be a drop in the bucket upgrade, or so I thought. :)

I changed out the printer name and license key in our code and I get Printer Not Activated, error code -30.

Here's some code, I have omitted our messagebox error handling code and just included our calls to the Amyuni Driver:

At Start of Application:

hPrinter = DriverInit("Integritas PDF Printer")
result# = SetLicenseKeyA(LicensedBy, LicenseKey)

- Both return Success


Just before Print command issued:

hPrinter = DriverInit("Integritas PDF Printer")
Lock(hPrinter, LockName) !Lock name is primed with print job name

FullName = CLIP(DirectoryPath) & CLIP(FileName)
UseOptions = e_NoPrompt + e_UseFileName
SetDocFileProps(hPrinter, LockName, UseOptions, DirectoryPath, FullName)

EnablePrinter(hPrinter, LicensedBy ,LicenseKey)

- All Return a success

Print Command is issued: Result = 'Printer Not Activated, error code -30'


After Print Command is completed:

DriverEnd(hPrinter)


I also found a vbs script in these forums to test the install of the driver and it proved successful. My c# code that uses the driver for silent printing of PDFs activates works fine. Our native code which actually "prints" to the driver does not.

Rich
Posts: 76
Joined: Thu Jun 16 2011

Re: Printer not Activated 3.00 to 4.5 upgrade...

Post by Rich » Wed Mar 27 2013

What I think may be occuring since you are using the Lock function is that you need to turn on "file Extensions".

This can be found in Control Panel under Folder Options | View | uncheck Hide extensions for know file types.

Hope this helps.
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - http://www.amyuni.com

acwilkins
Posts: 4
Joined: Thu Sep 17 2009

Re: Printer not Activated 3.00 to 4.5 upgrade...

Post by acwilkins » Wed Mar 27 2013

I'm on my development machine... I already have that turned on.

Wondering if I really need the lock function? This is a multi threaded app.

Rich
Posts: 76
Joined: Thu Jun 16 2011

Re: Printer not Activated 3.00 to 4.5 upgrade...

Post by Rich » Wed Mar 27 2013

What you can do as well is to pause the printing and see in the print queue the name of the print job file.

The situation you have described may occur when the Amyuni PDF Converter is used in multi-threaded environments. However, the PDF Converter exposes API calls that the developer can use to resolve this situation.

The Lock\Unlock functions can be used in multi-threading situations to avoid conflicts between multiple applications or multiple threads requesting simultaneous access to the Converter products.

The CDIntf library uses the registry to interact with the printer drivers. When the Lock function is used, the output file name and options are set using the SetDocFileProps function and not from the SetDefaultFileName and SetFileNameOptions functions which manipulate registry entries that are common to all users. The Lock function works by locking the process based on the document name used in the print spooler. You can pause the printer spooler and check that the document name you are passing the lock function is the correct document name. The Unlock function is used after printing has ended to make sure another printout can start. The call to Unlock is needed only in the case where an error occurs; the printer will otherwise call Unlock internally as soon as printing starts to allow another printout to occur in parallel. The Timeout value represents the Timeout in milliseconds after which the function returns.

I have included below a link to our online documentation which explains this in greater detail.
https://www.amyuni.com/WebHelp/Amyuni_D ... s/Lock.htm

Please take a look at the code below which illustrates this.

#DEFINE printer_name "Amyuni PDF Converter Sample" &&define printer name
**Create Object
PDFconverter = CREATEOBJECT("CDIntf.CDIntf.4.5")

SET DEFAULT TO "CPDFConverterActiveX" && modify this line to point to the real application location ** Handle errors
LOCAL oErr as Exception
TRY
** Attaches to Existing Printer
PDFconverter.DriverInit (printer_name)
SET PRINTER TO NAME (printer_name)
&&Must use unique Document name
&& The document name is the report name
PDFconverter.Lock("shirt.frx")
PDFconverter.SetDocFileProps("shirt.frx", 3, "c:\temp", "c:\temp\vfp.pdf")
REPORT FORM shirt.frx NOEJECT NOCONSOLE TO PRINTER
PDFconverter.Unlock("shirt.frx", 1000)
PDFConverter.FileNameOptions = 0 && reset options
** Free Object
PDFConverter = 0
CATCH TO oErr
MESSAGEBOX( oErr.Message )
CANCEL
ENDTRY
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - http://www.amyuni.com

acwilkins
Posts: 4
Joined: Thu Sep 17 2009

Re: Printer not Activated 3.00 to 4.5 upgrade...

Post by acwilkins » Wed Mar 27 2013

I have read that and it appears as if we're using it correctly.

What has me here, is that we've been using this for years in our application. Initially I did not modify any code other than to change the license key, update the libs and recompile.

We are using the native DLL implementation, I reviewed the call sequence in our code comparing with the example you provided and it's dead on.

I handled our upgrade from 210 to 300 without an issue, this is a little frustrating I'm not really sure what's happening here. :?

Any other suggestions?


Edit: More info: The print job never gets to the queue... as soon as I initiate the print I get the not activated -30 error.

acwilkins
Posts: 4
Joined: Thu Sep 17 2009

Re: Printer not Activated 3.00 to 4.5 upgrade...

Post by acwilkins » Wed Mar 27 2013

Resolved! Thanks for you help, but it turned out to be an issue with my dev environment. It was not updating my lib reference. A little voodoo in the right place works wonders. :)

Post Reply