Mail Merge Data To A Pdf File By Overlaying The Data On The Image

Home » CentOS » Mail Merge Data To A Pdf File By Overlaying The Data On The Image
CentOS 9 Comments

Everyone,

I am looking for a utility that I can use to do a mail merge of data to a pdf image file. The image file does not have any active fields, but will be just an image file. I would like to overlay names addresses etc.

We currently do this with a pcl file by just overlaying the data with pcl print positions. However, in order to get the pcl file from an original pdf file we have to use gimp to convert the pdf to pcl file, and we always lose a little resolution. I was wondering if anyone knows of a utility to perform this function without first converting the image to a pcl file.

Thanks,

9 thoughts on - Mail Merge Data To A Pdf File By Overlaying The Data On The Image

  • This may seem like a round-a-bout way to do it; But, why not modify a Latex file with the changes, then use a bit of Bash script to do the tex -> ps -> pdf ?

  • Frank,

    I finally had the time to work on this project, and was able to get
    ‘convert’ of ImageMagick to create a new pdf file with some merged text, but it was not easy. Also, the converted file had less resolution that the original file making the result less than desirable as a finished product.

    What I would really like to be able to do is to run a script that can fill in the input fields of the pdf file on the fly and then create a new pdf file with the same resolution as the virgin pdf file that has the appropriate fields with entered data.

    Do you or does anyone else have anything like this working????

    Sure appreciate everyone’s help!!!!

    Greg

  • I wonder if you’re starting from the wrong place. Maybe you would be better off creating your forms with tex and generating pdf’s from that.

    Running “mailmerge with tex” through google provides all sorts of write-up on how to do it.

  • Frank,

    I only wish that could be done. Unfortunately, the pdf file is not ours and we did not create it.

    I have downloaded pdftk 2.02 from the pdftk website and that fixed the problem of not being able to open a 1.6 pdf file, but I have some additional impasses.

    It looks like the pdf file we have been given is password protected so that I can not merge data to it, or take a look at the fdf fields with the pdftk dump_data or pdftk generate_fdf. I was surprised by this in that the file can be read by a gui application with inputs in the fields without a password.

    We have application software that is required to fill in the blanks of the pdf file with merged data. What we are doing now to get the job done is to create a pcl file from the pdf file using gutenprint of gimp, and then modifying the pcl file with macro commands so that it can be downloaded to an hp type printer and called as needed with subsequent print commands to specified field areas on the page. By using this method we can print this on a pcl printer or send it to cups
    -pdf to convert it back to a pdf file to fax or e-mail the pdf file merged with the data.

    I was hoping to be able to simplify all of this by using some tool to fill in the fields on the pdf file on the fly.

    So far …. no cigar

    Greg

  • Harry,

    I had some problems with pdftk opening up a 1.6 pdf file. It looks like that was a bug in pdftk 1.14 that was fixed with 2.02-1, but this version has not hit the CentOS 5 repositories. I have another machine with CentOS 7, but pdftk is not available in the 7 repositories.

    I am going to remove the repository 1.14 from my CentOS 5 machine and try the rpm from the pdftk website. I’ll post again to see if that allows me to proceed.

    Greg

  • It sounds like the next step would be to get on the horn with whoever wrote the pdf file(s) that you’re using and ask them what the schmoo is going on.

    Perhaps they could provide it to you in a format that’s easier to deal with instead of an encrypted pdf file.