How to reduce PDF file size in Linux

Using a single line of GhostScript command on my Ubuntu’s terminal, I was able to reduce the size of a PDF file from 6 MB to approximately 1 MB: gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=output.pdf input.pdf You can also use the following parameters for -dPDFSETTINGS instead of /screen: /screen – Lowest quality, lowest size /ebook – Moderate quality /printer – Good quality /prepress – Best quality, highest size Update: Read Part 2 of this blog post for more detailled file size reduction settings....

November 21, 2012 · 1 min · 98 words · Heiner

Determining a location’s federal state using Google Maps API

If you have to find out which federal state a city belongs to, you can use the Google Maps API v3. Here is a straightforward JavaScript code snippet: function log(s) { $('#sysout').append(document.createTextNode(s + 'n')); } function getResult(results) { for (var i=0; i -1) { return result['address_components'][j]['short_name']; } } return ''; } function getCountry(result) { return extractFirst(result, 'country'); } function getFederalState(result) { return extractFirst(result, 'administrative_area_level_1'); } function searchLocation() { $('#sysout').empty(); var location = $('#location')....

August 10, 2012 · 1 min · 162 words · Heiner