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.

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 =)

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.

Optimizing the linux boot process

How fast your linux boots, really depends on your distro and of course it’s their job to have it boot as fast as possible. They try as much as possible scenarios and make sane decisions on where to optimize. But they can’t test every possible configuration, so what if you just end up with a suboptimal situation (possibly without realizing? :)). Even if you know your boot takes too much time, how would you locate the culprit(s)?

This is where Bootchart jumps in. Bootchart is a tool which makes it possible assess resource consumption throughout boot time. It is really simple to set up, just add a kernel param! Data is collected in memory using tmpfs and dumped to disk at the end of the boot process. This data then gets processed by a java app which outputs an SVG/PNG.

It seems the opensuse guys, actually coolo, used this tool to optimize boot performance for opensuse 10.3. I must say I am quite satisfied with my opensuse boot times although I do have the impression that 11.0 seems to be a tad slower than 10.3. So I’m definitely going to try out this tool and compare the results 🙂

Thanks to my brother for the tip.

Part 2

Accidentally, a few hours after writing this post, I ran into this very interesting article about boot speedups presented at the Linux Plumbers Conference last month. (Watch a modified fedora boot in 5 secs on an eeePC)

openSUSE fan

I have these linux habits which are hard to control and recently I discovered a new one while working on my windows box at work.

You know you’re a

  • linux fan when you type ‘ls’ every time you mean ‘dir’
  • KDE/KWin fan when you try moving/resizing windows with the alt+mouse buttons
  • and now, here it comes.. 😉

  • openSUSE fan when you type ‘net suse’ instead of ‘net use’

I needed 3 tries before I got it right! 🙂

openSUSE forum

first thing one does, when getting stuck on a problem with openSUSE is google it up. If nothing turns up, check the bugtracker. No luck? Check the fora. Yes, this is where the pain starts. Until recently, there were, like, 3 fora or something where you had to look up and create an account if you wanted to add a remark, ask a question. They finally combined forces and merged them all and made them even official! That’s great news I believe. Having a single point of access for support questions is really important, even more for early adopters. With openSUSE 11 right around the corner, the timing couldn’t have been any better!

of course, you can always join the #suse IRC channel on freenode if you’re a more chattive type of person 😉

why openSUSE 11

As you might have guessed by the countdown on the right, I’m anxiously awaiting the opensuse 11 release. IMO, the revamped package management system will be THE killer feature. Not only will it have the fastest dependency solver on the planet, by using lzma compression (cfr. 7zip) it will have smaller file sizes yielding even faster installs!

Even though this release will be a .0 release, I will be eagerly upgrading as every time I install new software / patches, I am reminded how fed up I am with 10.3’s package system. This is my only complaint about openSUSE 10.3! They claim it should not be a problem for average users with not much repositories. So now I know: even on linux I’m not a ‘normal’ user. 😉 (which was confirmed by a suse guy @ fosdem looking at my repository list ;))

9 days to go, mmmmm 🙂

Fosdem impression

So, Saturday I went to Fosdem, it was my first open source conference attendance. 🙂 In general, it was quite an experience… To walk around a campus and see geeks and hear programmer’s slang everywhere and that all open source related is really.. unreal. 🙂 It was also fun to recognize quite some people, just because I read all their blogs. 🙂

I kinda got up late, so I missed the talk about linux in Hollywood. Google maps told me that I would get there in 30min so I naively set off to Brussels to get just in time for the next one. Of course I didn’t think of all the traffic lights and lack of parking space there. 😉 I saw a parking on the campus on the satellite, just to realize once there, that it was for VUB personnel only, d’oh. 🙂

First I ‘discovered’ the area, what is where, you get a nice map though, and all rooms were very clearly indicated. Then I went to get a sandwich and was ready for the first talk. 🙂

This was a KDE talk on the upcoming Amarok 2.0. It was interesting but my modest music needs are already amply fullfilled by the current Amarok. 🙂 Then I quickly sneaked into the opensuse room to get the second half of the opensuse 11.0 intro by coolo. It looks promising, as always, but especially the “damn fast” package management system I can’t wait for. 🙂 There wasn’t much detail about that though as there was going to be a talk on that on Sunday. One questionable decision they made for 11.0 is to have the root password be the same as the user password, by default. At first, it doesn’t make sense at all, but if you think about all the sudo’ing and apparently a lot of users choosing the same anyway, you can’t really blame them, although I’m not sure they make it clear enough that this will happen automatically (i.e. is the default), if the user does not choose otherwise in the installer (it is a checkbox which you have to tick off). They made a huge effort to make the installer _even_ simpler (apparently it was still not simple enough), which this password thing was also an attempt at.

Then I went to the second half of the Crystal Space presentation, mainly to see my colleague in action and gaming stuff is always fun. 🙂 It seems he ran a bit out of time which is a pity since I was interested to see more about the Blender / CS project which was touched only briefly.

After that I quickly went off to the KDE room again to get the last bits of the Nepomuk presentation by Sebastian Trueg (he’s also the K3B guy!). I really wanted to see his face as I always mix up the 2 KDE Sebastians 🙂 Nepomuk seems to have a lot potential, but it seems it still needs a lot of time..

At the opensuse stand I tried to explain my font problem to Francis Giannaros (apokryphos) and he tried to solve it by convincing me that the default font size should be 9 instead of 10. 🙂 not sure about that but the next install will tell me. 😉 He also helped out configuring aiglx for kde4, but that didn’t seem to increase performance much after all.

After that I tried to catch the last bits of the build service workshop. It was kind of difficult for Adrian Schroeter to give a nice demo since he had a lot of network trouble on that laptop (or the build service, but that seemed to go quite fine on mine). Btw, I managed to ‘convince’ Adrian to give me an opensuse baseball cap, thanks again! 😉 He’s a really nice guy.

I then went for the last bit of KDE on windows (skipping the suse base presentation as it is recorded anyways 😉 ), no big news there as I am already quite familiar with the project anyway. The room was fully packed btw. After that everyone went off and a few stayed with me for the GGZ presentation. I stayed there mainly because of lack of other interesting presentations. 🙂

I was a bit disappointed to miss the second day as it seemed twice as crammed with interesting presentations although it was already very interesting. 🙂

To finish up, I took a picture of a part of the stands with my cellphone. As you can see, it was quite crowded but still doable. 🙂
Fosdem stands