Error 482 Printing from VB6 using Active Reports

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
schurter
Posts: 6
Joined: Tue Feb 24 2004

Error 482 Printing from VB6 using Active Reports

Post by schurter »

We have some legacy code that runs on PDF Converter 1.59. This code utilizes ActiveReports as the "graphics engine", which uses the Amyuni driver as a standard printer. When I upgraded the code to use the new 2.10h version which we just licensed, code that used to execute normally now will not run. The error I get is 482 - Printer Error.

Question #1: Is there a "Step-Up" document that itemizes the differences between 1.59 to 2.10.

Question #2: Does anybody have some simple VB code that exercises the 2.10 driver so I can see if the driver is even installed correctly?

Question #3: Is there anything wrong with the steps I have taken here:
1. Installed the Amyuni Application
2. Ran Install.exe using "NG PDF Printer" as the printer driver name
3. Used the following code to run the driver:

Code: Select all

Set PDFObject = New CDIntfEx.CDIntfEx
If (Not PDFObject Is Nothing) Then
    PDFObject.PDFDriverInit PRINTER_NAME  ' "NG PDF Printer"
    PDFObject.DriverInit PRINTER_NAME
    PDFObject.SetDefaultPrinter
    PDFObject.DefaultFileName = mCURRENT_PDF_FILE
    PDFObject.DefaultDirectory = mPATH_TO_WORKING_DIRECTORY
    PDFObject.FileNameOptions = NoPrompt + UseFileName
    PDFObject.FontEmbedding = CBool(mFontEmbedding)
    If (IsNumeric(mResolution)) Then
        PDFObject.Resolution = CLng(mResolution)
    End If
    PDFObject.JPEGCompression = CBool(mJPGCompression)
    'If Margins set...
    If (IsNumeric(mMARGIN_HORIZONTAL)) Then
        PDFObject.HorizontalMargin = CLng(mMARGIN_HORIZONTAL)
    End If
    If (IsNumeric(mMARGIN_VERTICAL)) Then
        PDFObject.VerticalMargin = CLng(mMARGIN_VERTICAL)
    End If
    PDFObject.SetDefaultConfig
... The Active Reports Calls:

Code: Select all

arMainRpt.Printer.DeviceName = PRINTER_NAME
    arMainRpt.Printer.RenderMode = 1
    arMainRpt.Printer.StartJob arMainRpt.documentName  
==== BOOM ====
==== Error 482 ====

Obviously, I don't expect any Active Reports experts here, but can you see anything out of whack in the above code?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

The issue you are facing is quite easy. You are printing to the PDF Printer without enabling it this is why you are getting the error.

Using version 2.10 of the PDF Converter, you need to enable the printer after installing it and before printing to it.

To enable the printer you can call:
EnablePrinter (LicenseTo, ActivationCode)
Right after your call to PDFDriverInit() and right before printing starts.

You must have received your 'LicenseTo' and 'ActivationCode' when getting version 2.10, this code should be kept private with you and shouldn't be distributed to your customers.

For more information on installing and using version 2.10 please check our new Developers' manual "Common Driver Interface 210.pdf".

Note: If you are installing the Printer using Install.exe, there is no need to call PDFDriverInit in your code, you can call DriverInit directly and call EnablePrinter right after DriverInit.

Hope this helps.
schurter
Posts: 6
Joined: Tue Feb 24 2004

I Love Simple Solutions

Post by schurter »

Thanks so much. That was the problem.
- Bruce
Post Reply