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

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

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.

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

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.
- In Automator, click on the PDF Actions in the left hand column
- Double click the “Apply Quartz Filter…” action
- 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

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

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
Very cool – I had no idea about the Quartz additions – thanks for posting
Thanks this is really a good. Your post is very helpful to do this.
Neutralizer
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
Cool. Got a link?
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.
Thanks for the update. The github link still seems to work as well.