Salmon Sushi

Salmon Sushi at Hachi Hachi Bistro, mall Taman Anggrek. Each sushi costs 9k IDR, but the size of it justifies the price.

Unakyu

Unakyu Sushi, also at Hachi Hachi. See more photos at my Flickr page.


The widely known and easiest way to combine PDF documents from the command line is to use pdftk:

$ pdftk file1.pdf [file2.pdf ...] cat output dest.pdf

pdftk can do a lot more than just pdf concatenation. It can also split pages, rotate pages, apply watermarks and even repair broken PDFs. The downside is it removes outlines or bookmarks from the output document. So if you need the bookmarks intact you can’t use pdftk.

If you only need simple concatenation with bookmarks, use iText. iText is a powerful Java library for PDF generation and manipulation. Thankfully we don’t need to write our own Java code since hidden underneath is a simple PDF concatenation tool:

$ java com.lowagie.tools.ConcatPdf f1.pdf [f2.pdf ...] \
  dest.pdf

Besides ConcatPdf, iText also has other tools such as SplitPdf and HandoutPdf.

iText in Ubuntu How To

To install iText in Ubuntu/Debian, from Synaptic install the package “libitext-java”. If you prefer the command line:

$ sudo apt-get install libitext-java

Before using iText like the above example you need to set up the CLASSPATH:

$ export CLASSPATH=$CLASSPATH:/usr/share/java/itext.jar

Or you can also set the CLASSPATH directly:

$ java -cp /usr/share/java/itext.jar \
  com.lowagie.tools.ConcatPdf f1.pdf [f2.pdf ...] dest.pdf

Read at The Official Google Blog. This is significant.


Espresso Con Panna

Espresso con Panna at Highlander Coffee.


The last time I tried to produce ODF text document from Python, I hack Django templating to load an ODT file as a template. Long story short: Don’t try this at home. The fact that the application is still running in-production is very much a miracle.

Last week I suddenly stumble upon Appy pod. Oh if only I had found you sooner! Pod uses OpenOffice’s track changes feature to insert template placeholders and notes for conditionals and loops. This makes templates to be very simple to create. Aside from ODF, pod can also call OpenOffice in headless mode to generate the result PDF format.

Of course there are some limitations. You can’t put a word by word conditional, you need to use a paragraph. You can’t loop more than one row in a table. Also if there are errors, the error messages will be displayed as notes in the output document. While this simplifies debugging, it won’t look professional when it is seen by the user.

I you ever need to generate ODF documents from Python, do give pod a try!


Latte

28Nov09

Irish Creme Latte

Irish Creme Latte at Highlander Coffee. Isn’t it lovely to get latte art on your coffee.

Hi readers, long time no see. As you may deduce from my previous posts, I am now living and working in Singapore. I hope to resume my posting on this blog now that the Internet here is much reliable than back home.


Temple Photo

22Aug09

Temple

The same temple as the previous post. This time from the inside.


Temple

Another photo from my FZ-28. Buddha Tooth Relic Temple in Chinatown, Singapore. See more photos on my Flickr page.

By the way sorry if its old news but Google Chrome for Linux (development build) is now available. Although its a dev build, it feels stable enough to be used as your default browser. You can download a .deb package from the Chromium dev channel. The window title/border does look a bit out of place, but you can tell it to use your default system default (like Metacity on Gnome).



Interesting things to do in Singapore, but probably aren’t mentioned elsewhere:

Meanwhile, things to avoid:

  • Long John Silvers. Save your money. If you want fast food, go to Burger King.