Even more pdf fun on linux

Who says pdf support on linux is weak? ๐Ÿ˜‰ Using free tools only, I can actually do more on linux than on windows.

A friend asked me to adapt a brochure which is in pdf format so that his contact data are filled in at the designated area on the last page. I didn’t have high hopes, as I know pdf editing is clumsy, even on windows using Adobe Acrobat. But I thought I’d give it a google search, and guess what, I stumbled upon pdfedit which seems to be able to do the job quite adequately! The only downside is the speed. I hope they port it to Qt 4 and fix the speed issues while they’re at it. ๐Ÿ˜‰ (and apparently there are some plans!)

pdfedit ftw

Converting multiple images into a pdf on linux

Update 2012-03-13
I don’t know if it was possible back in 2008, but nowadays you can simply use the convert command provided by imagemagick!

convert image1.jpg image2.jpg output.pdf

Normally, when I need to create a PDF, I can print to the PDF printer included with KDE. However, on my suse box, this only seems to work out of the box with KDE apps. Also, since I need to combine multiple images into a pdf, it is a bit cumbersome to use a PDF printer here.

I didn’t find a one-step solution, so here is how I did it:

  1. convert each image to a pdf
  2. merge all pdfs into one pdf file

For the first step I used bmeps, a tool which I recently discovered by accident ๐Ÿ™‚ It is strange, when searching for the tool, I didn’t find it. So that’s why I give it some extra promo on my blog. ๐Ÿ˜‰ Bmeps is a cross platform tool (yes, I already once used it succesfully on windows!). It used to be a (E)PS tool, but since version 2.0 it also supports PDF output (up to PDF version 1.4). As input, it accepts JPEG, netpbm and PNG (and TIFF partially).

As Bmeps doesn’t seem too popular, I wasn’t too surprised to learn my distro doesn’t have any package for it, so I had to build it from source. Bmeps has a dependency on dklibs, a collection from the same author which also needs to be compiled. But it turned out to be a pleasant experience: all prerequisites were already satisfied on my computer (except netpbm, but I don’t need that) and I just had to run the familiar “configure make install” (once for dklibs and once for bmeps of course).

After that, converting an image to a pdf is as simple as:

bmeps image.jpg image.pdf

Now we have a bunch of pdf files, we still need to merge them. For that I chose the quite popular pdftk. It wasn’t installed by default, but there does exist a package in the suse main repositories, so that was easy. Now, to combine all pdfs into one:

pdftk input*.pdf cat output output.pdf

And that’s it!

PS: there used to be a tool png2pdf from the same author for people wanting to convert PNG files, but this has been superseded by bmeps.

Valve complete pack $99

If you’ve never played halflife (2) or day of defeat or counter strike or portal or team fortress (2), then now is the time to buy! All, every single, valve games for just $100?! That’s just.. euhm.. very unhealthy for your night rest. ๐Ÿ™‚ Oh right, their latest game Left for dead is also included ๐Ÿ˜‰

The problem is, once you’ve bought another pack like the orange pack, it’s not worth buying these other packs since you already own half of the games. ๐Ÿ˜‰

long lives my bike!

About half a year ago, I went to work, like every other day, with my nice old bike. However, just when I arrived at work, my outer tire exploded. Okay, maybe that’s a little exagerated, but it did tear.

Now, little did I know it would take me 6 months to get it repaired. If it were just the tire, I would have replaced it myself (although, the current one was already wrong size, so it would be a guessing game to buy the right one), but there was a lot more to it:

  • lights did’t work. also a simple thing, unless your parts are like a century old.
  • the front break handle was broken, plus also the pull string (I don’t have a regular rear break, but torpedo)

Since my employer offers a cheap bike repair service through VELO (subsidized service for students using used parts), I thought I’d give it a try and while they’re at it, why not throw in replacing my rear reflector and fix my flat tire.

However, there was one huge caveat: the bike had to be handed in before 9.30 am! which can be quite a challenge for me ๐Ÿ˜‰ (and also filling in the same papers in 3-fold(?!)) The alternative is to let it stand quasi unguarded and not locked for a night.. but since getting up early isn’t so difficult, why risk ๐Ÿ˜‰

Unfortunately, it took me longer than expected. After all, I do own a car, so I went to work by car. ๐Ÿ™‚ (which is a shame if you know the distance ;))

But this week, slightly helped by a light lumbago, I managed to achieve my goal! ๐Ÿ™‚

Everything repaired! New tire, new front light, new rear light with incorporated reflector (is that legal nowadays?) and fixed wiring, new break. ๐Ÿ™‚ Too bad, it seems not many used parts were used, total price: 42 EUR. I could almost buy a new used bike ๐Ÿ˜‰ but I wouldn’t do that since I’m too attached to my current one. ๐Ÿ˜‰ Still, I think you cannot have it fixed anywhere for that price.

So this evening, I proudly biked home, in the rain ๐Ÿ™‚ It really felt good to ride a bike again ๐Ÿ˜‰

Extract audio from AV container

A while back, I posted a link to a program for splitting off the audio of an FLV file.

The linux equivalent would be to use mplayer, your video swiss army tool ๐Ÿ˜‰

I’ve put it into a convenient KDE (3) service menu entry (copy paste in a file in $HOME/.kde/share/apps/konqueror/servicemenus):

[Desktop Entry]
Encoding=UTF-8
ServiceTypes=video/*
Actions=extractaudio

[Desktop Action extractaudio]
Name=ExtractAudio
Name[en]=Extract audio
Exec=mplayer -dumpaudio %u -dumpfile %u.dump
Icon=sound

Now you should have an action “Extract audio” when you right click on a video file. It should work on all mplayer supported video files.

Boot process explained

It’s always nice to be reminded of the more important things in life, like how computers boot, *ahem* ๐Ÿ™‚
Seriously, as a computer enthousiast, it’s like I _have_ to know about it, yet I don’t seem to be able to remember all the details ๐Ÿ™‚
So guys like duarte chop it into nicely digestable pieces, ideally suited as bed time story material, so it can enter your subconscience when you go to sleep =)

Indie game spotlight: cave story

I accidentally came to know about this great freeware game because it’s getting rereleased as WiiWare by these guys and here is how it happened.
When the game got released back in 2004, TIG was the first to take an English interview with its Japanese author Daisuke รขโ‚ฌล“Pixelรขโ‚ฌย Amaya.

Doukutsu Monotagari aka Cave Story is a 2D non-linear platformer in its most true sense. ๐Ÿ™‚ It makes you feel back in the nineties, the graphics are pixelish and the music and sound effects are so cheesy, but that is all just part of all the fun! I am certainly no hard core platformer but when I started playing this game, I just couldn’t stop until I got defeated by some boss. ๐Ÿ™‚ So I’ve warned you, it’s quite addictive. ๐Ÿ˜‰

cave story

The gameplay is extremely well balanced and there is quite some variation. I don’t know how big the game is, but at the current pace, I’ve seen quite some environment variation and weapon upgrades. It’s quite fun to clear the screen with a rocket launcher at level 3. ๐Ÿ˜€
All in all, it’s quite a polished game, you just gotta love it. ๐Ÿ™‚

Try it yourself:
First, download the binary (hint: he only made 1 game in 2004 ;))
Then patch it with English translation

Btw, it runs fine on wine/linux!

more wii plots

So after all today’s hard work, still some time for a bit wiimote fiddling ๐Ÿ˜‰
I extended my test app to show the raw accelerometer data.


wiimote accelerometer data

A few words about what is which graph and the color coding:
The left graph shows the same as 2 days ago, except, I switched the colors to remember the meaning more easily. ๐Ÿ˜‰ Red is for Roll =) and blue is the pitch. These data are calculated by the wiiuse library.
The right graph shows the raw accelerometer data. It is simply showing the x (red), y (green) and z (blue) component of the acceleration vector.

The experiment here shows 2 rolls to the left (and return), followed by 2 translations to the left. One could argue that a translation to the left, from the accelerometer’s viewpoint, is just the same as a roll, since both are changing the gravitation vector temporarily in a similar way. I’d say there still seems to be a difference.. ๐Ÿ™‚

Paul, I’m open for discussion ๐Ÿ˜‰