>Hi Mark: Could you show me your VFP code that is using this PDF driver?
>
>
>Thanks, Tai Fei Pao
>
>
>>>Dear all,
>>>
>>>I have a big problem! I wrote a VF program to port the data into a Excel file. Now, I need to print that file into PDF and attach into mail to send for customer. How can I do that? I have solved the mail problem but the PDF generation that make me ache. I found that many post talk about PDF as before but those post also talk to print the PDF on VFP. How can I integrate all together? Thank you for any advise.
>>>
>>>Best Regards,
>>>
>>>Justy Chow
>>
>>Check
www.amyuni.com.
>>MArk
Here you go:
LPARAMETERS tcFileName
This.poPDFPrinter = CREATEOBJECT('CDIntf.CDIntf')
*!* check if PDF driver is installed on that computer
=APRINTERS(arr)
IF ASCAN(arr, 'pdfprinter') > 0 && installed
*!* attach to the existing diver
This.poPDFPrinter.DriverInit('pdfprinter')
ELSE
*!* initiate printer driver named "pdfprinter". This.poPDFPrinter.PDFDriverInit('pdfprinter')
ENDIF
This.poPDFPrinter.Resolution = 1200 && set resolution
This.poPDFPrinter.SetDefaultConfig() && set default configuration for all applications
SET PRINTER TO NAME "pdfprinter"
This.poPDFPrinter.DefaultFileName = tcFileName && set default file name
This.poPDFPrinter.FileNameOptions = 1 + 2 + 32 && set options: No Prompt, use default file name, broadcast messages
My classlib is Web, classname is cusPdf
Here is code from a calling class:
oPdfPrinter = NewObject('cusPdf', 'web')
oPdfPrinter.mCreateDriver('fullfilepath')
After that any
REPORT FORM reportname TO PRINTER
will actually create a PDF file with 'fullfilepath' name and location
Mark