Search |
||
Flying Saucer Comes Through with Flying Colors, or the Triumph of InfrastructurePosted by cayhorstmann on August 18, 2007 at 2:30 PM PDT
Say No To PowerpointI loathe authoring with Powerpoint (or its OpenOffice equivalent). Putting together a presentation requires a horrid amount of mouse clicking and fussing with fonts and formatting. Instead, I use the amazing HTML Slidy. You write your slides in XHTML (I use XMLMind, but any web editor that produces XHTML will do.) Then you add links to the Slidy style sheet and JavaScript magic, and you have a great slide show. This isn't something that Aunt Tilly would do, but I already know XHTML and a bit of CSS, so authoring becomes very, very fast. I dash off a few h1, ul, and img, and I am done. Your Mission, Should You Choose to Accept It
I forged ahead with this recipe:
It worked, but the image quality was rather poor.
There had to be a better way. My mission was to find one. I considered using JEditorPane, but I had not been happy with it in the past. It has a lot of quirks and doesn't seem very actively maintained. Then I happened to spot Flying Saucer. Flying Saucer
I loaded a slide sample into the Flying Saucer viewer application. Impressively enough, all of the CSS was correctly interpreted. Make that “almost all of the CSS”. A bug with image scaling was a showstopper, but I sent a message to the mailing list, and a patch materialized within hours. Flying Saucer comes with command-line utilities to generate PDF or images, but there was nothing to produce an image per page. In a day, I hacked together a simple program for this purpose, by copying the pagination code from the PDF generator and the image rendering code from the image generator. I don't understand all the mumbo-jumbo with devices and contexts, but it works perfectly. Here is a slide sample:
If you ever need to render images or PDF with lots of text and a fairly rigid structure, give Flying Saucer a try. Infrastructure
In contrast, open standards and open source enabled me to leverage a huge infrastructure. When I submit a bug report about CSS, there was no arguing about the expected behavior, but the bug simply got fixed. (Try that with Powerpoint!) There are lots of tools that produce or consume XML+CSS. The Flying Saucer people integrate the iText stuff; I take the Flying Saucer stuff and solve my problem in a day. It's all open source and there is very little friction. It isn't something that I think about very much, just like I don't usually spend a lot of time thinking about the physical infrastructure that surrounds us. As long as it works, it is invisible. For this reason, I am somewhat reluctant to embrace the Ianguage du jour. If I switch to Ruby or Python, I have a different infrastructure. How good is it? For example, how do I render XHTML into PDF? Is it like moving from the United States to Mexico? Fun at first, but then the bad plumbing gets to you? Maybe the JVM will become a part of the infrastructure, and in ten years, I'll call Flying Saucer from JRuby or, more likely, Scala. »
Related Topics >>
J2SE Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|