Thursday, 10 June 2010

Angelos' PDF tool chest

Staff in my company frequently needs to work with PDF files, but pathetically, most staff only get to use Adobe Acrobat Elements 6. We have Acrobat 7 Professional, but it is only restricted to a handful of staff.

As a help desk staff, I constantly get asked:
  1. How do I combine a few PDF files?
  2. Is it possible to remove the password on the file?
  3. Why can't I view the text of this Japanese PDF?
Okay, actually most of the questions asked can be answered by Acrobat 7 Professional. But since most of us don't have it, we'll need to use something else to work around the problems. All software listed below is free for personal and business use.


PDFTK Builder is the most used PDF tools. It combines, splits, adds watermark, rotates and adds password protection to PDF files. It has a simple interface but lacks fine grain control over some of the functions. It, however, is good enough for most people.

pdfsam is not as feature rich as PDFTK Builder, but it does what it focuses, split & merge, really well. It allows you to visually reorder pages, split and merge PDF files according to complex rules. It also allows you to rotate pages. If that's all you need, pdfsam is great for the job.

MuPDF is an extremely lean PDF viewer, but the treasure lies in its application folder, it's a tool called pdfclean. It removes all PDF restrictions like printing or copying, as long as you can view the document. You'll need the password if the PDF is encrypted, but it's handy when you need to copy some text out of a PDF but it stupidly forbids it.

PDF-XChange Viewer as a replacement of the Adobe Reader. It takes up less disk space, launches quicker and renders problematic PDFs without a glitch. Once a user has a PDF where text won't go where it should and thin lines thickens when viewed using Adobe Reader. I saved him by opening the file using PDF-XChange Viewer and print the file again. It also opens Japanese PDF files gracefully when Adobe Reader gives you a blank page.

These four tools together cover almost 100% of the PDF manipulation needs, what I am missing is the ability to add attachments to PDF files, but that is not really a necessity... oh, by the way, if you don't have any PDF printers installed, you can always use my favourite open source PDFCreator.

Friday, 14 May 2010

Building a secured proxy

For various reasons (like getting through the GFW when visiting PRC), you will want a secure proxy to be your springboard to the unrestricted Internet. While it may sound like you need to be a networking professional in order to set that up, it is actually as simple as installing a few packages and clicking through a few wizard.

What you will need:
  1. A Windows PC with unrestricted Internet access;
  2. OpenVPN ALS (also known as Adito);
  3. Proxy server software (WebWasher is used in this guide);
  4. Browser with JRE 1.6 (you probably need not worry about this).
Installing Adito (OpenVPN ALS)
This is easy, because a gentleman - Lars Werner - has made an installer for Windows. So you just have to grab the installer and run it.The page hosting the installer also has a walk-through of the installation process, so I'm not going to repeat it here.

Installing proxy server software (WebWasher)
The freeware version of WebWasher has been discontinued after McAfee bought it out. But thanks to these people we can still find this nice little proxy software somewhere on the net. Configuration is simple. When it prompts you for Browser Configuration, you either choose "Configuration Free (all browsers)" or "Manual Configuration". The more important thing is that you checked the box "Proxy Engine > Server" in the main window and on the Proxy Engine page, Local HTTP proxy port is set to 8080. Otherwise it simply won't work. Look at the Standard Filter and Privacy to see if there's any filters you want to apply. I have the following filters turned on: 
  1. Dimension Filter for images, applets & plugins;
  2. URL Filter for everything except windows and scripts;
  3. WebBugs Filter.
Your needs maybe different from mine, so adjust accordingly; if you find that some web sites stop working after turning  on filtering in WebWasher, you may just try disabling the filters.

Configuring Adito
This is probably the hardest part (though it is actually still quite straight forward). It involves two steps:
  1. Create an account;
  2. Creating an SSL Tunnel.
Creating an account in Adito
After logging into Adito's management console, go to Access Control > Accounts. On the right, choose Create Account. Fill in the desired user name and full name, press Save, then enter the password for the user and press Save again. You should be able to see your newly created account on Accounts page.

Creating an SSL Tunnel in Adito
In the management console, go to Resources > SSL Tunnels. On the right, choose Create Tunnel. Enter a name & some description, whatever is fine, also check "Add to favorites" then press next. On the next page, enter the info exactly as below:
  • Source Interface: 127.0.0.1
  • Source Port: 8080
  • Destination Host: localhost
  • Destination Port: 8080
There's no need to change other settings, just press next.
On the SSL Tunnel Policies Selection page, add Everyone to Selected Policies then press next followed by Finish and Exit Wizard.

This concludes Adito's configuration.