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 ๐Ÿ˜‰

Wiimote experiment

Okay, so I finally got to it. A few months ago I bought a wiimote to play a bit with the api’s floating on the net. It was until yesterday that I actually tried a driver, and since that seemed to work okay, I decided to give it a try myself. My simple goal, being an app plotting the raw inputs. However, it took me a 2 hours more than expected (1 =)) and also a lot more blood, sweat and tears. ๐Ÿ˜‰ particularly because I made a lot of mistakes due to me being too tired ๐Ÿ˜‰ So I will keep it short for now as I want to go to sleep.

I choose the wiiuse library as it seemed adequate for the job and still active (and even cross platform!). I started from the included example and tried to wrap it into a Qt app (hence I named it example-qt ;)). The obvious choice for drawing is using QGraphicsView. However, for once ;), I took the effort to see if there are no existing Qt graph plotting libraries. And this just happens to be the case. ๐Ÿ™‚ Meet the excellent QWT lib. It couldn’t be more fit for the job. The site is (almost) nothing but the api docs, but that seemed sufficient. One second I thought this lib would not be qt4 ready, but it has been ported!

Quite a few seconds and segfaults later ๐Ÿ˜‰ I got this:
wii experiment

Nothing fancy, but it does show the roll and pitch!! =)

Note: the wiimote survived the experiment ๐Ÿ˜‰

Portal on linux

Portal: Prelude triggered me to finally try out Portal under linux / wine. Actually the only games I played since I’m on linux are Urban Terror and … Peggle Extreme. ๐Ÿ™‚ Don’t laugh, it was a Steam test. ๐Ÿ˜‰ And I didn’t have any space to install anything bigger. Until I bought that 0.5TB drive a while ago, still didn’t fill that one up, so today I decided to try it out under opensuse 11.0 with KDE 4.1 and wine 1.1.6. I somehow messed up my steam install under 10.3 and since I got 15GB free on my suse 11 partition and up to date video drivers (since it is also a kde 4 tryout install), this seemed like an ideal environment. Indeed, it actually went very smoothly.

  • install latest wine from build service
  • install iexplore gecko replacement by surfing to an url: wine iexplore http://winehq.org
  • download steam msi (exe no longer needed!) and run: wine start steaminstall.msi
  • see the update fail and resume it manually: nice -n 19 wine Steam.exe or wine steamTmp.exe SelfUpdate “Steam.exe” 14
  • create a desktopshortcut from steam. you have to use kde 4.1 folderview if you actually want to see it ๐Ÿ˜‰
  • run!

Some screenshots to prove ๐Ÿ˜‰


Portal on linux / wine Portal on linux / wine

While framerate seems okay and my savegames and profile seem intact, I did experience some graphical glitch: when looking through portals, sometimes white flicker occurs. I didn’t investigate any further as it’s late enough.