Wednesday, December 16, 2009

Filling in PDF forms using Open Office - Mail Merge Style

We recently changed an HR related supplier at work. As a result, every employee (100+) had to fill in a three page form. The new supplier provided us a non-editable PDF.

As anyone working in a mid-sized company knows, getting 100 people to do the same thing correctly is pretty much an exercise in futility :-)

Now 98% of that form HR knew the answers too - name, address, date of first employment etc. etc. Open Office can do a 'mail merge' from the spreadsheet with that data in it to a document in Writer, but can't import PDF natively.

My first thought was to use the pdf import extension for Open Office. It works ok, but imports the PDF as a Draw document, rather than a Writer document. Draw documents don't do mail merges as far as I can see.

My second thought was to create a Writer document, and use the form as the page background. Turns out setting a page background with an image works ok, but the same image is repeated on every page. Won't work for our multipage document unless we created three documents and somebody played manual collator for a while. Sure as heck something would get scrambled.

What I did in the end was time consuming but worked well.

  1. Convert each page of the pdf form into a tiff or similar high quality image file
  2. Register your spreadsheet or database as a data source.
  3. Start with a new Write document. Hit return enough times to create number of pages you need.
  4. Choose Insert -> Frame.

    1. Make sure it's anchored to the page
    2. Positioned for the entire page
    3. Name it on the Options Tab (optional, but handy)
    4. Set borders to none on the Borders tab
    5. On the Background tab change it to Graphic instead of Color, and browse for your first page image.
    6. Move the image around until it covers the entire page properly
    7. Right click and choose Alignment -> Back
    8. Hit OK
    9. Repeat for each page

  5. Choose View -> Data Sources and highlight your data source so the fields you want are displayed at the top of your window.
  6. Choose Insert -> Frame.

    1. Make sure it's anchored to the page
    2. Make sure auto size is off
    3. Name it on the Options Tab (optional, but handy)
    4. Set borders to none on the Borders tab
    5. Hit OK

  7. Now drag the Heading from the first column of data into that frame
  8. Move the frame to the right spot on the background to fill in the blank
  9. Lather, rinse repeat for each piece of data on each page


When you choose 'Print' it will ask you if you want the blanks filled in, and away you go!

I haven't posted any screenshots - Let me know if you think you need them and I can create some.

Hope this helps somebody!

No comments:

Post a Comment