Is your application larger than necessary because of needless data stored in image resources? What is making your PDFs four times the size they ought to be? More on this shocking discovery at 11!
(It’s 11.) Being a responsible and forward-thinking developer, you’re probably good and ready for the day Mac OS X supports resolution independence – lol – so you use multilayer TIFFs and PDFs instead of flat bitmap images whenever possible.
Try this: get the file size of one of those Adobe Illustrator®-produced PDFs. Now open it in Preview and resave it. Notice anything? Once a PDF has gone though Apple’s PDF processing, it’s way, way smaller.
We sure noticed this, and it bugged us. A lot. What was all this extra crud? Will started digging into the files and brother, you won’t believe what he found. Swatches, patterns, preview bitmaps, all sort of metadata; even though we’d specifically turned off all the extra options when saving from Illustrator: Preserve Illustrator Editing Capabilities, Embed Page Thumbnails, etc.
We could have re-saved all our PDFs in Preview, but why not make it totally batch-y? Thanks to Will, we present:
ShrinkIt is a simple, small, Panic-internal tool (for Mac OS X Snow Leopard) that will automate the process of stripping needless metadata from PDFs by re-saving them using Apple’s PDF processor. For app resources and icons that aren’t using high-end Illustrator features, this should be lossless — Apple’s PDF code is not compressing anything, just removing cruft. Simply drop a bunch of files (not folders) onto it — such as the contents of your app’s Resources folder — to have it find the PDFs and do its magic. The original files will be renamed with the prefix “_org_” for backup safety. That’s it!
We’ve seen it shave 4 megabytes off an app bundle. Hopefully it’ll shave you as well. Oo-er.
Update: ShrinkIt is intended for simple vector resource PDF’s that have more Illustrator cruft than vector data. It may not work well for complex bitmap-heavy or press-ready PDF’s.