Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: ePrint add Printer error
Started by jjohns at 11-18-2008 12:05. Topic has 13 replies.

Print Search « Previous Thread Next Thread »
  11-18-2008, 12:05
jjohns is not online. Last active: 12/11/2008 7:48:01 PM jjohns

Top 500 Posts
Joined on 12-11-2007
Posts 10
ePrint add Printer error
Reply Quote
We are trying to develop a custom printer using the basic ePrint tool kit.  The executable runs fine on the development box, but when we install it on the test machine we get a 21009 error on the AddPrinter call.  The stack trace reveals that the error occurs in EPrintClass.SetPrinterSpecifications.  As far as we can tell all of the required dlls are installed to the system 32 directory.  The user running the application is a sytem admin, and has full access to all parts of the system.

We have to be missing something in the installer.  If you could point out what that might be I would appreciate it.

Joseph Johns
jjohns@virpack.com

   Report 
  11-19-2008, 10:47
Maen Hasan is not online. Last active: 12/30/2008 4:32:47 PM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,876
Re: ePrint add Printer error
Reply Quote
Joseph,

Did you run the setup of ePrint itself on the deployment machine or how exactly did you install the printer driver there?

If the same user that owns the printing process that fails tries to print a test page using the LEADTOOLS ePrint 5 printer, does it work?

Thanks,
Maen Badwan
LEADTOOLS Technical Support

   Report 
  11-20-2008, 11:06
jjohns is not online. Last active: 12/11/2008 7:48:01 PM jjohns

Top 500 Posts
Joined on 12-11-2007
Posts 10
Re: ePrint add Printer error
Reply Quote
Okay the installer performs the following actions:

The dlls specified in the documentation as common dlls are copied into system 32.  the main COM dlls are registered.
Our application dlls are copied into the install directory.
Under the install directory a bin and spool directory are created.
The eprint exe and the 4 COM servers for 2000/xp are copied into the bin directory and the COM servers are registered..

At this point the Documentation (http://www.eprintdriver.com/help/v5.0/COM/dllaux/ePrintFiles.htm) says this should be sufficient.  You mention runnning the ePrint setup?  Are you reffering to running the ePrint.exe?  If I run that file and select try (this is a test machine after all) the problem still occurs.  I assume that running our development installer on the client box comes under the heading of A Bad Thing (tm) (although it does fix the problem, unsurprisingly).

In our code (c# using the COM api) we are doing the following:

EPrint eprint = new EPrint();

eprint.UnlockSupport(SupportLockConstants.SUPPORT_GENERAL, "Key Redacted");

// get printer type
PrinterTypeConstants printerType = eprint.GetPrinterType("Printer name");
// check printer type
if (PrinterTypeConstants.PRINTER_NONE == printerType)
{
            // add printer
            eprint.AddPrinter("Printer name", PrinterTypeConstants.PRINTER_NORMAL);
 
            // set settings
            EpnPrinterSpecificationsClass printerSpecs = new EpnPrinterSpecificationsClass();
            printerSpecs.PrintQuality = RESOLUTION_300_DPI;
            printerSpecs.PortraitOrient = true;

            // save settings
            eprint.SetPrinterSpecifications("Printer name", printerSpecs);
}

This code fails on the eprint.AddPrinter call with a "LEAD Error: Internal Error 21009 - call LEAD".

Joseph Johns

   Report 
  11-20-2008, 13:56
jjohns is not online. Last active: 12/11/2008 7:48:01 PM jjohns

Top 500 Posts
Joined on 12-11-2007
Posts 10
Re: ePrint add Printer error
Reply Quote
I feel I should note that we are intercepting printed pages via the provided events as opposed to using the ePrint stuff to print something.  Once the pages are intercepted then they are converted to a multipage tiff and uploaded via http to a website.

I would have edited this into the previous comment, but it seems that is disabled.

Joseph Johns

   Report 
  11-23-2008, 10:36
Maen Hasan is not online. Last active: 12/30/2008 4:32:47 PM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,876
Re: ePrint add Printer error
Reply Quote
Joseph,

You are using the correct help topic, and should not need to run our setup.
Since running the installer of our ePrint itself makes it work, this indicates you're either missing needed files, or not registering files that need registration.

Please note the difference in requirements from one OS to another and also between 32-bit and 64-bit systems. Are you sure you followed all steps, created needed folders and copied files correctly?

Thanks,
Maen Badwan
LEADTOOLS Technical Support

   Report 
  11-25-2008, 20:44
jjohns is not online. Last active: 12/11/2008 7:48:01 PM jjohns

Top 500 Posts
Joined on 12-11-2007
Posts 10
Re: ePrint add Printer error
Reply Quote
I am fairly certain that all the files specified in the documentation have been installed.  However, as I have found several errors in this section of the docs I will detail that steps and files I have installed, and provide a code sample which has the issue.  All of this was done by hand to prevent installer issues from interfering This is going to be fairly long.

1. Created a c:\EPrintTest directory
2. Created a c:\EPrintTest\bin and c:\EPrintTest\spool directory
3. Copied my executable and the interop to the c:\EPrintTest directory
4. Copied EPrint.exe to the bin directory
5. Copied the following COM severs to the bin directory from LEAD\Redist\comsvr\
          LPCLB05n.dll
         
LPCMG05N.exe
          LPWSE05N.EXE
          LPCPN05N.dll
6. Copied the following files to system32 from LEAD\Redist\Dll\Common\
         
LPKRN05N.DLL
          LPRNT05N.DLL
          LPDLG05N.DLL
          LPRES05N.DLL
          LPEML05N.DLL
          LPUNI05N.DLL
          LPEMF05N.DLL
          LTTTF14N.DLL     -- note this was actually in Redist\dll\LEAD145
          LPUIT05N.DLL
          LPUIR05R.DLL
          LTACT.DLL
          LTACT14N.DLL
7. Copied the following files to system32 from LEAD\Redist\Dll\ LEAD145\
          LTKRN14N.DLL
          LTDIS14N.DLL
          LTFIL14N.DLL
          LTEML14N.DLL
          LFWMF14N.DLL  -- note this was actually in Redist\dll\Filters
          LTANN14N.DLL
          LTCLR14N.DLL
          LTDIC14N.DLL
          LTEFX14N.DLL
          LTIMG14N.DLL
          LVKRN14N.DLL
7. Copied the following files to system32 from LEAD\Redist\Dll\ winNT\
          LPDRV05N.DLL
          LPUID05N.DLL
          LPUMD05N.DLL
          LPPMN05U.DLL
          LPRPC05U.DLL
8. Copied all of the files in LEAD\Redist\Dll\Filters\ to system 32.
9. Copied the LPEPC05N.dll file to the bin directory.  This file was not included in the required files docs, however I figured it was needed as it was the file I imported in the code.
10. Registered LPCLB05n.dll, LPCMG05N.exe, LPWSE05N.EXE, LPCPN05N.dll, and LPEPC05N.dll.  All registrations succeeded.

Those were the exact steps I took to install the product onto a clean XP 32bit SP2 system.  No executables were run nor were any other files installed.  When the test executable was ran I got the 21009 error as before.  Just as a test I installed the Leadtools ePrint installer.  The code still failed, this time with a file not found when the events were being set up.

This is the code that was ran during this test.  It is not meant to do anything.  It is just meant to illustrate the steps we are using.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LPEPCLib;

namespace EPrintTest
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                //---- setup EPrint object -----
                // new object
                EPrint eprint = new EPrint();

                // unlock features
                const string EPRINT_KEY = "KEY REDACTED";
                eprint.UnlockSupport(SupportLockConstants.SUPPORT_GENERAL, EPRINT_KEY);

                // get printer type
                PrinterTypeConstants printerType = eprint.GetPrinterType("TestPrinter");

                // check printer type
                if (PrinterTypeConstants.PRINTER_NONE == printerType)
                {
                    // printer does not exist
                    //this fails before the installer is run
                    eprint.AddPrinter("TestPrinter", PrinterTypeConstants.PRINTER_NORMAL);

                    // set settings
                    EpnPrinterSpecificationsClass printerSpecs = new EpnPrinterSpecificationsClass();
                    printerSpecs.PrintQuality = -3;
                    printerSpecs.PortraitOrient = true;

                    // save settings
                    eprint.SetPrinterSpecifications("TestPrinter", printerSpecs);
                }

                EpnUISettings epnUISettings = new EpnUISettings();
                const int HIDE_STATUS_DIALOG = 0x0010;
                epnUISettings.ShowOptions = HIDE_STATUS_DIALOG;
                eprint.SetPrinterUISettings("TestPrinter", epnUISettings);

                //enable events
                eprint.set_EnableShowUIEvent("TestPrinter", true);
                //this fails after the installer has been run
                eprint.ShowUIEvent += new _IEPrintEvents_ShowUIEventEventHandler(EPrint_ShowUIEvent);

                eprint.set_EnableJobInfo("TestPrinter", true);
                eprint.JobInfoEvent += new _IEPrintEvents_JobInfoEventEventHandler(EPrint_JobInfoEvent);

                eprint.set_EnableSaveStatusEvent("TestPrinter", true);
                eprint.SaveStatusEvent += new _IEPrintEvents_SaveStatusEventEventHandler(EPrint_SaveStatusEvent);

                System.Console.Out.WriteLine("Press enter to end.");
                System.Console.Read();
            }
            catch (Exception e)
            {
                System.Console.Out.WriteLine(e.Message);
                System.Console.Out.WriteLine("Press enter to end.");
                System.Console.Read();
            }
        }

        public static void EPrint_SaveStatusEvent(string printerName, string fileName, short nErrorCode)
        {
            System.Console.Out.WriteLine("Save Status called.");
        }

        public static void EPrint_ShowUIEvent(string selectedPrinterName)
        {
            System.Console.Out.WriteLine("Show UI called.");
        }

        public static void EPrint_JobInfoEvent(string printerName, int jobID, int flags)
        {
            System.Console.Out.WriteLine("Job Info called.");
        }
    }
}

         

   Report 
  11-26-2008, 10:42
Maen Hasan is not online. Last active: 12/30/2008 4:32:47 PM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,876
Re: ePrint add Printer error
Reply Quote
Can you please enclose your code in a small working project (not your full application) and send it to me. I want to deploy the project on my side as explained in our help files and see if anything is missing.

Note: when you want to attach any files, please put them all in ZIP or RAR file. Also, don't use preview when you have attachment.
If you have any problem in attaching files to the forum, you can send the files in a ZIP of RAR file to support@leadtools.com. Don't forget to mention this forum post in your email to support.

Thanks,
Maen Badwan
LEADTOOLS Technical Support

   Report 
  11-26-2008, 11:01
jjohns is not online. Last active: 12/11/2008 7:48:01 PM jjohns

Top 500 Posts
Joined on 12-11-2007
Posts 10
Re: ePrint add Printer error

Attachment: EPrintTest.zip
Reply Quote
Contained in the attachment is a Visual Studios 2008 C# project that contains the code above.  It has no requirements other than the LPEPCLib dll.  You may need to reset the reference to this dll based on its location in your system.  In the TestExe subfolder are the exe files I used during the test I detailed above.

Hopefully you will be able to tell me where I am going wrong.  I am beginning to tear my hari out over this, and the boss is none too pleased at the delay.  Thanks for your help.

Joseph Johns

   Report 
  11-27-2008, 11:14
Maen Hasan is not online. Last active: 12/30/2008 4:32:47 PM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,876
Re: ePrint add Printer error
Reply Quote
Joseph,

I received your project and saw the error you are getting. I will try to find the reason and a solution for it. I will provide you with more information very soon.

Thanks,
Maen Badwan
LEADTOOLS Technical Support

   Report 
  12-03-2008, 20:28
Walter is not online. Last active: 12/29/2008 9:00:18 AM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 125
Re: ePrint add Printer error
Reply Quote
Hello Joseph,

Maen has been out the last couple of days, so I've taken a look at this as well. I too have been able to reproduce this, but everything I have tried so far has failed to fix it.

I will continue to troubleshoot this and will post any details when I come across something.
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
  12-09-2008, 18:18
Walter is not online. Last active: 12/29/2008 9:00:18 AM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 125
Re: ePrint add Printer error
Reply Quote
Hello Joseph,

We are still working on this issue. There appears to be a problem with the OS image that we are using.

I'll let you know of a resolution as soon as I find anything out.
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
  12-11-2008, 14:50
jjohns is not online. Last active: 12/11/2008 7:48:01 PM jjohns

Top 500 Posts
Joined on 12-11-2007
Posts 10
Re: ePrint add Printer error
Reply Quote
So do we have any kind of resolution here?  We are theoretically supposed to be installing this after the first of the year, and this issue has completely stopped development.  My boss is not pleased, and we need to know soonest if we need to look towards another solution.

Joseph Johns

   Report 
  12-12-2008, 18:25
Walter is not online. Last active: 12/29/2008 9:00:18 AM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 125
Re: ePrint add Printer error
Reply Quote
Unfortunately, I've not yet figured out exactly what piece is missing between the what out installer puts on the system, and what the test exe is looking for. There are a couple dlls that do not appear to be loaded when ePrint is installed vs when it isn't. These dlls are already on the system, so that isn't the problem.

I currently have a long list of files that I've generated and am working through to try to find the culprit.
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
  12-17-2008, 16:23
Walter is not online. Last active: 12/29/2008 9:00:18 AM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 125
Re: ePrint add Printer error

Attachment: EPrintTest-revised.zip
Reply Quote
It appears that this issue comes about when there are no printers installed on the system. I've re-written the demo program to install an OEM printer instead of just adding one. After unlocking support, this should work on your deployment machine with everything deployed as you've described above.

I believe the AddPrinter method should work after installing the OEM printer as with this project. In order to proceed further with this though, I need you to send an email to support@leadtools.com including the following information:

1. The company you work for
2. The LEADTOOLS serial number(s) you own (if you are evaluating, just say so)
3. The name(s) of the developer(s) using the serial number
4. A link to this forum post
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
Post
LEAD Support Fo... » Enduser » ePrint » Re: ePrint add Printer error

Powered by Community Server, by Telligent Systems