Questions tagged [xhtmlrenderer]

XHtmlRenderer (also called Flying Saucer) 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.

Synonym for .

57 questions
3
votes
0 answers

does't apply bootstrap effect on generated PDF file from HTML template using ITextRenderer in Spring boot application

I have designed HTML template using Bootstrap and I am generating PDF file using following code OutputStream outputStream = new FileOutputStream("message.pdf"); ITextRenderer renderer = new ITextRenderer(); …
Ketan Navadiya
  • 279
  • 3
  • 6
  • 18
3
votes
1 answer

Converting JavaScript generated documents/pages to PDF

I'm using xhtmlrenderer + iText in Java to generate PDFs for some pages in my application. I've managed to convert some pages already. However, I came across a limitation to this approach where it can't convert pages dynamically created using…
Psycho Punch
  • 6,418
  • 9
  • 53
  • 86
3
votes
1 answer

xhtmlrenderer xhtml to pdf font problem

I'm using org.xhtmlrenderer.pdf.ITextRenderer to convert my (x)html page to pdf using Java. I've got most of it working, except the font part. I'm using verdana in my page and the pdf is rendered using default font. I have added the verdana.ttf to…
B. T.
  • 111
  • 1
  • 2
  • 5
2
votes
1 answer

Unable to print in correct resolution

I'm trying to print labels using xhtmlrenderer and java printing. However I don't seem to be able to set the resolution correct so the image is printed all edgy. This is my printing code: val paperWidth = 62.0f val paperHeight = 70.0f def…
thoredge
  • 12,237
  • 1
  • 40
  • 55
2
votes
4 answers

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…
usertest
  • 27,132
  • 30
  • 72
  • 94
2
votes
2 answers

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.
usertest
  • 27,132
  • 30
  • 72
  • 94
2
votes
3 answers

XHTML editor wanted!

I need an editor that outputs clean HTML, and preferably strict XHTML with CSS, as I am going to display the resulting pages as help pages in a java application using xhmtlrenderer ("Flying Saucer") which apparently very much prefers XHTML with CSS…
stolsvik
  • 5,253
  • 7
  • 43
  • 52
2
votes
1 answer

Flying Saucer - html entities are not rendered

I'm generating pdf using flying-saucer lib. But I have problem with some html entities. I've already was searching for solution I found many tips in this forum, and in other places but still there is the problem. I've tried this approach…
user3333010
  • 113
  • 2
  • 9
1
vote
1 answer

Putting in "broken image" placeholders with Flying Saucer

I'm using Flying Saucer to generate PDF from HTML (so I'm using ITextRenderer, if that matters.) I would like to simulate something like what Webkit or Gecko put in when the image cannot be found - something like an inset outline and a little broken…
Hakanai
  • 12,010
  • 10
  • 62
  • 132
1
vote
1 answer

How to load external image in FileInputStream

I am working in html to pdf conversion using flying saucer(itextrenderer)...I have to render image..I have rendered the image which was in my local storage(it works fine)..I have to do the same thing with external image.. Here is my code snippet for…
1
vote
1 answer

Thymeleaf: Template not accessible downloading a PDF online with Spring Boot 2.0.3

I'm downloading a PDF file with a web app, developed with Spring Boot 2.0.3 and using Thymeleaf, from an admin section, protected with Spring Security. Locally it works fine, but online I get this…
Aleix Alcover
  • 599
  • 3
  • 11
  • 27
1
vote
2 answers

xhtmlrenderer creating PDFs of length 0

I am new to org.xhtmlrenderer.pdf.ITextRenderer and have this problem: The PDFs that my test servlet streams to my Downloads folder are in fact empty files. The relevant method, streamAndDeleteTheClob, is shown below. The first try block is…
1
vote
1 answer

JTextPane and XHTMLRenderer: When to use which

What are some situations that you would use XHTMLRenderer (flying saucer) over JTextPane with a HTMLDocument and vice versa? Is it mostly a matter of preference or are there certain cases that one is a more natural choice?
brian_d
  • 11,190
  • 5
  • 47
  • 72
1
vote
1 answer

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…
Wienczny
  • 3,958
  • 4
  • 30
  • 35
1
vote
1 answer

Flying Saucer does not render PNG files in PDF

I'm trying to generate a PDF file from XHTML by using the Flying Saucer (9.0.7) library. Texts and tables are rendered as expected but images (PNGs) are not shown in the final PDF. The images are referenced by absolute file paths (e.g.img
rOb
  • 21
  • 4