Tuesday, February 12, 2013

How to save a web page as pdf preserving the hyperlinks in Ubuntu

When trying to save a web page as a pdf using 'Print to File' printer, it doesn't preserve the hyperlinks. So, we won't be able to click on them and navigate to the web page of the respective url.

I was searching for a solution for this and came across an answer [1] at askubuntu which mentioned wkhtmltopdf! [2]. It preserves the urls in the exported pdf!

Below explains how to get it installed. The steps are taken from the mentioned askubuntu answer.

Ubuntu repos contain the wkhtmltopdf package, but it doesn't provide the hyperlink-preserving-functionality we need. Nevertheless, we need to install it to get the required dependencies.
sudo apt-get install wkhtmltopdf
Then, we can get the wkhtmltopdf static binary from [3], extract it and put it in the /usr/bin directory.
sudo mv wkhtmltopdf-i386 /usr/bin/wkhtmltopdf-static
Now we can convert a web page to pdf preserving the hyperlinks!
wkhtmltopdf-static http://en.wikipedia.org/ wikipedia.pdf
[1] http://askubuntu.com/questions/22065/how-do-i-export-pages-from-browser-with-embedded-hyperlinks
[2] http://code.google.com/p/wkhtmltopdf/
[3] http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltopdf-0.9.9-static-i386.tar.bz2&can=2&q=

Monday, February 4, 2013

Fishing Huts - Maskeliya

2013-01-26 15.27.372013-01-26 15.44.412013-01-26 15.46.582013-01-26 15.51.582013-01-26 17.32.27
2013-01-26 18.43.572013-01-27 06.48.512013-01-27 06.56.38
2013-01-27 07.26.24
2013-01-27 07.28.422013-01-27 07.31.302013-01-27 07.35.382013-01-27 07.44.372013-01-27 08.21.34
Fishing Huts 2013, a set on Flickr.
This is a place I always wanted to visit! Got the chance to do it weekend before last with a gang of nutty friends ;)

This is located in the Peak Wilderness Sanctuary at the edge of the Moray Estate, which is owned by Arpico. Adam's peak is within 2.5 hours hike-distance.

Colombo > Avissawella > Ginigathhena > Norton Bridge > Norton Bridge - Maskeliya road > turn towards Nallathanniya > and turn to Moray estate few kilometers before Nallathnniya.

It's a great place to get relaxed ... just-sit-without-doing-nothing looking at the Baththulu Oya, forest and the mist ... live without electricity and mobile signals ... have a shivering-cold-body-parts-go-numbing bath in the stream ... Trek the  stream in search of waterfalls ... and sing and dance in the light of kerosene lamps!

It was plain awesome!

Lakdasun article contains more info about this place.

Some important warnings though...

1) Start the trip early as possible. Due to the road conditions (see point #2) it takes a lot of time to reach the huts than you imagine. We started around 7.45am from Fort and if my memory serves correct it was passed 3pm when we reached there.

2) The road in Moray estate going up to the huts is not of good quality and a big part of it is made of a winding gravel road. Driving in dark will be very dangerous, also vehicle should have a high ground clearance. Vans will work, but needs to be extra cautious, otherwise there's a high risk of hitting the underside on a stone or something, which happened to us and oil started to leak.

3) Don't depend on Google Maps, there were two roads and it guided us on the worst one. Always ask directions from the locals.

4) Nights can be cold for some.

5) Expect occasional leech attacks ;) Especially when hiking.

Things do go wrong! It is an adventurous trip after all, what else do you expect! :p