Printer Installation Failed

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
lrkwz
Posts: 2
Joined: Tue Apr 15 2003

Printer Installation Failed

Post by lrkwz »

I'm using the developer version 2.1 in a C#.NET service application and I always get the exception:

System.Runtime.InteropServices.COMException (0x80004005): Printer Installation failed

when I call

Code: Select all

	try{
		PDFWriter = new CDIntfEx.CDIntfExClass();
		PDFWriter.PDFDriverInit(m_amyuniprinter);
		PDFWriter.EnablePrinter(m_amyunicompany, m_amyunicode);
		PDFWriter.SetDefaultPrinter();
		m_ready = true;
	} catch( Exception e ){
		log( e.ToString() );
		PDFWriter = null;
		m_ready = false;
	}
The service is running undes (local)\Administrator privilage; The problem see to tem
porary fix if the user administrator runs install.exe but after few hours of inactivity the problem rises again (the event log reports "Printer Amyuni PDF Converter was deleted.").
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please install the printer using Install.exe. And in your application please replace PDFDriverInit by DriverInit.

This should help.

Thanks.
ruc2827
Posts: 12
Joined: Wed Nov 03 2004

Post by ruc2827 »

Joan wrote:Hello,

Please install the printer using Install.exe. And in your application please replace PDFDriverInit by DriverInit.

This should help.

Thanks.
I'm getting this same error. So you are saying programmatically creating the printer each time is not supported?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Installing the printer programatically works if the user is an administrator and can install a printer on the system.

This is how it works for all printers.

If you want to create the printer programatically you need to call PDFDriverInit once when launching your application (and not each time your printer). Also you need to call DriverEnd once before closing your application (and not when printing ends).

Hope this helps.
ruc2827
Posts: 12
Joined: Wed Nov 03 2004

Post by ruc2827 »

Joan wrote:Hello,

Installing the printer programatically works if the user is an administrator and can install a printer on the system.

This is how it works for all printers.

If you want to create the printer programatically you need to call PDFDriverInit once when launching your application (and not each time your printer). Also you need to call DriverEnd once before closing your application (and not when printing ends).

Hope this helps.
I'm still get the "Printer Installation error" message when I call PDFDriverInit when my app launches. I am following all the steps in the Developer edition directions (copying 7 files to app bin, registering cdintf250.dll in windows\system32, and using PDFDriverInit). I am finding that this same code works on machines that I manually install the driver. My guess is that the license key has to be set prior to calling PDFDriverInit, but you can not call EnablePrinter prior to PDFDriverInit, so there is no way to do this, nor does the documentation specify to do this. This is holding up the release of this functionality, so please respond ASAP.

Thanks.
ruc2827
Posts: 12
Joined: Wed Nov 03 2004

Post by ruc2827 »

ruc2827 wrote:I'm still get the "Printer Installation error" message when I call PDFDriverInit when my app launches. I am following all the steps in the Developer edition directions (copying 7 files to app bin, registering cdintf250.dll in windows\system32, and using PDFDriverInit). I am finding that this same code works on machines that I manually install the driver. My guess is that the license key has to be set prior to calling PDFDriverInit, but you can not call EnablePrinter prior to PDFDriverInit, so there is no way to do this, nor does the documentation specify to do this. This is holding up the release of this functionality, so please respond ASAP.

Thanks.
A call to GetLastError states the error is "The printer driver is unknown" if this helps. I have all the dependencies in my app's bin directory. I have cdintf250.dll registered in windows\system32.
ruc2827
Posts: 12
Joined: Wed Nov 03 2004

Post by ruc2827 »

I figured out the solution. PDFDriverInit is looking for the dependency files in the directory where cdintf.dll (cdintf250.dll) is registered, NOT in the application directory (where the EXE is located). I'm not sure if this is because I'm using COM interop or just the way it works. The solution is to register cdintf.dll in the same directory as the dependencies, so that it can find the driver files.

Russ
Post Reply