Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Amyunit PDF 2.10 version
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00767442
Message ID:
00767609
Vues:
7
Here's a simplified version of my code, using the ActiveX methodology. It is based upon version 2.0, so you'd have to modify it to use their new calls and your activation key:
* Amyuni ActiveX PDF
lcReportName="Amyuni ActiveX Report"
Pdf=CreateObject("CDINTF.CDINTF")
lcPrinterName=("Ideate"+"MyCompanyName")
* PDFDriverInit creates a phantom printer!
Pdf.PDFDriverInit(lcPrinterName)
lcActiveXPDFName = "ActiveX.PDF"
Pdf.DefaultFileName = ReportPath+lcActiveXPDFName
Pdf.FileNameOptions = 1+2	&& No prompt, use file name

Pdf.SetDefaultConfig
SET PRINTER TO NAME (lcPrinterName)
REPORT FORM FUDG/PDFReport NOEJECT NOCONSOLE TO PRINTER
Pdf.DriverEnd
Release PDF
It is excerpted from a talk I did last year. A more complete slideshow and whitepaper is available at my web site under 'articles': www.id-8.com

Those articles are geared towards web applications, but quite applicable to desktop apps.

Of course, Amyuni recommends you create the printer upon first use, and don't destroy it until shutdown - but the code above creates and destroys it in one pass for clarity and testing purposes.

Give it a try and let me know how it compares speed-wise to the dll (which I have not tried). If the DLL is faster, I'll use it, too.

HTH


>>If you're an in-house shop with 2,000 desktops
>
>No, they not in house, but these are at over 400 locations - and I have no control over them other than my Wise setup, etc. By summer, it will be on a few thousand more desktops easily and I trying to snuff this problem out now before that happens.
>
>>but if they do NOT I would consider switching to the 'developer' version of the Amyuni product. I like it because it involves distributing only a few dll's (and registering one).
>
>Yes, this is what I am using - the $2,400 developers version. Its a beaut! in everything but this one problem so far.
>
>>You can then create and destroy new PDF drivers from your app as you need them. This means you don't have to worry about a user or administrator deleting or renaming the printer driver on you. I like using this with my apps, and controlling it as an ActiveX object. VERY flexible!
>
>Well, I am using the INSTALL.EXE during my Wise install - per suggestion from Amyuni tech and also their manual. When I didn't it seemed to take several seconds before a report could be printed as the driver had to be created first, then destroyed. I'm beginning to wonder if this is leading me to this INSTALL -U headache.
>
>Amyuni tech support provided me with the following code to get it up and going quickly - as I didn't have time to just fiddle with all its features. Are you doing something different than this (I changed some of it so I can call it from anywhere):
>
>LPARAMETERS cOutType, cRptName, cFileName, cPrintName
>* cOutType  =  will either be PDF, RTF, or HTM.
>* cRptName  =  our report.frx name (will include the path
>*              so it can be found).
>* cFileName = name of the file including full path we are
>*             going to write to. Also must include the correct
>*             extension such as PDF, RTF, or HTM.
>* cPrintName =  name of the printer such as
>*               "Amyuni Document Converter"
>* cMyPrinter =  the name of the AmyUni printer.
>*               This can either come from the above cPrintName
>*               parameter or it can be handcoded here to test
>*               installed printers, etc.
>
>* m.cMyPrinter = 'Amyuni Document Converter'
>m.cMyPrinter = cPrintName
>* 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 = DriverInit(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
>
>DO CASE
>CASE cOutType = 'PDF'
>SetFileNameOptions( PDF, NoPrompte+ UseFileName+ BroadcastMessages + EnableWatermarks)
>CASE cOutType = 'RTF'
>* Following is for Rtf output. The last parameter (134217728 was derived
>* by looking at page 20 or 21 in the Common interface driver Manual,
>* taking the ExportToRtf HexValue of 8,000,000 and using Windows
>* Calculator converting it to a decimal which is 67108864 and then
>* adding it to that line.
>SetFileNameOptions( PDF, NoPrompte+ UseFileName+ BroadcastMessages + EnableWatermarks + 134217728)
>CASE cOutType = 'HTM'
>* Following is for Html output. The last parameter (67108864 was derived
>* by looking at page 20 in the Common interface driver Manual, taking
>* the ExportToHtml HexValue of 4,000,000 and using Windows Calculator
>* converting it to a decimal which is 67108864 and then adding it to that
>* line.
>SetFileNameOptions( PDF, NoPrompte+ UseFileName+ BroadcastMessages + EnableWatermarks + 67108864)
>ENDCASE
>
>SET PRINTER TO NAME (m.cMyPrinter)
>
>REPORT FORM (cRptName)  NOEJECT NOCONSOLE TO PRINTER
>
>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 )
>
>Are you using the new 2.10 and not having in problems with the PDF color item I mention?
>
>Thanks for all your help.
>
>Mel Cummings
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform