Error Printing using PDF Converter 2.10h

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 Printing using PDF Converter 2.10h

Post by schurter »

This problem is very similar to one I have posted before. However, the fix that worked for my development machine, does not work on any of the deployed clients. The original post was titled: "Error 482 Printing from VB6 using Active Reports"

We are trying to upgrade our clients to the 2.10h version of the software from 1.59. On a fresh install of our software, on a new client, everything runs fine (we use Wise for our base install). However, for clients that already have the code, and 1.59, we are providing a mini-install which will replace the appropriate components, including Amyuni. Here is our process:

Copy redistributable files to the main application directory:

Code: Select all

02/24/2004  01:33p             240,656 acfpdf.dll
02/24/2004  01:33p             304,096 acfpdf.drv
02/24/2004  01:33p                  74 acfpdf.txt
02/24/2004  01:33p             162,237 acfpdfu.dll
02/24/2004  01:33p             189,060 acfpdfui.dll
02/24/2004  01:33p           1,036,288 cdintf.dll
02/24/2004  01:33p             118,784 Install.exe
02/26/2004  12:44p                 784 install.log
We then execute Install.exe, using the following syntax:

Code: Select all

install.exe -s "Our Printer" -n "Our Company" -c "Our License Code"
From our application, we then run the following code:

Code: Select all

Set PDFObject = CreateObject("CDIntfEx.CDIntfEx")
If (Not PDFObject Is Nothing) Then
    PDFObject.DriverInit mPDFPrinter
    PDFObject.EnablePrinter "Our Company", "XXXXXXXXXXXX"
    PDFObject.SetDefaultPrinter
    PDFObject.DefaultFileName = mCURRENT_PDF_FILE
    PDFObject.DefaultDirectory = mPATH_TO_WORKING_DIRECTORY
    PDFObject.FileNameOptions = NoPrompt + UseFileName
    PDFObject.FontEmbedding = CBool(mFontEmbedding)
    PDFObject.Resolution = CLng(mResolution)
    PDFObject.JPEGCompression = CBool(mJPGCompression)
    PDFObject.HorizontalMargin = CLng(mMARGIN_HORIZONTAL)
    PDFObject.VerticalMargin = CLng(mMARGIN_VERTICAL)
    PDFObject.SetDefaultConfig
End If
Later in the code, we make the following calls:

Code: Select all

    ' arMainRpt is an ActiveReports object
    arMainRpt.Printer.DeviceName = mPDFPrinter
    arMainRpt.Printer.RenderMode = 1
    arMainRpt.Printer.StartJob arMainRpt.documentName
Like before, right on the StartJob line, we get a 482 error (Printer Error).

One of my concerns is what I read in the Common Driver Interface PDF, concerning EnablePrinter on page 84:
Calling the EnablePrinter function after installing the printer requires administrative rights under Windows NT/2000/XP, calling the
same function before every printout does not require administrative rights and can be used with users having limited priveleges
on the system.
Now, the clients that are running this code DO NOT have admin priviledges. Plus, the way we are deploying the software dos not give us the opportunity to log on as an Admin (there are 700+ machines). So if this is the problem, how can I get these PDF drivers to work? I thought the Install.exe method was supposed to eliminate the need for administrative priviledges within the code? If this isn't the problem, do you have any suggestions as to where I should start looking to find out why the clients are getting the 482 error? One other note, I have the VB6 environment on one of these computers and stepped through the code to make sure they were running the right versions of everything, and yes, it still gets the error. And, I also logged on as a local admin, and it still blows up.

Please assist.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Are you calling EnablePrinter right before starting the print job?
schurter
Posts: 6
Joined: Tue Feb 24 2004

EnablePrinter Call

Post by schurter »

What I ended up doing was calling EnablePrinter in between pages. Now the program seems to function. Are there any other changes I need to be aware of?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hi,

There is no real need to call EnablePrinter between pages unless you are printing a very large document that takes too much time.

Otherwise you can call EnablePrinter() in the EnablePre event thrown by the driver right before print out starts.

For more information about EnablePrinter() please check our new documentation "Common Driver Interface 210.pdf"

Hope this helps.
Post Reply