Questions tagged [flying-saucer]

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: and

402 questions
0
votes
1 answer

flying saucer (xhtmlrenderer) out of memory

I'm trying to use flying saucer to create a very large PDF and it seems to be running out of memory. below are a couple of stack traces which suggest to me that flying saucer is not completely scalable... or am i doing something…
pstanton
  • 35,033
  • 24
  • 126
  • 168
0
votes
0 answers

@font-face rendering in existing PDF

I have below HTML: String css = "@font-face {" + "font-family: myFont;" + "src: url(fonts/COMICATE.TTF);" + "-fs-pdf-font-embed: embed;" + "-fs-pdf-font-encoding: Identity-H;" + "}" +…
Nitesh Virani
  • 1,688
  • 4
  • 25
  • 41
0
votes
1 answer

Flying Saucer - Can not caught IOException getting Stream Closed

I am provoking a CSS file load error for internal porpuses, to see if it handles a problem like this. The code that I have is this, and when it arrives at renderer.setDocument(), a method from ITextRenderer class, it throws an uncaughtable…
0
votes
0 answers

Issue in converting HTML to PDF containing
 tag with Flying Saucer and ITEXT

I am using Flying Saucer library to convert html to pdf. It is working fine with the all the HTML files. But for some HTML files which include some tags in pre tag, generated PDF file has tags displayed. If I remove pre tags then the formatting of…
0
votes
1 answer

flying saucer PDF generation with Image will it work on linux server?

I'm able to generate the pdf with images using custom implementation of RelacementElementFactory from xhtml template using Freemarker. But I got an error when my system screen was off, hence pdf didn't generated. Caused by:…
0
votes
1 answer

Itext / Flying saucer doesn't convert xhtml to PDF with CJK extension B characters

I am trying to convert xhtml to PDF using itext or flying saucer. XHTML file generally contains CJK extension B (Japanese) characters. PDF file shows all English characters but displaying blank instead of CJK extension B (Japanese) characters.
0
votes
1 answer

Flying Saucer Batik and running footers dont work together?

Ive got a challenge for you guys. Im trying to create an xhtml doc with footer with an SVG image in it and then render it as pdf. I use a combination of Flying Saucer and Batik to do this. Now I learned that Flying Saucer supports running footers,…
Daxterwous
  • 299
  • 1
  • 3
  • 14
0
votes
2 answers

ITextRenderer.setDocumentFromString(html) is causing javax.xml.transform.TransformerException

I am transforming some HTML with JSoup. After the final HTML is produced I want to render it into pdf file. For that I am using Flying saucer libraries. Html example I am trying to render:
Ondrej Tokar
  • 4,898
  • 8
  • 53
  • 103
0
votes
1 answer

Internal styles are not applying after generating PDF using ITextRenderer

I'm using ITextRenderer to generate pdf in my application by loading a html file with internal styles. My HTML page is like this: