flying-saucer

What's the easiest way of converting an xhtml string to PDF using Flying Saucer?

I've been using Flying Saucer for a while now with awesome results. I can set a document via uri like so ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(xhtmlUri); Which is nice, as it will resolve all relative css resources etc relative to the given URI. However, I'm now generating the xhtml, and want to render it...

Rendering arbitrary XHTML with JasperReports

We have embedded JasperReports into our application to generate reports, but I've been rather dissatisfied with the way that the JEditorPaneHtmlMarkupProcessor handles writing arbitrary XHTML. For example, I needed to output a bulleted list at one point, which it does, but because it converts it to actual bullet characters and newlines, ...

How to render Asian characters in a PDF using xhtmlrenderer

I was wondering what steps were needed to render Asian characters using the java based xhtmlrenderer (flying saucer) library? I am wanting to render the following: <html> <body>同名の映画のモデ</body> </html> Without any font settings being added to the HTML this renders fine in normal browsers, but I can't find anyway to render this to ...

Is it possible to resolve css as a classpath resource using Flying Saucer (XHTML-Renderer)?

I'm trying to package up resources into a jar, but I'm having trouble getting Flying Saucer to find the css on the classpath - I can't construct a URL easily to be able to resolve this seamlessly. Does Flying saucer have a way of specifying resource packages on the classpath to resolve items and images? Note: I'm running this in a web...

Relative paths in Flying Saucer XHTML?

I am using Flying Saucer to render some PDF documents from strings to XHTML. My code is something like: iTextRenderer.setDocument(documentGenerator.generate(xhtmlDocumentAsString)); iTextRenderer.layout(); iTextRenderer.createPDF(outputStream); What I'm trying to understand is, when using this method, where are relative paths in the X...

.NET version or port of Flying Saucer

Is there any open source .NET project (or port) similar to the Flying Saucer project which renders HTML to PDF using iText? ...

Using IKVM to convert a JAR (Flying Saucer - xhtmlrenderer)

I wanted to use the Flying Saucer Java API in .NET so I tried to use IKVM to convert the Flying Saucer library: ikvmc core-renderer.jar For some reason, IKVMC gave me an exe core-renderer.exe so I renamed it to core-renderer.dll, added to my assemblies and hacked away using java.io; using java.lang; using com.lowagie.text; using org....

Flying Saucer not reading stylesheet

I am using flyingsaucer together with iText in an asp.net application(using IKVM) to convert HTML into PDF's. If I put a style directly in the html it works fine (even styles put between style tags) but when I link a style sheet it fails to notice it and produces the pdf without the styles. Any reason why this is happening? This is the...

Bookmarks with xhtmlrenderer (iText)

I'm using xhtmlrenderer (Also known as Flying Saucer) with iText to convert HTML to PDF. How would I create bookmarks with this? Does someone with have a small example? Thanks in advance. ...

flying saucer (xhtmlrenderer) doesn't bold my font?

Hi all, I'm using a custom truetype font in a pdf generated by flying saucer xhtmlrenderer. ITextRenderer renderer = new ITextRenderer(); renderer.getFontResolver().addFont("myfont.ttf", BaseFont.CP1252, BaseFont.EMBEDDED); renderer.setDocument(XMLResource.load(in).getDocument(), url); renderer.layout(); renderer.createPDF(out); and ...

Using an ampersand in flying saucer

I get the error below when converting to PDF with flying saucer. I've removed the ampersand charector and it worked, so this seems to be the problem. How do I include ampersand's in my PDF documents? Thanks in advance. ERROR: 'The entity name must immediately follow the '&' in the entity reference.' ...

Change flying saucer header

Is it possible to change the header of a pdf page to the same name as the currently selected bookmark? I'm using flying saucer for my pdf generation. Could you include an example? Thanks in advance. ...

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 wrong? java.lang.OutOfMemoryError: Java heap space at com.sun.org.apache.xerces.internal.util.XMLStr...

flying saucer (xhtmlrenderer) requests image 4 times

in my xhtml i have the following: ... <img src="myImage.jpg" /> ... and I render like so: ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(XMLResource.load(in).getDocument(), url); renderer.layout(); renderer.createPDF(out); the resulting PDF is as expected, however I notice that the image (which is included only ...

Problem generating pdfs with acts_as_flying_saucer

hi all. I'm using the rails plugin acts_as_flying_saucer to generate a pdf, but the pdf doesn't work: i can save it ok, but when i try to open it i get this error message: Unable to open document File type SOR File (text/plain) is not supported Here's my set up. I'm using rails 2.3.4 and the latest version of the acts_as_flying_sau...

PDF generation with Flying Saucer: Specifying a fallback font for unknown glyphs?

Our web application generates PDF files from HTML pages on the fly, using the Flying Saucer/xhtmlrenderer library. Unfortunately, the source text may contain certain unicode characters (the cyrillic alphabet, for example) which are not included in the font we use for this. Changing to another font is not an option because of corporate de...

content not allowed in prolog from document created by DOM when printing using flying saucer

I'm trying to print some text using my flying saucer (https://xhtmlrenderer.dev.java.net). The document is generated using DOM-API but when the print starts there is a 'content not allowed in prolog' exception. What is the reason for this exception? My code is this: DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory...

Java XHTMLRenderer print margin

I'm trying to use xhtmlprinter (flying saucer) to print the html part of a email. It almost works but on the page the imageable area of the paper is not used so the contents are clipped. Im using this code, which is modeled after the XHTMLPrintable in the simple package, to print the page. Graphics2D g2 = (Graphics2D) g; if (g2r == nu...

How to create TOC or index using the Flying Saucer project?

I convert HTML files to PDF format using The Flying Saucer Project. This are documents containing repetitive information - premises and their addresses, let's call them elements. At the end of a document I need to create an index. Each index entry should have a page number referring to the page where element was added. The number of elem...

How to convert url of html page to pdf in java using iText & flying saucer?

I've just downloaded xhtmlrenderer and iText jar files. I can make pdf files by using these jars. What I exactly want is: I need to create pdf if I give one valid URL (say "https://xhtmlrenderer.dev.java.net/news.html") in the place of "inputFile". Is it possible with flying saucer and iText? If yes, please guide me to achieve this. ...