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
0 answers

xhtmlrenderer optimizations :css taking too much time

I'm using flying saucer xhtmlrenderer to generate pdf from xhtml. The issues i'm facing with it is that xhtmlrenderer is taking too much time to generate pdf when css files are large or there is too much css. I tried to generate pdf with and…
0
votes
1 answer

Generate multi lingual PDF with Flying Saurce?

I generate pdf from xhtml file but font style is differs with XMHTL. Here is Java Code ITextRenderer renderer = new ITextRenderer(); renderer.getFontResolver().addFont("C:/Windows/Fonts/times.TTF", BaseFont.IDENTITY_H,…
sonas sonas
  • 197
  • 1
  • 5
  • 15
0
votes
1 answer

Convert jsp to PDF using flying saucer

I have a jsp file which I like to convert it to PDF using flying saucer. Here is the jsp file: <%@page contentType="text/html" pageEncoding="UTF-8" isELIgnored="false"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib…
vikifor
  • 3,426
  • 4
  • 45
  • 75
0
votes
1 answer

PDF Generation having multi-lingual text using Flying Saucer

I am trying to print Arabic and English text in PDF using Flying Saucer library. Here's my code : String inputFile = "D:/test.xhtml"; String url = new File(inputFile).toURI().toURL().toString(); String outputFile = "D:/doc.pdf"; …
aanchal
  • 33
  • 1
  • 12
0
votes
1 answer

Connection timed out while generating pdf from html string

I am using org.xhtmlrenderer flying-saucer-pdf-itext5 9.0.4 to convert my HTML string to PDF. try { …
Anurag Tripathi
  • 1,208
  • 1
  • 12
  • 31
0
votes
1 answer

Can't change bold text color, a 'black border' remains

When I change the color of the text I get the following result: What is creating this black border? This problem occurs when I'm generating a PDF using flying saucer, with an embedded font, and try to change the color on h1, h2, etc. If I dump…
expez
  • 289
  • 2
  • 6
0
votes
1 answer

Generating PDF from a third-party HTML on java

I'm trying to generate a PDF version of a third-party HTML (actually it is an HTM file). This HTML may change in future and I have absolutely no control over it. All I wanna do is convert it to a PDF. I already tried 2 solutions: iText (with…
Renato Souza
  • 123
  • 5
0
votes
0 answers

graph from html looking distorted when converting to pdf using itext

I am trying to convert html to pdf using itext Api but the issue is that my html has an element as well. so when I see the generated pdf the graph i.e in element looks distorted. my code in paint method is as below @Override public void…
samir
  • 339
  • 6
  • 19
0
votes
0 answers

PdfStamper not working in IE, or Adobe, but works in Chrome and FF

So Weird, I am generating a PDF using FlyingSaucer, then adding a footer to the PDF. The footer works in Chrome and FF, but not IE. But if I download the PDF, even from Chrome, where the text is there, open it locally with Adobe, it is not... I…
mmaceachran
  • 3,178
  • 7
  • 53
  • 102
0
votes
1 answer

Java String.split() and compare

Im working with flying saucer and want to export an xhtml to an pdf. Everything works fine, but now I want to add an empty column, for example for descriptions or something. I want to create a method addColumn(). which should add in every row of…
Philipp Schemel
  • 943
  • 8
  • 19
0
votes
1 answer

Java Screenshot of multiple webpages

i'm not going to post any code here because i don't know how to start doing it. Actually I need your help... I am working with java (using netbeans, btw) and I have a database with multiple urls in a table (MySQL), and i want to get a screenshot of…
0
votes
1 answer

Paginating XHTML to PNG image files using Flying Saucer

I'm using Flying Saucer to create PNG image files from XHTML. I then use another facility to collect these into a PDF, along with a bunch of other text n images. While I could convert our PDF export processing to iText, that would be a rather large…
0
votes
0 answers

Flying saucer ignoring css

I have trouble displaying my xml file with the attached CSS. Below is my java code package mainPackage; import com.lowagie.text.DocumentException; import org.xhtmlrenderer.pdf.ITextRenderer; import java.io.File; import…
0
votes
1 answer

Flying Saucer Font-Weight not Displaying

I've just started using Flying Saucer to display html reports that will be populated by a solution I am creating. Essentially, I am trying to get Flying Saucer's XHTMLPanel to display bold, but so far have been unable. I have tried using
Rudi Kershaw
  • 12,332
  • 7
  • 52
  • 77
0
votes
1 answer

How do I send an flyingsaucer generated pdf to printer?

I've had success creating pdf using flyingsaucer in java. But I'd like instead of saving the pdf in hard disk, send the pdf straight to printer. Or is it job done by another library.
Maposa Takalani
  • 338
  • 1
  • 5
  • 17
1 2 3
26
27