Do you have to identify who to mail this file to by data inside the excel file? " On that PDF - they need to have name and addresses on the PDF - based upon data from an Excel file" Or do you have to tweak the contents of the PDF by the excel file?
On Thu, May 25, 2017 at 9:56 AM, Kurt Wendt Kurt_Wendt@globetax.com wrote:
Alan - as I wrote in the original posting - the PDF Files come from a Client. Its also Digitally Signed. On that PDF - they need to have name and addresses on the PDF - based upon data from an Excel file. Thus a mail merge. But, yeah - PDF already exists! It is NOT something that I can generate from VFP - so, VFP is NOT involved - thus why I posted as [NF].
Regards, Kurt Wendt Senior Systems Analyst
Tel. +1-212-747-9100 www.GlobeTax.com
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Alan Bourke Sent: Thursday, May 25, 2017 4:16 AM To: profoxtech@leafe.com Subject: Re: [NF] URGENT Request - MailMerge w/PDF
Not clear on what you're trying to do - are these actual PDF forms or do you just need to put data into an existing vanilla PDF?
If it's any help I did some code recently to add a customer signature captured from a signature pad to a PDF invoice. One of the methods I investigated was generating the invoice first and then merging the signature graphic in. It used the free Debenu Quick PDF Lite Library (http://www.debenu.com/products/development/debenu-pdf-library-lite/) which has support for merging graphics into PDFs. Ultimately I didn't end up going down this route but here's the business end of it FWIW. You might need the paid version to merge text or fill PDF forms.
- -- Parameters are target PDF, the filename of the graphic with the
signature, and the image dimensions.
Function SignPDF(lcPDFFile as String, lcSigFile as String, loParms as Object) Local lnFileID, lnImageID
With goApplication.oDebenuPDF If .LoadFromFile(lcPDFFile, "") > 0 ? "PageHeight=" + Transform(.PageHeight) .SelectPage(1) && - -TODO each page or last? .NormalizePage(0) .SetOrigin(1) && -- Top left lnFileID = .SelectedDocument lnImageID = .AddImageFromFile(lcSigFile, 0) If lnImageID > 0 If .SelectImage(lnImageID) > 0 if .DrawImage(loParms.ImgLeft, loParms.ImgTop, ; loParms.ImgWidth, loParms.ImgHeight) > 0 If .SaveToFile(lcPDFFile) = 0 ?"ERROR: Could not save " + lcPDFFile Else ? "Merge successful." Endif Else ? "Could not draw image." endif Else ? "Could not select image." Endif Else ? "ImageID = 0" Endif Else ? "Could not load image file." EndIf EndWithEndfunc
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
[excessive quoting removed by server]