Coffeemonk

Convert PDFs to JPGs from the Commandline

ImageMagick's convert commandWhen I first switched to Linux, I also attempted to switch to Gimp—which is generally considered to be Linux’s Photoshop. My experience with Gimp, especially versions before 2.5, was not great, and I switched back to Photoshop pretty quickly.

One of my freelance clients publishes a newsletter every month, and I convert the PDF into JPG images to use on the site as a sort of low-fi online version. I discovered pretty quickly that Gimp’s conversion routines did a terrible job. Eventually, I found a solution using ImageMagick, which I had used previously in my bipolar gallery scripts.

Converting images is super easy with ImageMagick’s convert command, and as it turns out, convert can also handle PDF files.

Here’s the commandline I use:

convert -density 300 -size 4100 sourcefile.pdf -quality 100 outputfiles.jpg

Basically, this converts each page of the pdf into a 300ppi JPG with a maximum dimension of 4100 pixels and a JPG quality setting of 100% (or no compression). Each page is saved as an individual JPG named outputfilesXX.jpg (where XX represents the page number, starting at 00).

This gives me much higher-quality starting images than Gimp provided, which I can then resize as needed.

convert has a huge array of features beyond this simple example, and is worth a look if you need to do image manipulation from a script, or batch operations on images from the commandline.

Tags: , , , , ,

How I Remember the Milk (or don’t)

GTD with RTM and Relax!Let’s face it. My record at getting things done is not exemplary. If you looked up procrastinator in the dictionary, you would most certainly not find my picture, because I never managed to send it in. On the other hand, I desperately want to be productive. There are so many things I want to do, that I can’t find the time to do them, and when I can, I can’t think of what to do!

A few years ago, I was introduced—mostly through this dude—to the GTD phenomenon. As seems to be the case with a lot of GTD’ers, I’ve flirted with a few different implementations of the system. I was obsessed for a while, also, with ubiquitous access to my crucial data—email and calendaring—so this would be a crucial part of any GTD system for me as well.

When I first found Remember the Milk, I dismissed it as a limited, web-based to-do list. Over time I heard and saw more positive mentions in GTD circles, and eventually, after attempting to setup my own linux command-line-and-text-file based system (more on that later), decided to give RTM a shot. A couple of items (I think the first and fourth) in the list at the bottom of this post set me on the path of a workable, personalized GTD implementation. I’ve continued to tweak it a bit, and feel like I’ve arrived at a system that works well for me (when I remember to use it—funny how that works, eh?). Anyway, enough setup, let’s get started.
Read the rest of this entry »

Tags: , , , , ,

© 2009 Coffeemonk. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.