Questions tagged [xhtmlrenderer]

0

votes
0

answer
2

Views

XHTML to Docx conversion using docx4j not reading font-size style

XHTML: 18F, Mirae Asset CENTER1 West Tower converted document.xml: 18F, Mirae Asset CENTER1 West Tower font-size:8pt; not getting converted to in ooxml. If font-size is given as small,x-large,etc. it gets converted.
Sourav
1

votes
1

answer
305

Views

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 error: org.thymeleaf.exceptions.TemplateInputException: Error resolving template '/email/confirmedbooki...
Aleix Alcover
1

votes
2

answer
1.2k

Views

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: 同名の映画のモデ Without any font settings being added to the HTML this renders fine in normal browsers, but I can't find anyway...
Mark Derricutt
1

votes
1

answer
482

Views

HeadlessException using docx4j xhtmlrenderer on RedHat server

I'm getting a java.awt.HeadlessException when using a Docx4jReplacedElementFactory on a RedHat server. Does anyone know of a workaround for this? (other than running Xvfb) I've drilled in to the stack trace and the source of the problem is java.awt.GraphicsEnvironment.getDefaultScreenDevice(), which...
David Carboni
1

votes
1

answer
1.9k

Views

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 : http://sdtidbits.blogspot.com/2008/11/flying-saucer-xhtml-r...
user3333010
1

votes
2

answer
0

Views

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 definitely not a problem. The server spends a lot of time...
Herb Harrell
1

votes
1

answer
690

Views

content: url('image.png') in flying saucer @page @top-left

does flying saucer support putting images in CSS3 margin-boxes? I tried something like @page { @top-left { content: url('/resources/media/image.png'); } } but this doesn't seem to work. Is there any solution to put the image where I want to?
Kamil Roman
2

votes
1

answer
4.1k

Views

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 my jar and use the following code: DocumentBuilder b...
B. T.
2

votes
3

answer
597

Views

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 2.1. Having searched stackoverflow for HTML editor...
stolsvik
2

votes
4

answer
2.2k

Views

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....
usertest
2

votes
1

answer
1.6k

Views

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 print(printable: Printable) { val printJob = PrinterJob.getPr...
thoredge
23

votes
4

answer
9.4k

Views

With Flying Saucer, how do I generate a pdf with a page number and page total on every page at the footer?

It took me a little more research than I would have liked to figure this out on my own, so I'm going to post a comprehensive answer here. It seems like the information to do this is spread across many different websites and I'd like to put it in one place. This answer may be the same thing, but my...
Daniel Kaplan
3

votes
1

answer
444

Views

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 JavaScript scripts (some by JQuery). Are there other avai...
Psycho Punch
5

votes
2

answer
1.6k

Views

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 wher...
Daniel Stefaniuk
1

votes
2

answer
2.1k

Views

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
4

votes
1

answer
633

Views

How to use CSS3 orphans and widows properties with xhtmlrenderer (flying saucer) R8?

I read in this bugfix description that xhtmlrenderer should support the 'orphans' and 'widows' properties of CSS3 since Version R5. Using R8, it seems not to work. div.textContent { orphans: 5; widows: 3; } But it looks like this: The paragraph (a div block element) is broken into two pieces althoug...
Zeemee
14

votes
3

answer
9.8k

Views

CSS to PDF,the css in Flying Saucer : -fs-table-paginate result in border-collapse:collapse invalid

Now I am using xhtmlrenderer to covert html to PDF. My maven dependcy as follows: org.mvel mvel2 2.1.0.drools2 compile true org.xhtmlrenderer core-renderer R8 compile true com.lowagie itext 2.0.8 compile true I am trying to repeat the table head in every PDF's page.So I use the css : table { -fs-tab...
FishGel
4

votes
2

answer
3.4k

Views

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

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(); re...
pstanton
5

votes
1

answer
10.4k

Views

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 ye...
6

votes
2

answer
8.4k

Views

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 generati...
Stephen
4

votes
3

answer
2.7k

Views

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 im...
Stephen
4

votes
1

answer
2.4k

Views

HTML to PDF result in landscape

I am using PDFSharp to generate PDF from html source. PdfGenerator.GeneratePdf(html, PageSize.A4); Generate to pdf works well, but I dont know how I can change page orientation to landscape?
Marek
2

votes
0

answer
174

Views

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(); renderer.setDocumentFromString(html); renderer.layout(); renderer.createPDF(outputStream); ou...
Ketan Navadiya
8

votes
2

answer
11.9k

Views

Render embedded image in PDF using Flying-Saucer from html

I have an xhtml document that I'm turning into a PDF using flyingsaucer. The xhtml has several tags that have a base64 encoded images inline. The source of the xhtml is dynamic so the structure of where the image tags are can vary. This is a sample of what the tag looks like:
It Grunt
5

votes
2

answer
1.9k

Views

FlyingSaucer LTR/RTL/BiDi issue with arabic text

I'm using flying saucer xhtmlrenderer for building pdf documents. Everything worked fine until now - now we should generate arabic text inside pdf. Xhtmlrenderer is rendering Arabic text in reverse order. I've read somewhere on internet (maybe on their own site) that xhtmlrenderer does not support b...
Askar Kalykov
6

votes
2

answer
4.3k

Views

Resolving protected resources with Flying Saucer (ITextRenderer)

I'm using Flying Saucer to create a pdf from xhtml, hosted on a tomcat server. Most of the images included in the pdf are publicly available (logos and so on), but some of them are protected behind a login (that is, they are streamed through a servlet if the user is logged in). When I paste the url...
ManiSto
3

votes
0

answer
330

Views

Acrobat PDF generated with FlyingSaucer & ITextRenderer seems to be removing links

I have HTML that contains links such as the following: Web : SPLIThttp://www SPLIT.google SPLIT.fr/ We are converting the HTML into a PDF using flying-saucer. I open the PDF that results from the following and the links are not clickable. It seems as if the hrefs are not added. If I remove the SPLI...
Menelaos Bakopoulos