Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Amyuni Problems
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Titre:
Divers
Thread ID:
00823827
Message ID:
00823981
Vues:
106
Ronald,

This syntax looks a bit off. Several things to check:

1) The CDINTF.DLL (or CDINTF210.DLL if you are using the latest version) control needs to be registered on your machine (use regsvr32.exe).

2) You do not need the DECLARE statements if you use the ActiveX interface instead of the standard DLL calling convention.

3) If using the ActiveX interface, calls to the methods such as EnablePrinter, SetDefaultFileName, etc. should be prefixed with the name of the printer object, which is 'PDF' in your code (suggestion: oPDF would be better). In this case the name of the object is not required as a parameter, either.

4) The PDFDriverInit method attempts to create a new printer driver with the name you specify. If you are on Windows NT/2000/XP, the logged in user needs rights to create a printer. Also, if a printer with the name you specify already exists you will get an error. This could be the case if you installed the permanent printer driver, which uses the default name 'Amyuni PDF Converter' and which is the same as what you are specifying here. Try using a different name, like 'My PDF Printer'.

There is a FAQ on using Amyuni with VFP here on UT (FAQ #8148), although it was written for the older version 1.x of the PDF Converter. Similar code plus other comments are available on the FoxPro wiki - start with http://fox.wikis.com/wc.dll?Wiki~UsingAmyuniPDFConverterWithVFP~VFP.

HTH,

-Rick






>I downloaded the demo and tried playing with it but I always get this error when trying to run it:
>
>Error Loading Printer Drivers
>
>It happens in the report form to call. Below it the code I was using to test it. Does anyone have any ideas or a wrapper to handle the Amyuni program?
>
>
>
>cRptName = "temp.frx"
>cFileName = "U:\_ss\Temp.pdf"
>
>m.cMyPrinter = 'Amyuni PDF Converter'
>
>* This was provided by Jose of Amyuni on about Feb. 28, 2003.
>* Several things had to be done here for this
>* to be called and work. We added the above parameters.
>DECLARE LONG PDFDriverInit IN cdintf210.DLL STRING
>DECLARE LONG DriverInit IN cdintf210.DLL STRING
>DECLARE DriverEnd IN cdintf210.DLL LONG
>DECLARE LONG SetDefaultPrinter IN cdintf210.DLL LONG
>DECLARE LONG EnablePrinter IN cdintf210.DLL LONG, STRING, STRING
>DECLARE LONG SetDefaultFileName IN cdintf210.DLL LONG, STRING
>DECLARE LONG SetFileNameOptions IN cdintf210.DLL LONG, LONG
>DECLARE LONG SetDefaultConfig IN cdintf210.DLL LONG
>DECLARE LONG SetWatermark IN CDIntf210.DLL LONG, STRING, STRING, LONG, LONG, LONG, LONG, LONG, LONG
>DECLARE LONG SetBookmark IN CDIntf210.DLL LONG, LONG, STRING
>
>#DEFINE NoPrompte             1
>#DEFINE UseFileName           2
>#DEFINE Concatenate           4
>#DEFINE BroadcastMessages    32
>* #DEFINE EnableWatermarks     64
>#DEFINE EnableWatermarks     0
>* Here is the definition of the watermark parameters
>#DEFINE Wfontname          "Arial"
>#DEFINE Wfontsize              70
>#DEFINE Worientation          450
>#DEFINE Wcolour               255
>#DEFINE Whorzpos              200
>#DEFINE Wvertpoz             -200
>#DEFINE Wforeground           .T.
>
>PDF = PDFDriverInit(m.cMyPrinter) && for the standard version
>
>
>* Following is a special code -license from AmyUni and it is required
>* just like that.
>EnablePrinter (PDF,"MyCompanyName","- my secret id from amyuni goes here - ")
>
>SetDefaultFileName ( PDF, cFileName )&& set output file name
>SetFileNameOptions( PDF, NoPrompte+ UseFileName+ BroadcastMessages + EnableWatermarks)
>
>SET PRINTER TO NAME (m.cMyPrinter)
>
>REPORT FORM (cRptName) TO PRINTER NOCONSOLE && Error Happens Here
>
>SetFileNameOptions ( PDF, 0 )	&& reset options
>
>* Free the object -for the developer versions: remove
>* the PDF or HTML printer, otherwise only clears some memory
>DriverEnd( PDF )
>
>
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform