Install Question

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
steko101
Posts: 2
Joined: Mon Sep 27 2004

Install Question

Post by steko101 » Mon Sep 27 2004

I am trying to the non Install.exe (Step 2.2 of the Using the developer...), but PDFDriverInit keeps failing in the following example.

Dim lngPDF As Long
Dim strCompany As String, strCode As String
strCompany = "removed"
strCode = "removed"
lngPDF = modAmyuniPDF.PDFDriverInit("Amyuni PDF") ' <= Dies by entering the next if statement.
If lngPDF = 0 Then
MsgBox "Cannot initialize PDF printer"
Else
modAmyuniPDF.SetResolution lngPDF, 600
modAmyuniPDF.SetDefaultConfig lngPDF
modAmyuniPDF.SetDefaultPrinter lngPDF
modAmyuniPDF.SetDefaultFileName lngPDF, strPath & "test.pdf"
modAmyuniPDF.SetFileNameOptions lngPDF, 3
modAmyuniPDF.EnablePrinter lngPDF, strCompany, strCode
modAmyuniPDF.DriverEnd lngPDF
End If
End If

What I am trying to accomplish is to develop an application and not have to run the install.exe. This is to limit what the end-users have access to see.

Any help is greatly appreciated.

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

Post by Joan » Tue Sep 28 2004

Hello,

PDFDriverInit will fail if users don't have administrative rights on their machines.

This is due to the fact that under Windows NT, 2000, XP, ect... users need to have administrative rights to be able to install or remove a printer on the system.

So, it is advisable to install the printer once on the system using Install.exe and in your application replace PDFDriverInit by DriverInit.

Unlike PDFDriverInit, DriverInit will attach to the existing printer and when exiting the application the printer will not be removed from the system.

Hope this helps.

steko101
Posts: 2
Joined: Mon Sep 27 2004

Post by steko101 » Tue Sep 28 2004

The admin rights is not the issue.

I was thinking due to the licensing of the product that I would just create the "printer" with PDFDriverInit, then remove when my app closes with DriverEnd. All this without running the install.exe. Should I just run the install.exe not using an install.ini and provide the company and code in the application. Is this the normal practice?

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

Post by Joan » Wed Sep 29 2004

Yes, this is the normal and adviced practice under Windows NT and above.

sopel
Posts: 2
Joined: Tue Mar 04 2003

Post by sopel » Wed Oct 27 2004

Does the PDFDriverInit function not work? I am having the same problem on my computer. I am an administrator on my computer.

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

Post by Joan » Thu Oct 28 2004

Hello,

PDFDriverInit should work if you are an administrator on your machine and if you have the needed dlls stored in your application path and CDintf210.dll registered in your system directory (in case you are using the ActiveX interface).

Please note that starting version 2.10 of the PDF Converter you need to call EnablePrinter() right after PDFDriverInit() and right before each printout().

Hope this helps.

Siuwill
Posts: 7
Joined: Thu Nov 25 2004

Post by Siuwill » Thu Nov 25 2004

Even I have to user right as Sys Admin to create the printer, I always get the problem of getting "zero" return value (mlngcdi) for PDFDriverInit.

If I add the "EnablePrinter mlngcdi, PDF_VERSION, PDF_LICENSE_KEY" immediate after the PDFDriverInit call, the program will have exceptional error.

What I have to do is to shellexecute "install.exe" to perform the creation of printer, but have to had several attemps plus delay in the loop, it takes usually 2 to 3 times to get the printer successfully created. Then I can proceed to the produce the PDF.

From this proof, I see that there is problem at PDFDriverInit not just the permission problem. I am using Windows 2000.

Please help. I really don't want this trick to get around the problem.

The following see source code on the class initialization and the install printer function.

Private Sub Class_Initialize()
On Error Resume Next
mlngWinHandle = 0
mintPDFCount = 0
mstrFileName = ""
mstrFullName = ""
mstrPathName = ""
mlngcdi = 0

mlngcdi = PDFDriverInit(PDF_PRINTER)

' Use install.exe to create printer if PDFDriverInit doesn't work

If mlngcdi = 0 Then
InstallPrinter
End If
End Sub

Private Sub InstallPrinter()
On Error Resume Next
Dim i As Integer
Dim strParameter As String

strParameter = "-s " & """" & PDF_PRINTER & """" & " -n " & """" & PDF_VERSION & """" & " -c " & """" & PDF_LICENSE_KEY & """"
ShellExecute mlngWinHandle, vbNullString, "Install", strParameter, vbNullString, SW_SHOWNORMAL

' Retry max 10 times for Printer initialization after printer creation
' Each loop will sleep for 2 seconds

For i = 1 To 10
Sleep (2000)
If mlngcdi = 0 Then
mlngcdi = PDFDriverInit(PDF_PRINTER)
If mlngcdi <> 0 Then
Exit For
End If
Else
Exit For
End If
Next i
End Sub


Regards,
William

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

Post by Joan » Fri Nov 26 2004

Hello William,

As far as I know, we don't have any problems with PDFDriverInit under Windows 2000.

I notice that you are using the DLL interface of CDIntf. Did you save the files and dlls you get with the driver in your application directory? If not please do so.

Which version of the PDF Converter you are using?

Regards,

Siuwill
Posts: 7
Joined: Thu Nov 25 2004

Install Question

Post by Siuwill » Fri Nov 26 2004

1. Yes, we put all the DLL required as specified in the page 7 of Amyuni Document Converter Version 2.10e Developer' Manual. Otherwise install.exe will have error and indicate in the log file as we tested it before.

2. We downloaded the evaluation version 2.1 for evaluation. The file cdintf210.dll and other dll's in the distribution show version 2.10i-7

Regards,
William

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

Post by Joan » Mon Nov 29 2004

Hello,

I can't see why you are getting problems with PDFDriverInit under 2003 if you are using version 2.10i-7, and if you are logging as Administrator. Our latest version is 2.10i-8, please feel free to try it if you wish.

Please send a request to support@amyuni.com, there should be someting wrong in your application that i am not able to see.

Thanks.

Siuwill
Posts: 7
Joined: Thu Nov 25 2004

Post by Siuwill » Mon Nov 29 2004

Joan,

I have sent request to the support for the new version.

However, what further information you need so that you can provide input. As, you know, all the coding and configuration are pretty straight forward - following the instructions and even some coding given by the manual. I have also listed out for information in detail in the forum.

It seems to me that this problem is not happening just to my case and it happens to others, who raised this in the fourm.

Regards,
William

Siuwill
Posts: 7
Joined: Thu Nov 25 2004

Post by Siuwill » Thu Dec 02 2004

I have tried with the new evaluation copy but the evaluation key is shorter than the previous one by 8 character positions.

Same problem persists - get zero value whenever perform pdfDriveInit() function.

I found that pdf file cannot be generated. When I change back to my previous activation key, it goes fine.


Regards,
William

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

Post by Joan » Mon Dec 06 2004

Hello William,

So your code is working now?

Siuwill
Posts: 7
Joined: Thu Nov 25 2004

Post by Siuwill » Tue Dec 07 2004

Joan,

As I posted on 2 Dec, 2004, it doesn't work with the new evaluation because of the activiation key problem. I have to revert to the old key. Of course, it doesn't work for the pdfDrivieInit().


On 2 Dec, 2004 posted:-
"I have tried with the new evaluation copy but the evaluation key is shorter than the previous one by 8 character positions.

Same problem persists - get zero value whenever perform pdfDriveInit() function.

I found that pdf file cannot be generated. When I change back to my previous activation key, it goes fine. "



Regards,
William

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

Post by Joan » Wed Dec 08 2004

Hello,

It is really weired that PDFDriverInit is returning a null value if you are an Adminstrator on the system.

Also the code provided with version 2.10i-8 should work fine, please send us the licensee name and activation code you got with the demo so we can validate them.

I may not be able to solve the issue of PDFDriverInit here, because i am not sure what is happening on your system but to overcome this issue i will advise you to install the printer using Install.exe once. and in your code please use DriverInit instead of PDFDriverInit.

If you are installing the printer on a server or you want to distribute the driver with your application, it is recommanded to install the printer using Install.exe and to use DriverInit because DriverInit will not remove the printer when your application closes as PDFDriverInit will do.

Hope this helps.

Post Reply