Just Beyond The Bridge

How To Compress PDFs As You Create Them On A Mac

Tuesday, April 21, 2009

Pigeon-holed in “Technology

If you’ve ever created a PDF using OSX you’ll know that it’s very simple. Macs come with out-of-the-box PDF support which means you don’t need a program like Adobe Acrobat Reader (or anything more heavyweight) to open or save your files as such.

However, you’ll also know that emailing the files it creates takes much longer than it should - the created files are massive in relative terms.

I’ve created one-page invoices using PDFs for a long time, and thankfully, due to this great little PDF compression plugin, they are crunched down to a sensible size from the outset. However, I recently switched to let Billings handle my invoicing and it uses the default OSX PDF creation tool to generate it’s PDFs - big files ahoy.

To give you an idea of the difference in file size between a compressed one page document - Billings chucks out a 1.4Mb file, whereas my compressed versions of the same documents are about 19Kb. Not ideal when you quickly want to output an invoice, attach and send it.

So how do you solve it? Well there are some nifty features in OSX that you may not be aware of (or at least not use), namely Folder Actions. Essentially folder actions allow you to run a script every time a file is placed in or removed from a folder on your Mac.

This creates a great little hook on which we can run a script to compress the files in a specific directory then move them to a ‘Compressed’ folder once done.

Step-by-Step: How to Do It

1. Download and Install Compression Plugin

Download and install the PDF compression plugin. It’s a Quartz filter workflow that uses well-chosen settings to reduce your file size down. You will also now benefit from the use of it everytime you encounter a save dialogue from now on.

2. Create an Automator Workflow

Automator is a free program bundled in every OS X Mac (have a look in your Applications folder). It allows you to run series of tasks automatically in a single process. You simply need to create a workflow consisting of:

  1. Get Specified Finder Items (once added to the workflow, click Add to select the directory which will contain files to be compressed.
  2. Get Folder Contents
  3. Apply Quartz Filter to PDF Documents (Select ‘Compress PDF’ from the drop-down - this will only appear if you have installed the plugin as above)
  4. Move Finder Items (change the location to a place where the final, compressed files will be automatically moved)

3. Test The Workflow

Place a test PDF in your ‘Compressor directory’ (specified in step 1 of the workflow) then run it. It should compress this PDF, then move it to the ‘Compressed directory’ you specified in step 4, leaving the ‘Compressor directory’ empty.

Once you’ve got that working, you can automate the process, so this executes every time a PDF is saved or moved into the folder. Click save, and Save as Application (as opposed to Save as Workflow, otherwise every time you run it, the Automator program will want to load up fully instead of run in the background).

4. Create A Script

You now need to create little AppleScript which can run this workflow application.

Go to /Libaray/Scripts/Folder Action Scripts/

Duplicate one of the existing scripts, and rename it to something sensible like PDF - compressor.script

Open it and paste the following. You must manually alter the path to your Automator application as appropriate.

The code below is wrapping because of my thin blog layout. Best idea is to copy and paste directly, or View Source of this page to determine where the line breaks actually are if you are not sure.


on adding folder items to this_folder after receiving added_items
try
tell me
do shell script “open -a /Users/Andy/Documents/My\\ Mac/Compress\\ PDFs.app”
end tell
end try
end adding folder items to

Note! All spaces in the path must be double backslashed as above. To test if your typing is correct, paste the bit between the quote marks (e.g. open -a /Users/Andy/Documents/My\\ Mac/Compress\\ PDFs.app) into Terminial and run. If it runs the Automator application you created, your script will work. If it doesn’t, check the path you have typed.

Save it and close the Script Editor.

5. Set It Up

Find your ‘Compressor directory’ (specified in step 1 of the workflow) and right-click on it. From the menu that appears, select More > Configure Folder Actions…

Tick the ‘Enable Folder Actions’ box, then press the Add icon (+) to add the ‘Compressor directory’ as a trigger folder. Select it, and make sure the ‘On’ tickbox it ticked.

Next, click the Add icon (+) for the right hand pane to add a script. You should be able to find and select the AppleScript you have just created (something like PDF - compressor.script).

6. Done!

Close the window and you’re done. Every time somebody pastes or saves into the ‘Compressor directory’, the folder action will kick in, launch the AppleScript and that in turn will execute the Automator compression tool and move the compressed version of the PDF into the ‘Compressed directory’. Sorted.

Of course, there is lots more scope with this. Automator means you don’t need to know much AppleScript to get this going, but you can really push the boundaries if you are willing to experiment. This setup suits me, but it’s likely you’ll need to experiment to get it to the way you need it.

Comments (2)

Wordpress: Moving From Development or Staging to Live

Friday, April 17, 2009

Pigeon-holed in “Web-Design

It’s been a long annoyance of mine that Wordpress insists on writing paths directly into the database, so when switching from staging or production to live you have to alter these paths.

However, if you also find this an irritation, a quick way to solve it is to define a couple of constants in the wp-config.php file. You simply define the url and home addresses as below, and as long as you are running a server that supports the server variable HTTP_HOST (e.g. Apache) the switch should be automatic and override the settings in the control panel.


// WordPress address on settings page
define(’WP_SITEURL’, $_SERVER[‘HTTP_HOST’]);
// Blog address on settings page
define(’WP_HOME’, $_SERVER[‘HTTP_HOST’]);

Comments (0)

4

Wednesday, April 08, 2009

Pigeon-holed in “Technology

I once had an urge to write. It was probably born out of a frustration that (at the time) everything creative I was involved with either was being hand drawn and product shaped, or laid out using a computer.

It’s been exactly four years since I wrote my first post on this blog, and not much has changed except I’ve lost my almost insatiable desire to write. It’s not that I don’t have ideas and thoughts, but everything these days appears to be summed up in 140 characters and I rarely think of a topic that I want to elaborate on, at least in a written form at least.

I know this won’t last forever. Twitter will come and go like everything else on the web. When I think back over the past seven years I have actively used the internet and consider all those things I used to visit/were so important to me at on time or other: DeviantArt, amused.com, Rojo, Friends Reunited, My Yahoo!, my Angelfire and FreeYellow websites, BoltBlue, Facebook - you realise things can only last a finite (and apparently increasingly short) period of time.

I also know I will get back my desire to write again one day. I tend to get these bursts of energy which have to be captured in words, but I think since I started running the business as a full-time occupation, that energy has been channelled via other routes.

I really have thought long and hard about the future of this blog. I’m not sure I want it all to remain online, especially in it’s current form. Malarkey did something a few years ago which was to archive anything interesting for anyone who really wanted to find it, but otherwise stopped it being immediately obvious. That appeals more and more.

Realistically, I don’t have to do anything about this site. It’s not doing much harm to anyone, except to me. Every time I visit it, it looks so forlorn and badly kept that I feel bad I don’t make many contributions to it anymore. But then again, for the two years that it truly shone I was in a state of overdrive and made commitments to write near daily - no matter how poorly - so comparisons to ‘the good old days’ are simply unrealistic.

I suppose also that in a way I feel like we (the ‘interneteers’) have created a bit of a primordial swamp over the past few years. Our general creativity, outpourings, projects that never went anywhere, willingness to ditch one web-based product for another at a moments notice and slimy trail of media (videos, podcasts, blog entries) can now be viewed with some hindsight. We’ve really worked hard since we got our hands on the controls, however now behind us we’ve left a soup of semi-useful stuff and we’re finally venturing out a little from it’s murky waters. Well, perhaps we’re not even that advanced. Maybe we’re just developing fins or something. A lot of effort has gone into getting us to this point, including a significant number of my own hours that went into this chronicle that I’m now seriously considering wrapping up on.

I wonder what the value of all of this will be in years to come.

Comments (0)

F1 Calendar: Formula One Race Times for Your Desktop Calendar

Monday, March 16, 2009

Pigeon-holed in “Launches

F1 Calendar Launch

F1Calendar.com is a little something Si and myself have been working on recently.

Very much in the tradition of Si’s previous ‘KickOff’ productions (Six Nations Kickoff, Euro Kickoff and World Cup Kickoff), F1 Calendar is a quick way to check Formula One race times and dates for the entire season, or retrieve of the same details in a file that can be loaded into your copy of iCal or Outlook (or other desktop calendaring software).

You can download a standard .ics file, or subscribe to the updating ‘webcal’ version which will update throughout the season to reflect any changes that occur to the planned event dates over the coming months.

F1 Calendar supports every world time zone, and remembers the last one you viewed so you can always return to view the most relevant schedule, instantly.

We’ve also allowed a level of customisation for the downloadable content; we imagine not everyone wants all the practice and qualifying sessions recorded in their calendars, so before you download you are asked to pick which ones (if any) you want to include. We’ve got dates and times for all Grands Prix, qualifying sessions and practice sessions.

The design and architecture has been kept straightforward - there is only one page to speak of, but there are quick urls for all time zones if you need to send them as links. Also we’ve decided that IE6 will get a reduced visual experience (and a reduced visual experience only), and this is the first site either Si or myself have been involved in which we opted to use a Bring Down IE6 inspired philosophy - really on the basis that people who understand how to download calendar files and subscriptions will also understand how to download a browser and how it would benefit them.

If you like it, please Tweet it, pass it on or bookmark it - we’re on twitter at @f1cal.

Building it was pretty enjoyable.

Formula One Race Times & Dates

Comments (0)

Multipack Presented

Thursday, February 26, 2009

Pigeon-holed in “Multipack

Tequila, lemons and salt.

I’ve been thoroughly booked up the past few days. What with having a bit of a large night out on Friday with George, Will and Gwyz I was on surprisingly good form for Saturday’s Multipack, although I did avoid revisiting the beer.

Hosted entirely in Digbeth (just below Brum city proper) we had a really good turn out and I met a good number of new faces. Kudos to Mr Oxton who made a nice comment about me on his blog for the price of a Guinness.

Matt’s talk on ARIA was a nice little intro to a wider subject that I had previously known little about, whereas Bruce very neatly illustrated some of the finer points of HTML 5 as it stands and the political wrangling that always threatens with web-specs. Stuart rounded off everything with the most technical part - outlining the best bits of ‘new’ JavaScript and what we can look forward to from browser support in the future. I suppose it therefore was only fitting that he had co-ordinated with Apple to release the upcoming beta of Safari so soon afterwards… (I also quite surprised myself when I realised I had understood pretty much all of it).

Other things I took away from the day was a brief and sandwich-punctuated discussion about Microformats and Birmingham Social Media with Andy Mabbett; a chance to examine the new and neatly put together studios of One Black Bear; discuss wacky Japanese architecture with Jon Dennis and discover why exactly Tess was brandishing a thick PHP textbook at the last meeting. And of course it was great to see all the usual suspects as well. Photos here.

The only disappointment was that the sun didn’t last until Sunday but since then I’ve seen Raj, Tom and George, caught up on Lost and Flight of The Conchords (of which episode 5 is a cracker) organised go-karting for the weekend and been pleased by what the accountant had to say about the business helping to pay the rent.

Tomorrow I’m doing my annual attendance at the old school, answering questions on web design for kids about to pick their A-Level subjects. The buffet is usually excellent.

I’m also looking forward to the next couple of months. I’ve organised a trip down to Southampton on business, have a great piece of work coming up which almost makes me envious of myself (if that’s possible) and am eagerly awaiting delivery of rare book purchase (for me anyway) - the Typographic Desk Reference. It will nicely prop up the one other proper design book I own.

I think this photo most adequately sums up last Friday.

Comments (0)

Multipack Presents - 21st Feb 2009.

I’m pleased to announce a new type of event from Multipack launches this month; Multipack Presents - and it’s happening this Saturday, 21st February in Birmingham. Open to all, free to everyone.

On this day we will reluctantly peel ourselves off our Birmingham barstools and reposition ourselves at the new offices of Birmingham Web Agency One Black Bear in their Fazeley Studios for industry-related talks by web powerhouses, Messrs Machell, Lawson and Langridge.

Topics of these free presentations will be HTML 5, the new W3C accessibility tool WAI-ARIA and other emerging web standards. And it’s going to be good.

Pre-talk drinks are at 2pm in The Old Crown (Digbeth High Street), and the talks will be held in the studios at 4pm, though please come along and socialise beforehand (especially since we may need to enter the studios en-masse if the reception is not usually open on a Saturday!).

Kindly email supremos Campaign Monitor will be supplying some refreshments and freebies for attendees, and being as the whole thing is ruddy well free, there is no reason not to show up, although it would be very courteous if you add yourself to the Upcoming group so everyone involved gets a good idea of the numbers to expect.

Looking forward to seeing you all there :) Any questions can be fired at me or other Multipack types on Twitter. More info here.

Comments (0)

Higgsy’s Wonderful Wordly Insight

Sunday, February 01, 2009

Pigeon-holed in “Rants

It’s been a while since my last post. Around a month I believe, which is a fairly big gap by my standards. I believe twitter has something to do with this, but also a general lack of desire to write loads.

However it has allowed me time to contemplate the following three pieces of wordly-wise advice for you.

  1. The speed limit on single lane national speed limit roads is 60mph and most people know that. If you think it’s 50mph, or 40mph, I suggest you re-read the highway code. Also if you don’t know it’s 70mph on dual carriageways, the same applies to you too. The government should take note; most people don’t understand the white disc with a black line through it. Perhaps it would be more sensible to put a number on all future speed limit signs so the whole thing is unequivocal. Sensible huh?
  2. Gym members; if it was intended for that, they wouldn’t have called it a hair drier. Why you think anyone else wants to watch you heat your genitals while standing completely nude in front of a mirror is a mystery to me. Get it away from there before you do an injury to yourself. It’s not going to increase the size of anything, and even if it does, we don’t all want to have to watch.
  3. If you’re installing iWork ‘09 and you had previously installed iWork ‘08, please remember that just because you installed it doesn’t mean the default program which opens a file has changed. I found this out halfway through a keynote presentation. Delete the old version to avoid and mid-presentation annoyances.

I’m not actually that much in a ranty mood, those are the exceptions to the rule. To counteract the negativity of the three points listed above, here are three positives from January 2009.

  1. If you haven’t seen Slumdog Millionaire, you really should do. It’s very enjoyable.
  2. If I had to recommend some music right now, I couldn’t say better than The Black Key’s last album (2008), Attack and Release. And what better way to listen to it than through free online music service, Spotify
  3. The Simon Amstell interviews Eddie Izzard experience was great. The audio recording will be available as a podcast on iTunes shortly.

That is all for now.

Comments (0)

Page 3 of 90 pages  <  1 2 3 4 5 >  Last »

This is Just Beyond The Bridge

Something About Me

Called Andy, I am passionate about design, love to travel, and have a knack for all things digital. This is the full story…

July 2010
M T W T F S S
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

More Stuff

Back Catalogue

  1. Apr ‘10
  2. Jan ‘10
  3. Oct ‘09
  4. Sep ‘09
  5. Aug ‘09
  6. Jul ‘09
  7. Jun ‘09
  8. Apr ‘09
  9. Mar ‘09
  10. Feb ‘09
  11. Jan ‘09
  12. Dec ‘08
  13. Nov ‘08
  14. Oct ‘08
  15. Sep ‘08
  16. Aug ‘08
  17. Jul ‘08
  18. Jun ‘08
  19. May ‘08
  20. Apr ‘08
  21. Mar ‘08
  22. Feb ‘08
  23. Jan ‘08
  24. Dec ‘07
  25. Nov ‘07
  26. Oct ‘07
  27. Sep ‘07
  28. Aug ‘07
  29. Jul ‘07
  30. Jun ‘07
  31. May ‘07
  32. Apr ‘07
  33. Mar ‘07
  34. Feb ‘07
  35. Jan ‘07
  36. Dec ‘06
  37. Nov ‘06
  38. Oct ‘06
  39. Sep ‘06
  40. Aug ‘06
  41. Jul ‘06
  42. Jun ‘06
  43. May ‘06
  44. Apr ‘06
  45. Mar ‘06
  46. Feb ‘06
  47. Jan ‘06
  48. Dec ‘05
  49. Nov ‘05
  50. Oct ‘05
  51. Sep ‘05
  52. Aug ‘05
  53. Jul ‘05
  54. Jun ‘05
  55. May ‘05
  56. Apr ‘05
  57. All Archives

Search