Hi to all. It's been a while since I use my Blog here at this greate site www.foxite.com
I have updated my Listener to create PDF Files, now it can merge existing documents into the PDF file being generated. I also had chance to get a better performance when processing reports with Images in it. Today I tried the INVOICE reports sample that come with VFP and it took me less than 50 seconds to proccess 747 pages. Here's some sample code of how to use it:
You can generate two types of PDF files, a normal file, this PDF file will let you Copy the text, has a better resolution at greater zoom levels and the file size it's really small.
Local loListener As ReportListener, lcTargetFile As String, lcMasterPassword As String, lcUserPAssword As String,;
lcMergeFileName As String
lcTargetFile="MyPDfFile"
lcMasterPassword="master"
lcUserPassword="user"
lcMergeFileName="existingPDF"
loListener = NewObject('PdfListener1', 'QuickFRX2PDF.vcx','QuickFRX2PDF.App')
loListener.TargetFileName = lcTargetFile
loListener.QuietMode=.F. &&Put .T. to turn off messagges
loListener.EncryptDocument=.F. &&Put .T. to Encrypt Document
If loListener.EncryptDocument
loListener.MasterPassword=lcMasterPassword
loListener.UserPassword=lcUserPassword
EndIf
loListener.MergeDocument=.F. &&Put .T. to Merge Document with an Existing PDF
If loListener.MergeDocument
loListener.MergeDocumentName=lcMergeFileName &&Name of the existing file to be merged with
EndIf
loListener.OpenViewer=.T. &&Put .F. to prevent Acrobat Reader from being opened
Report Form myrerport.frx Object loListener
And you can generate an Image PDF File, this kind of PDF will export everything as an image file to the document, people will not be abble to copy your text form it, but PDF files are bigger and has less resolution at greater zoom levels.
Local loListener As ReportListener, lcTargetFile As String, lcMasterPassword As String, lcUserPAssword As String,;
lcMergeFileName As String
lcTargetFile="MyPDfFile"
lcMasterPassword="master"
lcUserPassword="user"
lcMergeFileName="existingPDF"
loListener = NewObject('PdfListener2', 'QuickFRX2PDF.vcx','QuickFRX2PDF.App') &&By calling PdfListener2 we create a PDF File as image.
loListener.TargetFileName = lcTargetFile
loListener.QuietMode=.F. &&Put .T. to turn off messagges
loListener.EncryptDocument=.F. &&Put .T. to Encrypt Documente
If loListener.EncryptDocument
loListener.MasterPassword=lcMasterPassword
loListener.UserPassword=lcUserPassword
EndIf
loListener.MergeDocument=.F. &&Put .T. to Merge Document with an Existing PDF
If loListener.MergeDocument
loListener.MergeDocumentName=lcMergeFileName &&Name of the existing file to be merged with
EndIf
loListener.OpenViewer=.T. &&Put .F. to prevent Acrobat Reader from being opened
Report Form myrerport.frx Object loListener
Also you can specify other options for both PDF Files types, you can enabled or disable print button, copy options and you can encrypt the document with 2 different levels and assign a passwords.
Anyone interest in try it, can download a copy from www.crystalvfpclass.net
It comes with complete Help file and sample form, and there's also a version in Spanish.
Or send me an email to lnavasdangel@gmail.com