Shrinking Batches of PDF Files on a Mac for FileMaker Server 12


Putting PDFs on a diet.

With FileMaker 12’s new container abilities, more developers and companies will be using FileMaker 12 for document management systems. One of the issues with document management is file size. ‘Garbage in, landfill overflow’ as they say. If you put in huge files, you may quickly end up with a gigantic document folder. This got me thinking about methods of downsizing batches of files.

How to make a batch of PDF files smaller without totally blowing out the quality of the file?

Apple’s Preview has a built-in Quartz filter to down-sample a PDF, but the effects of the filter are often too extreme. Apple’s filter destroys any semblance of readability on a scanned document. Fortunately, some good soul on the Interwebs has gone to the trouble of creating a batch of Quartz filters to create more gradations in quality.

(Note to Apple: How about building these filters in to Mountain Lion, or an upgraded version of Preview?)

Download filters from Josh Carr’s website or github.

Install filters in your Library

media_1340661404153.png

What do you do with the filters once you have downloaded them? First Unzip the files in your Downloads folder. Then drag the folder of Filters into the Library folder at that top level of your drive. This will make the files accessible to all Users on your computer.

In Preview select Export

pastedgraphic-16.png

With the filters installed in your Library folder, launch Preview, Apple’s built-in PDF reader and all purpose viewer application. Open a PDF that is has a large file size that you would like to put on a diet, and from the File Menu select “Export…”.

From the Quartz Filter popup, select a “Reduce to…” item.

pastedgraphic-17.png

In the Export dialog box, you should now see a popup selector called “Quartz Filters”.

I have had good luck with the ‘Reduce to 300 dpi low quality’ filter recently. It dropped my file size from around 60 MBs to 2.5 MBs, and the text in the scanned PDF file was still very readable. It is a good idea to keep your original image or PDF to compare the two files against each other and test for image quality and readability. Once you are happy with the results, you could save over the original when creating the smaller file.

Building a Workflow for Shrinking PDFs using Automator

media_1340662599012.png

Automator is a great way to create a drag and drop or folder automation routine to downsize batches of PDFs. With the Filters installed above, you can set to work building a system that works for you to automatically resize groups of PDF files.

  1. In Automator, click on the PDF Actions in the left hand column
  2. Double click the “Apply Quartz Filter…” action
  3. When it appears in the right hand panel, click on the “Filter” popup to select one of the Filters we installed in the steps above.

Quartz Filters should show up in your Automator steps

media_1340662621970.png

I haven’t created a demo file in this case, because each system will be unique, but anyone who has worked with FileMaker’s Script making capabilities should quickly feel at home with Automator.

Automator Folder Action

media_1340663336723.png

I could imagine a script that ran as a Folder Action on the external file Container storage folder on a FileMaker Server 12 computer. As new files were added through the FileMaker interface and the files stored outside of FileMaker Server, the script would automatically run, resizing images or PDFs on the fly.

2012-07-17 Update: apparently editing files that FileMaker Server ‘owns’ is a bad idea. They will be reported as modified and become inaccessible. Instead you will need to script this modification from inside of FileMaker Pro. Export the PDF, run the modification and then reupload the file back into the container. Thanks to Matt O’Dell at FileMaker DevCon for this tip.

Let me know how this works for you and send me a link to any creative Automator workflows you come up with.

Related Articles:
URLs in PDFs – Yet another reason to shorten URLs in FileMaker
Shortening URLs using FileMaker

Advertisements

7 Responses to “Shrinking Batches of PDF Files on a Mac for FileMaker Server 12”

  1. Very cool – I had no idea about the Quartz additions – thanks for posting

  2. Thanks this is really a good. Your post is very helpful to do this.

    Neutralizer

  3. I have just posted some Scriptmater code on FM Forums to squish PDF files which therefore makes it cross platform

    Would be great to do a side by side comparison

  4. This worked perfectly. Love all the prefab choices for file size reduction. Only correction I’d make is that links to folder need to be updated. They are now in Dropbox, as MobileMe has closed. Go to: http://dl.dropbox.com/u/41548940/PDF%20compression%20filters%20%28Unzip%20and%20put%20in%20your%20Library%20folder%29.zip.

Trackbacks/Pingbacks

  1. URLs in PDFs – Yet another reason to shorten URLs in FileMaker | HomeBase Software - July 14, 2012

    […] Articles: Shrinking Batches of PDF Files on a Mac for FileMaker Server 12 Shortening URLs using FileMaker Blast from the Past: FileMaker Pro […]

%d bloggers like this: