Flying Saucer & HTML 5 elements

1,497 views
Skip to first unread message

Christophe Marchand

unread,
May 25, 2020, 8:58:16 AM5/25/20
to Flying Saucer Users
Hello,

coming back to flying saucer after maybe 7 years, I have questions about W3C recent specs in Flying Saucer.
  • Are new HTML5 elements (section, header, main, footer, article, ...) supported in last release of FS ?
  • Are there some new CSS properties supported, such as flex alignment, gradients, and so on ?
Best regards,
Christophe

Peter Brant

unread,
May 26, 2020, 9:19:53 AM5/26/20
to flying-sa...@googlegroups.com
Hi Christophe,

Nice to hear from you!

Flying Saucer is about the same as you left it. There has been some new contributed work, but mostly bug fixes. I still do and will continue to do releases every few months with contributed fixes as folks need them, but the original core contributor group is no longer active.

I don't think this all too likely to change unfortunately. A bunch of the heavy lifting (tables, floats, positioning, PDF output) was sponsored by my employer and we're moving away from Flying Saucer (although this likely won't be complete for a couple of years).

I don't know anything about it, but there is a more up-to-date fork of FS here https://github.com/danfickle/openhtmltopdf . It looks like it has a number of improvements, but from a quick glance, it doesn't support more modern CSS layout features like flexbox or grid either.

Regards,

Peter









--
You received this message because you are subscribed to the Google Groups "Flying Saucer Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flying-saucer-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flying-saucer-users/a206b5aa-d498-4e83-bbbc-b76ecf0bf848%40googlegroups.com.

Christophe Marchand

unread,
May 26, 2020, 2:50:45 PM5/26/20
to flying-sa...@googlegroups.com
Ok, thanks a lot, Peter, for these informations. I've seen the fork, but I'm not convinced... I know Flying Saucer, I like it, so I'm gonna use it !
My source document is a slide show for courses, encoded in JSON, so I have to translate it in XHTML. Producing a flavour or another  of HTML doesn't matter.
To which solution are you moving to, after FS ? I have a lot of publishing works to do, and look for the right tool / language...

Best,
Christophe

Peter Brant

unread,
Jun 22, 2020, 9:32:51 AM6/22/20
to flying-sa...@googlegroups.com
Hi Christophe,

Sorry I overlooked your question. I'm afraid I would have missed it entirely except for a reminder from another FS user.

We realized that we didn't need the full generality of a CSS/HTML implementation. The PDFs that we generate are all pretty unexciting (think tax forms -- tables/grids, borders, basic text formatting, occasional solid color backgrounds). I ended up writing a small library on top of PDFBox that provides just the layout functionality we need. The layout model is basically consistent with CSS, but greatly simplified (normal flow only, no floats or positioning, much simpler inline layout model, fixed layout tables only, etc.). Total line count is 4.6 kloc with another 2.6 kloc of tests. It's written in functionally pure Scala using ZIO (currently) for effect management. Input is a data structure constructed in Scala. Conceptually it's sort of a functional Scala version of iText where the programming API is a little like the VDOM construction APIs in something like Elm or PureScript.

It's been working great for us, but it's also very, very specific to our specific needs and our overall programming environment (which, in turn, is also something we're very happy with, but is undeniably a bit out of the ordinary).

My employers are quite open source friendly though so I've underestimated the interest in a library like this, I think this is something we could talk about internally. I have to admit I figured it was "weird" enough that there wouldn't be any interest.

Peter







Reply all
Reply to author
Forward
0 new messages