Feb 01

Just a quickie, this morning I needed to post the monthly payroll calendars for 2007 to our website. These calendars are created using Word’s calendar template and are then sent to me for conversion to PDF and publishing. This year I was able to handle the task a little differently.

I opened the 12 page doc file in OpenOffice and exported it to PDF. There wasn’t a clear way to save each page as an individual file so my output was a single PDF. I needed a fast and easy way to split the pages up for publishing. I remembered some chatter on the GNHLUG list regarding pdftk so I installed it, took a brief look at the man page and did the following:

pdftk Calender2007.pdf burst output ~/tmp/%02d-2007.pdf

Poof! Calendar split out to 12 files named 01-2007.pdf, 02-2007.pdf and so on.

This saved time and eliminated the annoyance factor completely!  The tools available for Linux blow my mind, these are programs I never would have even heard of when I was strictly Windows.  Change is GOOD.

written by M@ \\ tags: ,

Nov 20

Something I’ve been missing since my migration to Linux is the ability to print whatever I want to a PDF. I find it insanely useful when I want a copy of purchase receipts or just about anything else that I should have a record of. I usually don’t print anything to paper, simply because I’ll just lose it or recycle it and then regret it 6 months later when I need a copy. Enter cups-pdf, a super easy way of outputting “stuff” to PDF.

Installing on Ubuntu 6.10:

sudo apt-get install cups-pdf

Create the printer:

  1. From the Gnome System menu, navigate to System > Administration > Printing.
  2. Double click on New Printer
  3. PDF Printer should already be selected under Use a detected printer, click Forward
  4. Select Generic from the Manufacturer drop down menu
  5. Select Postscript Printer in the Model section, click Forward
  6. Name your printer (I chose PDF-Printer) and click Apply

All set, you can now opt to print web pages, or whatever else to your Cups/PDF-Printer. Ubuntu saves the PDFs to your ~/PDF/ directory (if you want to change the default location, use the last paragraph on this post as a guide).

Installing on Fedora Core 6:

Fedora keeps this package in the extras repo, you can install it using the command below.

su -c ‘yum install cups-pdf’

A few seconds later I had a new printer named Cups-PDF, that when selected would print whatever I wanted to a PDF on my desktop. I personally don’t want all of my PDFs saved to the desktop so I created a PDF folder in my home dir and made a change to the config file:

As root, edit /etc/cups/cups-pdf.conf, locate the line that reads Out ${HOME}/Desktop and change it to Out ${HOME}/PDF. I didn’t need to restart the CUPS service to apply the change, it just worked. :)

written by M@ \\ tags: , , , , ,

Oct 31

Thanks to my trusty Fedora box, I was able to please one of the Big Cheeses here at work. I had a PDF that needed to be converted to a Word document. The first thing I tried to do was open it in Acrobat Pro and run a quick Save As. On a normal PDF this would have been the fastest way to get the job done. Of course this PDF was restricted with password security (Save As failed due to those restrictions). How annoying! I remembered using a command line tool a few months ago to convert a PDF to some other file type and figured I’d give it a shot. I installed the “xpdf-utils” package from Fedora’s core repo and ran the file through pdf2ps (Ubuntu installs the pdf tools by default). I then copied it back to the machine running Acrobat Pro, opened the postscript file and saved it as a Word doc. Task completed and lessons learned. The lessons?? Linux has a tool for that, and just because something is supposed to be secure (like a PDF that isn’t supposed to be changed) doesn’t mean it is.

To satisfy my own curiosity, I took a few minutes to create a PDF that required a password to open. I attempted to run it through the pdf2ps tool and I was unable to convert the file without providing the password. I should note that Acrobat Pro issued a warning when I saved the pdf stating that Adobe products enforce the restrictions set by password security but some third party products might be able to bypass some of the restrictions.

Note: This PDF did belong to the University, since it was ours I don’t feel that it was immoral to circumvent the restrictions.

written by M@ \\ tags: , ,