
When all the documents have been updated with the header and saved, PDFpenPro quits. The y position has to be given as the distance from the bottom of the page to the bottom of the imprint, so it’s 792 - 36 - 73 = 683 Because PDFpen wants all the dimensional properties for the imprint to be given in points, and there are 72 points in an inch, we give the width as 540, the height as 73, and the x position as 36. The header is 7½ inches wide and just over an inch high, and I want it placed half an inch from the left edge of the page and half an inch from the top. We’ve already seen in Line 2 where the header file is that’s what gets assigned to the path parameter. The header graphic is called an imprint in PDFpen parlance, and Line 9 is where that imprint gets defined. The loop that starts on Line 3 gets the next file in the list, opens it in PDFpenPro (the file path for the open command in Line 8 doesn’t need to be in POSIX form), adds the header, and saves and closes the document. Rather than Macintosh HD:Users:drdrang:graphics:ucolorhead.pdfįor some reason, the path parameter in Line 9 needs to be in POSIX form. Line 2 defines the path to the header file in POSIX form, which is to say /Users/drdrang/graphics/ucolorhead.pdf

The script can add the header to any number of files.
PDFPEN APPLESCRIPT JXA FORMS PDF
The input to run consists of a list of all the PDF files selected in the Finder. Here’s the AppleScript it runs: 1: on run at end of imprints of page 1 of document 1 I have it restricted to work only on PDF files selected in the Finder. Here’s how the service is defined in Automator: With a little AppleScript and an Automator action to run it, I can add the header to the first page of any PDF document by right-clicking on it in the Finder and choosing the Add Company Header service from the popup menu. Maybe it’s because they’re using a different version of Word, maybe it’s just a bug in the importing code, but whatever the reason, the output from Word is never quite right.Įnter PDFpenPro 1. Fonts get screwed up, dimensions change, the graphic turns into a low-resolution bitmap-something always ends up wrong. My coworkers-a fine group of people in every other way-use Microsoft Word on Windows, which has caused no end of trouble.Īlthough there are procedures for importing PDFs and importing EPSs into Word, they’ve never worked for my colleagues. The document could be written in Pages, LaTeX, troff, OmniGraffle-whatever program I use to produce the final output, it looks great.īut I can’t be responsible for writing all of our company documents.

It worked back when I was using Linux, and it still works on the Mac. I, of course, have never had any trouble importing the header into any of the documents I produce. We have a header, in both PDF and EPS formats, that includes a logo and text. The most recent solution fixed a longstanding problem at work: getting a consistent “look” to company documents that are made by different people. It’s been the perfect solution for several problems since I got it.

PDFPEN APPLESCRIPT JXA FORMS MAC
I’m beginning to think I should have taking the advice of everyone in the Mac world and bought PDFpenPro long ago. Next post Previous post Document uniformity with PDFpen, AppleScript, and Automator
