Flying Saucer (also called XHTML renderer) is a pure Java library for rendering XML, XHTML, and CSS 2.1 content.
Flying Saucer (also known as xhtmlrenderer) takes XML or XHTML and applies CSS 2.1-compliant stylesheets to it, in order to render to PDF (via iText), images, and on-screen using Swing or SWT. The library implements (basically) the entirety of CSS 2.1 and aims to be fully compliant with the W3C specification; it includes a small handful of CSS 3 features.
Features:
- 100% Java XML+CSS layout engine with native PDF, Swing, image rendering.
- Strong support for the CSS 2.1 specification including extensions to better support paged media.
- Good performance.
- Support for XHTML including forms.
- Arbitrary elements may be replaced with custom content.
- Limited support for dynamic effects (for example, the :hover pseudo-class and links)
- Some support for PDF specific features (for example, bookmarks and internal links).
Limitations:
- Resource loading is single threaded and occurs inline with layout.
- Support for XHTML is weaker than XML+CSS (for example, not all XHTML presentational attributes are supported nor are X/HTML features like the element).
- No support for legacy HTML (although there are several open source Java HTML cleaners of varying quality available).
- No support for incremental layout (applies to screen media only).
Useful Links:
Synonyms: flying-saucer and xhtmlrenderer