appareloreo.blogg.se

Pdfpenpro 7
Pdfpenpro 7




pdfpenpro 7
  1. PDFPENPRO 7 PDF
  2. PDFPENPRO 7 FULL

Anyway, at the end of this section we have the full path to the watermarked file we’re going to create. All it does is take /path/to/original.pdf and generate /path/to/original draft.pdf, but because AppleScript’s text handling capabilities are so shitty, it takes several lines to do what in any decent language would be a simple regex substitution. Lines 11-19 are, in a nutshell, why I hate AppleScript. That sandbox is inside the ~/Library/Containers/ folder. But when the imprint file is built into the script, it can only be within PDFpenPro’s sandbox. If the user chooses the imprint file, as she does in Smile’s Imprint All Pages With Image… script, the imprint file can be anywhere because the system knows that the user chose it. This is an unfortunate consequence of sandboxing. It’s in a bizarre location, deep inside the ~/Library/Containers/ folder. Lines 2-4 establish where draft.pdf is stored. The imprint graphic will be placed on a layer above the original page, so it needs a lot of transparency to allow the original page to show through. The most important thing is its opacity setting. I made it in OmniGraffle, but I’m sure it could be made in any number of programs. I used the same file as before, draft.pdf, which consists of the word DRAFT in 144-point Helvetica, rotated at a 60° angle and set to an opacity of 10%.

PDFPENPRO 7 PDF

The interesting part is the imprint function.įirst, of course, we need a PDF file to use as our imprint. The on run section in Lines 37-39 is the standard template for AppleScripts in Automator. What I ended up with was this Service, which is basically just one AppleScript that accepts as input a set of PDF files selected in the Finder.Ģ: set myLibrary to (path to library folder from user domain) as stringģ: set myFile to myLibrary & "Containers::Data:Documents:draft.pdf"ġ1: - The new file will have the same name but withġ3: set oldPath to (path of myDoc as string)ġ4: set newPath to (text 1 thru -5 of oldPath) & " draft.pdf"ġ8: set pageCount to count pages of myDocġ9: repeat with pageNumber from 1 to pageCountĢ0: make new imprint with properties at beginning of imprints of page pageNumber of myDocĢ3: close myDoc saving in POSIX file newPath The nice thing was that I knew this script would have most of what was needed to take me out of it. This process worked well, but you can see why I wanted to automate it: too much me in every step. Save the newly watermarked file under the same name but with “draft” appended to it.Choose the graphic I wanted to imprint, a file named draft.pdf.Choose the Imprint All Pages With Image… command from the scripts menu.I’d already been using PDFpenPro’s “Imprint All Pages With Image…” script. And if I need to write an AppleScript, I’d rather just write the whole thing as a script instead of bouncing back and forth between actions and scripts. I’m sure there’s a way to save the file and folder names in variables before adding the watermark and then retrieve them later for the moving and renaming operations, but it looks like I’ll have to drop down into AppleScript to do that. I could, of course, move this new file and rename it, but at this point in the workflow the original file’s name and folder are lost, so they’re not available anymore. It creates a copy that’s off in some subdirectory of /private/var/.

pdfpenpro 7

The problem with the built-in watermarking action is that, unlike many of the other image actions, it doesn’t change the file in place. What I couldn’t live with was Automator’s inability to put the watermarked file where I wanted it. I was a little disappointed to find that it would use only bitmapped images-like PNGs or JPEGs-for the overlay instead of crisp and infinitely scalable PDF images, but I could live with that. I had hopes that this would be a simple Service to build, because I knew there was a “Watermark PDF Documents” action in Automator. I could always make a duplicate beforehand and watermark it. The new file has the same name as the original but with “draft” appended to it.Ī less than ideal, but still acceptable, solution would be one in which the original file gets watermarked and saved in place.

  • I end up with a new watermarked file in the same folder as the original.
  • I right-click and choose “Draft” from the Services submenu.
  • I select the PDF to be watermarked in the Finder.
  • Ideally, the command would work this way: I wanted a one-step command that would put a big “DRAFTS” watermark on every page of a PDF document. Next post Previous post One-step watermarking service






    Pdfpenpro 7