Posted on 2015-06-06
Every month I need to fill out four receipts in a PDF form that I made with PDFPenPro. I never liked doing it and I felt like there had to be a way to do this better. I did some searching, and of course came across an old post by Dr. Drang where he was adding rich text to PDFs. This was close to what I wanted, but since I had taken the time to create the form fields myself, I figured I should take advantage of them if I could.
First we start with creating our app variable for PDFPen
After that, I created a few functions to easily set the values for text fields and buttons
These are helpful when I want to duplicate my template receipt that I've created and not run the risk of overwriting the original.
I then created an array of all the fields that I wanted to be filled.
The very last lines are where the magic happens and all the fields are filled out. It was pretty fun to watch the form fill almost instantly and then let me save it.
That's it! This will take a lot of the slow process out of filling out my receipts each month. The next step will probably be generating the email and attaching the PDF. PDFPen already includes a script to do this very thing, so no more work needed for me. You can see the entire script here