Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: A PDF Compression Service System 10.6
Snow Leopard only hintThis is a followup to this thread about using a Third party Java tool for PDF compression. I didn't get successful font rendering for the compressed PDF file using the included command options for tool.pdf.Compress, so I left the '-noembed' option out, but you can use your own command options as also described in a comment to that earlier hint by changing them in step 23 of the Workflow. This Workflow is long but it demonstrates a technique I sometimes use for building and executing shell commands.

Since then I created a Snow Leopard Service for executing the compression process.

I tested on a clean 10.6.4 system. Remember to download Multivalent20060102.jar (from one of the download location choices listed in the original hint), and put it into ~/Library/Java/Extensions, which is required for the Service to function. You'll probably have to create these folders.

To use the Service, download it and put the expanded Workflow into ~/Library/Services. It should appear as a contextual menu choice when you Control+Click on a PDF file, or you can give it a keyboard shortcut to run on a selected PDF. I prefer to use it as a contextual menu item rather than as a printing plug-in.

When you run the Workflow, it prompts you for a location in which to save the compressed version of the PDF to be generated. The newly created PDF will have '_compressed' added to its base name.

This method was tested by printing a Safari-rendered page to PDF, which demonstrated that the Workflow can work, but doesn't guarantee it will work in every case, of course. The reason that I built the Automator Workflow was that I've often encountered PDF files which, when put through a compression process using Preview and Quartz filters, actually grow in size instead of experiencing a reduction in size.

Also, I've encountered quite a few PDF files that always cause the Automator Workflow to fail with errors such as Java exceptions. The workaround that I've been able to use in those cases with consistent success has been to open the .pdf and save it as a different .pdf document using Preview. The Workflow seems to be able to work on all documents saved as new PDF files using Preview.

[crarko adds: I tested this, and it works as described. I don't know if the font compression will always be successful. If there is an issue try the workaround mentioned in the last paragraph. The Service download is mirrored here. It is indeed quite long.]
  • Currently 3.20 / 5
  You rated: 5 / 5 (5 votes cast)

10.6: A PDF Compression Service | 2 comments | Create New Account
Click here to return to the '10.6: A PDF Compression Service' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: A PDF Compression Service
Authored by: pheski on Nov 11, '10 04:44:15PM

The Snow Leopard Sevice link gives me a 404 not found error - cannot download the service.

[ Reply to This | # ]
10.6: A PDF Compression Service
Authored by: crarko on Nov 11, '10 06:14:59PM

OK, I believe the link is fixed now.

[ Reply to This | # ]