Dvl version - Printer is gone !

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
skueny
Posts: 3
Joined: Wed Nov 19 2003

Dvl version - Printer is gone !

Post by skueny »

hi,

I'm using Developper version 2.10e and I'm have a problem with the following code (PowerBuilder):

gl_pdf=PDFDriverInit("COMDEV_PDF")
ll_return=SetResolution(gl_pdf,300)
ll_return=SetOrientation(gl_PDF,1)
lb_return=SetDefaultConfig(gl_PDF)
ll_return=SetDefaultPrinter(gl_PDF)
ll_return=SetDefaultFileName(gl_PDF,l_Str_Pass.s[2])
li_option = 1+2
ll_return=SetFileNameOptions(gl_PDF,li_option)
lb_return = EnablePrinter(gl_PDF, ls_licence, ls_activcode)

// printing
SetFileNameOptions(gl_PDF,0)
DriverEnd(gl_PDF)

If I'm Administrator, all is OK and the printer is created, creating PDF file is OK and the printer isdestroyed


if I'm not Administrator, The administrator install firs the printer thru install "COMDEV_PDF" command. The printer is OK on the control panel.
If we don't do that the PDFDriverInit choke !

After that, as a simple user, I can print ONE time, but the DriverEnd Cde remove the printer and on the next print action PDFDriverInit choke !!

We need to distribute this application to multiple users and don't control the users rights.


What is the problem ?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

What you are facing is absolutely normal.

PDFDriverInit will look for the printer on your system, if not found, it will try to install it otherwise it will attach to it. The printer is removed when calling DriverEnd.

As a User you can not install the printer on the system so PDFDriverInit is failing if the printer is not installed previously by an administrator.

What you can do is replace PDFDriverInit by DriverInit and install the printer before launching your application.

DriverInit will attach to the existing printer and the this printer will remain on the system after closing your application.

As a general note, It is advisable to call PDFDriverInit and even DriverInit when launching your application and not in the Command button.

Hope this helps.
skueny
Posts: 3
Joined: Wed Nov 19 2003

Post by skueny »

Joan,

Thanks for your reply.

If I understand you correctly, I have to :

1. Install the printer as Administrator
2. Use DriverInit
3. Only use DriverInit and DriverEnd one time in the application.

Would it not be better to Delete the printer in DriverEnd, only if PDFDriverInit has created one ? The solution would be more friendly for us.

Regards

Serge
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Yes, what you understand is correct.

You need to install the printer as Adminsitrator and use DriverInint when launching your application and DriverEnd when closing it.

You may even replace your call to PDFDriverInit by DriverInit and it will work.

I didn't understand your question" Would it not be better to Delete the printer in DriverEnd, only if PDFDriverInit has created one ? The solution would be more friendly for us. "
In fact DriverEnd will not delete the printer unless this printer is is created by PDFDriverInit.

Will this make sense?
skueny
Posts: 3
Joined: Wed Nov 19 2003

Post by skueny »

Hello,

Your suggestion is working.

But, in our case :
1. The administrator create the printer
2. The user (with no admim right) can print ONE time (the appli use PDFdriverinit and DriverEnd) but the DriverEnd suppress the printer !!!

So, I suggest to only suppress the printer if PDFDriverInit really intall it ! At this time (v2.10e) it's not the case.

Regards

Serge
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

I see now what you mean.

I will send your suggestion to our Project Manager.

Have a nice day !
Post Reply