Questions tagged [openhtmltopdf]

This tag is to be used when asking questions about the openhtmltopdf Java library to convert an HTML to PDF.

This tag is to be used when asking questions about the openhtmltopdf Java library to convert an HTML to PDF. Check the wiki for more info.

72 questions
1
vote
1 answer

Save OpenHTMLtoPDF Content to PDF file

I have this PDF file that I have generated with OpenHTMLtoPDF. string html = "

TEST

"; var pdf = Pdf.From(html).OfSize(size); byte[] content = pdf.Content(); However, I cannot figure out how to save it to the disk.…
Marcello B.
  • 4,177
  • 11
  • 45
  • 65
1
vote
1 answer

Svg image is not displayed on PDF file

I'm using 0.0.1-RC14 openhtmltopdf version for generating PDF files from html. I have svg image on my html template. This is a snippet of my code: PdfRendererBuilder builder = new…
Taras Melnyk
  • 3,057
  • 3
  • 38
  • 34
0
votes
0 answers

Kotlin OpenHtmlToPdf issue with special characters

I'm trying to convert html to pdf using the open-html-to-pdf library, but I'm having issues with special characters. Instead of ěščř, only #š## is displayed. From this issue I understand I need to somehow register a proper font, yet I am left…
0
votes
0 answers

Convert very big html file into pdf with CSS properly rendered efficiently in short time

I have to generate configurable reports in pdf format with java. I have velocity template which has the CSS formatting of report and place holders for actual data. Velocity is processing the data very efficiently even when data set multiple…
Umair
  • 81
  • 1
  • 1
  • 8
0
votes
0 answers

Generate PDF from very large complex html page in java

I am trying to look for a way to generate PDF for a very large complex HTML page(almost 500 PDF pages) that was created using angular 13 view but I am not able to find any proper solution. I tried many Java based Libraries like Openhtmltopdf,…
0
votes
0 answers

openhtmltopdf : empty spaces added to the table rows when i use noto sans fonts

I have a very big HTML table in which i have some Hebrew content. I want to generate pdf out of this HTML table using openhtmltopdf library. To fit this big table in A4 size, i am scaling the table and then tries to generate the pdf. The problem…
0
votes
1 answer

How to use custom font using openHtmlToPdf?

I am developing a microservice in springboot to generate pdf by using freeMarker and openHtmlToPdf libraries. I want to introduce custom font(tamil language). But in only getting #### as output. Not sure where I am going wrong. Method converting…
0
votes
0 answers

Calculated rendered height of html document in 'openhtmltopdf' a bit off when more than one page

I am using openhtmltopdf (1.0.10) to get a PDF printout to be printed by thermal printers (with roll paper). I have not set any CSS width or height values to any of the HTML elements, instead I am setting the PdfRendererBuilder#useDefaultPageSize…
Pejman
  • 3,784
  • 4
  • 24
  • 33
0
votes
1 answer

Freemarker-An invalid XML character (Unicode: 0xb) was found in the element content of the document

I'm using freemarker in Prints. Sometimes I'm getting an invalid XML character code error. I'm can not control what data is coming from API JSON.IN JSON I'm getting data like this format {"key":"HMA \u2013AZACITIDINE"}
0
votes
1 answer

OpenPDF with html

I need help for converting html content to a pdf. I am currently using OpenPDF 1.3.30 to generate my pdf file in Java. I have a vue component that uses Vue Editor which is a rich text editor wrapper for Vue from Quill. Currently I am sending the…
0
votes
0 answers

How to convert multiple html string to multiple pdf using openhtmltopdf library

I have a Hashmap as a source of data and I'm generating a separate pdf for each key. But when the hashmap length is greater than 2 I'm getting only the 2nd pdf. 2nd one overrides the 1st pdf.(I'm storing HTML in the body key as you can see in the…
0
votes
0 answers

How to convert html (including css) file to pdf in java

I am writing java program that takes html (including css) file and converts it to pdf file. The problem is that my html file is not validated means, there is some tags which are not closed, and other small errors. I tried almost all java libraries,…
0
votes
1 answer

Thymeleaf th:replace using variable path

I'm trying to create a dynamic pdf using Thymeleaf and OpenHtmlToPdf. Each part of the pdf is in a different template. These templates are included or not and the order can be modified. I'm using a java enum that looks like this public enum…
Gauthier
  • 61
  • 4
0
votes
0 answers

How to convert html to pdf in API

I want to generate pdf from API Side. I already created html files. Can someone explain me how to convert html to pdf?
0
votes
1 answer

OpenHtmlToPdf: Problem with external images

I am using OpenHtmlToPdf for converting some html-files to PDF inside a java-based server-application. The server-application does not have access to the internet (blocked by a firewall). When trying to convert a html file-with external references…
Martin
  • 1