Printing web pages

19. November, 2010

Today, I tried to create a CSS file so readers of my stories can get a nice looking printout. Or so I thought.

The cast: Opera 10, Chrome 7, Firefox 4, Konqueror.

The task: Print plain text, two column, 2.5cm left margin.

Opera

Opera has one of the best print drivers for HTML. No other browser comes even close. But no support for column-count.

Chrome 7

Webkit does support column-count but not the official CSS3 style. You need a special attribute called -webkit-column-count. Cool.

What’s way less cool is the fact that the printer driver doesn’t support it. You can see it, but you can’t get it, baby.

Firefox 4

With -moz-column-count, you get two columns which make it into the printed page … but what is that huge left margin doing there? That looks like I get only 70% of the page for my text! There are three menus where I can “Setup page” but none of the dialogs behind them allows me to modify the huge print margins! What gives?

Konqueror

You’re kidding, right?

With the Webkit module, the print output looks mostly the same as in Chrome. With the KHTML module, I can’t even get two-column text.

Conclusion

The WWW was invented 1991. That was twenty years ago. Two decades. And web browsers still can’t get something right that bored TeX in 1984.


Printing Big Stuff On Linux

22. June, 2009

During the weekend, I tried to print my family tree. It was pretty simple to generate with GenealogyJ but frankly, the family tree view sucks. I was constantly shifting my “root” node to be able to see the parts I was interested in, etc. And printing this sucks even more. GJ will use lots of paper, printing huge empty boxes with lots of space around them. If I reduced the size of the parts which I don’t need, the layout fell apart. In short, I needed something better.

Graphviz to the rescue. A small Python program (100 lines) read the GED file and turned it into a graph with the layout of the persons just the way I wanted them to be. dot thought about the graph for a few seconds until it emitted a nice SVG which I could then print. Or so I thought.

I opened Inkscape and clicked on print. Yeah … that looks like the document … or rather a small part of it. Where is the poster print option? Ah, there is none. Great. Export as PNG with … oh … 150 DPI. Starting GIMP. No poster printing either. lpr tries to scale the image by .114537 which results in a 87 MB file. You gotta be kidding! kprinter? Nope … unless the command poster can be found.

A word of warning: The poster for openSUSE 11.1 (which you get with zypper) is broken. I tried it with both PostScript and Encapsulated PostScript and both resulting files were unusable in GhostView, GhostScript and Okular. Use this one instead.

After installing psutils, I could rotate the file to fit better on the page, too.

Conclusion: Most programs on Linux create PostScript files but printing them is still something for the command line. The recent print dialogs all look somewhat similar (but are different in tiny, annoying ways), each version is missing some important detail and most of them fail to simply print an oversized image on a single piece of paper or spread it over several. That Inkscape spits out an empty page after the document is just a minor issue.

What’s worse: The print preview either doesn’t work or doesn’t exist, printing to file is not implemented either or isn’t persistent. In the whole process, I ruined roughly 50 sheets of paper. *sigh*

In the end, I had a process which involved six different programs (GenealogyJ, Python, graphviz, Inkscape, pstops, poster) just for this standard task. Printing on Linux has some way to go, yet. On the positive side, I could script all these tasks and I could do it.