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
7
votes
2 answers

OpenHTMLToPDF: Embed a custom font into PDF created out of HTML

I create a PDF from HTML with Jsoup and OpenHTMLToPDF. I have to use a different font in my PDF to have non-latin glyphcs covered (see here). How can I embed my font correctly? Simplified program reproducing the…
Paflow
  • 2,030
  • 3
  • 30
  • 50
4
votes
1 answer

how to discrard base uri when using withHTMLContent openHTmlToPDF

I am using openHTMLtoPDF to convert my HTML to PDF. I have given full path to my images therefore , I don't want teh library to use a base path. Ex: path of my image is: C:\Users\hmt\Desktop\pdf\email_icon.png PdfRendererBuilder builder = new…
HMT
  • 2,093
  • 1
  • 19
  • 51
4
votes
1 answer

openhtmltopdf / flying saucer: many links in huge PDF are not clickable (PDF annotations not set)

I generate huge catalogs (~ 1500 pages) as HTML and convert is via Jsoup to and openhtmltopdf (which uses flying saucer) to PDF. In the resulting PDF many links are not clickable, and I can't find out why. Consider the following program: import…
Paflow
  • 2,030
  • 3
  • 30
  • 50
3
votes
0 answers

OpenHTMLtoPDF Shows Charachters As #

I'm using OpenHTMLToPDF to get PDF of HTML but I got # character in my pdf instead of actual characters. I'm using DejavuSans font and I passed to code like this: try (InputStream is = pdfTtfFile.getInputStream()) { …
İlkay Gunel
  • 712
  • 2
  • 11
  • 24
3
votes
1 answer

Html to Pdf with german alphabet

I'm using openhtmltopdf to transform html to pdf. Currently I'm getting an exception if the html contains german characters, like for example ä,ö,ü. PdfRendererBuilder builder = new PdfRendererBuilder(); builder.useFastMode(); …
Neo
  • 1,337
  • 4
  • 21
  • 50
3
votes
1 answer

OpenHtmlToPdf Access is denied with ASP.NET

In my ASP.NET application (.NET Framework 4.7) I'm using OpenHtmlToPdf for creating PDF based on the pages in the website. It is working locally but not in the server production: I have the following error: Exception type:…
Enrico
  • 3,592
  • 6
  • 45
  • 102
3
votes
2 answers

Unicode character Issue - openhtmltopdf library

I use openhtmltopdf library (version: 0.0.1-RC15). I have a problem with unicode characters. In PDF file I see "#" symbols instead of "ă" and "ș". How I can fix it? Thank you.
Taras Melnyk
  • 3,057
  • 3
  • 38
  • 34
2
votes
3 answers

Html to PDF generation with Java

In our project, we have a task to generate PDF from HTML content. For that, we tried to use flying saucer and openhtmltoppdf, however, the HTML content that we are trying to generate contains CSS3 syntax, and seems that both of these libraries have…
2
votes
0 answers

Add Header image and Footer image to a pdf in PDFBox

I am able to generate pdf from my HTML string which I am fetching from Dataabse using openhtmltopdf-pdfbox library in my spring boot project. I would like to add image in header and footer section when the pdf is generated for every page. Step 1:…
swapnil skate
  • 83
  • 1
  • 9
2
votes
2 answers

OGNL Exception using Thymeleaf

I'm trying to use a list of enum in thymeleaf and i'm facing a OGNL Exception problem each time i attempt to get attribute of the enum Using basic loop like this
  • Gauthier
    • 61
    • 4
  • 2
    votes
    0 answers

    How to add page number on OpenHtmlToPdf on every page?

    I am using nuget "OpenHtmlToPdf" version="1.12.0.0" on .net c# api project. This project is based on OpenHtmlToPdf however I am not sure how we can add page number at bottom of each generate page. Below are the only code I found on github page. var…
    Kaushik Thanki
    • 3,334
    • 3
    • 23
    • 50
    2
    votes
    0 answers

    How can I change the html encoding to render the pdf correctly with openhtmltopdf?

    I am using the code: https://github.com/danfickle/openhtmltopdf Did everything according to the example from here (created a maven project, created a main-class): https://www.netjstech.com/2021/02/convert-html-to-pdf-java-Openhtmltopdf-PDFBox.html I…
    Ekz0
    • 63
    • 1
    • 8
    2
    votes
    1 answer

    @page bottom-centre CSS property doesn't repeat for each page when used with running element

    I'm trying to create a footer for my PDF file generated with HTML. I'm able to create a header that repeats for each page. Strangely enough, when I use the exact same technique to implement the footer, only the last page of the PDF has the footer.…
    Gnut
    • 541
    • 1
    • 5
    • 19
    2
    votes
    1 answer

    How to parse Html String In To Word docs In c#

    I have an html string, which I have parsed into PDF using OpenHtmlToPdf library and it's working properly. Now I want to parse same html string into Word document and i used HtmlToOpenXml library but the issue is format comes out in word document is…
    2
    votes
    1 answer

    OpenHTMLtoPDF Custom Page Size

    I am trying to set a custom page size with OpenHTMLtoPDF. I am trying to convert an HTML source to a 58mm x 110mm thermal paper print job, however, I got stuck on this. I have tried setting the page size directly like so: var pdf =…
    Marcello B.
    • 4,177
    • 11
    • 45
    • 65
    1
    2 3 4 5