Troubleshooters.Com , T.C Linux Library and
Gimp for the Artistically Challenged Present:

Using Gimp to Alter PDF Files

Copyright (C) 2009 by Steve Litt, All rights reserved. Material provided as-is, use at your own risk. 


By Steve Litt

Introduction

It's nice of the organizations and the government to provide online PDFs of their forms, but filling them out, especially in any size but US Letter size, is a pain.

One way to do it is to fill the form out online.  Your mileage may vary, but when filling out something important like a trademark application, I like to take my time, repeatedly read over what I have, and ask questions. On at least one occasion I've taken a week to fill out a trademark application, even though it's probably 400 words at the most. Such careful and slow work isn't compatible with web forms, especially when a lot of government "fill it out online" forms won't let you save partial work.

Another way may be to purchase Adobe Acrobat. I've heard it through the grapevine that Adobe Acrobat lets you modify PDF files to your heart's content, always assuming they're not DRM'ed. But if you're a Free Software kinda guy, you're looking to do it with free tools on your Linux machine. That's what this web page is all about.

Here's the basic process:

Scanning and Using a Signature

Here's how you scan it:
  1. Sign a piece of paper with black pen of substantial weight.
  2. Scan the signature. Scan it dark.
  3. Open the scanned signature in Gimp
  4. Remove any extraneous spots.
  5. Crop to leave a few pixels of white beyond the black on all four sides.
  6. Make the layer transparent: Layer->Transparency->Add_Alpha_Channel
  7. Doubleclick the "select by color" icon (Select by color icon) and set the threshhold value to 15. Don't set it much lower or you risk white pixels overwriting darker background when you finally use the signature.
  8. Click the "select by color" icon, then click the whitest part of the signature image. You'll see selections on everything except the signature.
  9. Rightclick->Edit->Clear, and everything except the signature becomes transparent.
  10. Rightclick->Select->None to view the signature.
  11. If the signature contains significant whitish looking pixel blobs, use Undo to back out past the "select by color", and then repeat step 7 increasing the threshhold value by 10, and then repeat 8 through 11.  You want to get to the point where you have plenty of mid-gray pixels, but no significant whitish pixel blobs.
  12. Once it's right, save the signature image file.
You use it by pasting it into the page images created by GIMPing a .pdf file. Never paste it directly on the background, but instead create a transparent layer above the background, called "writing", and paste the signature above the "writing" layer.

Exercise: Filling out a 1040 Tax Form

x

Printing Legal Size PDFs

There's a special place in the land of the devil reserved for organizations and governmental entities whose forms are legal sized (8.5 x 14). Very few people have legal size paper on hand, and a single ream of legal sized paper costs nine bucks -- almost double the price of letter size. Many printers can't print this size at all. Those that can often don't have a legal sized tray attached, so all trays must be pulled out and the legal paper fed manually.  Normal image handling commands often don't work with legal sized papers. My experience tells me that using legal sized forms doubles the work, but nevertheless sometimes you have to do it. When you do, here's how...

Your mileage may vary, but I was not able to produce a PDF which could be printed with a simple lpr command:
lpr -P lp_myprinter mylegaldoc.pdf
The preceding command causes part of each page to be cut off. Instead, I had to specify the paper size in the lpr command:
lpr -P lp_myprinter -o PageSize=Legal
The preceding command works well, but of course you can't expect the drones at the organization or governmental entity to run that command (even if they had Linux, they probably wouldn't know how to). So instead, let them know they can print the document from Acrobat Reader by:
  1. Page scaling = none
  2. Auto rotate and center = yes (probably)
  3. Properties button->Page Size = legal
The preceding are all set from the dialog box that pops up after File->Print from within Acrobat reader. Note that the recipient may be using a different version of Acrobat Reader, so the properties might be accessed a little differently, but scaling, center and size have long been a part of Acrobat Reader, so the recipient will probably know how to set these if he or she is in the business of receiving PDFs to print.

Cropping

I

Color Reduction

T  
 
 

Back to Troubleshooters.Com * Back to Linux Library