Printer Not Activated Errors

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
ASI-Rob
Posts: 2
Joined: Tue Nov 15 2005

Printer Not Activated Errors

Post by ASI-Rob »

I am having some trouble getting the printer activated with version 2.50 of the Driver. I did the initial install of the printer named "AutoSoft PDF Printer" during the demo install.

I am receiving the following error message on the 'Printer.Print "TEST"' line: "Printer not activated, error code -22"

Can anyone take a look at this code (its in VB 6.0) to see what I'm doing wrong?

Private Sub btnPrint_Click()
Dim AVAILPRNTR As Printer
For Each AVAILPRNTR In Printers
If AVAILPRNTR.DeviceName = "AutoSoft PDF Printer" Then
Set Printer = AVAILPRNTR
Exit For
End If
Next
Call EnablePrinter(m_PrinterHandle, "Evaluation Version Developer", "07EFCDAB01000100584F82962DEADB671CE2564605558C4039AEB6BDBA542926639B79ECC556F310DB8592F1C68BF146A4D4E86EB8C0E7824CE83E1E8DC2244449F2A2A71D89169AADABA03407F0B8DD4CD2302DE1F785F2D63118A06BF1C960C809115DDFF8EE5320AF3C4C33539D8EC6E6E6")
Printer.Print "TEST"
Printer.EndDoc
End Sub

Private Sub Form_Load()
m_PrinterHandle = DriverInit("AutoSoft PDF Printer")
Call EnablePrinter(m_PrinterHandle, "Evaluation Version Developer", "07EFCDAB01000100584F82962DEADB671CE2564605558C4039AEB6BDBA542926639B79ECC556F310DB8592F1C68BF146A4D4E86EB8C0E7824CE83E1E8DC2244449F2A2A71D89169AADABA03407F0B8DD4CD2302DE1F785F2D63118A06BF1C960C809115DDFF8EE5320AF3C4C33539D8EC6E6E6")
Call SetDefaultDirectory(m_PrinterHandle, "C:\ASITEXT")
Call SetDefaultFileName(m_PrinterHandle, "C:\ASITEXT\REPORT.PDF")
Call SetFileNameOptions(m_PrinterHandle, 3)
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call DriverEnd(m_PrinterHandle)
End Sub
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Your code seems fine and the activation code you are using seems fine.

Please check that you are not trying to activate an older version of the driver, maybe an older version is stuck in memory.

Please completely install the older version of the printer, reboot your system and install the new version again.

Hope this helps.
ASI-Rob
Posts: 2
Joined: Tue Nov 15 2005

Post by ASI-Rob »

I was working with Jose on this issue and he has helped me realize what was going wrong.

I had an error in the EnablePrinter Function Declaration;
I was accidentally passing the third parameter ByRef instead of ByVal.

Thanks for the assistance.
Post Reply