Questions tagged [html-renderer]

Use this tag for questions about the HTML Renderer family of libraries that allow conversion from HTML to other formats (HTML Renderer for WinForms/for WPF/for Mono/for PDF using PdfSharp).

HTML Renderer is a family of libraries that allow conversion from HTML to other formats. There are:

  • HTML Renderer for WinForms
  • HTML Renderer for WPF
  • HTML Renderer for Mono
  • HTML Renderer for PDF using PdfSharp
  • HTML Renderer Core

Project on GitHub: https://github.com/ArthurHub/HTML-Renderer

38 questions
32
votes
1 answer

Convert HTML to PDF using HtmlRenderer

I am looking to use HtmlRenderer to convert an HTML file to a PDF file. I have seen it being mentioned on several sites that it is possible. However, I don't seem to be able to find any basic sample code to do this. I have added the following NuGet…
slayernoah
  • 4,382
  • 11
  • 42
  • 73
18
votes
5 answers

HTML to PDF - page break with HtmlRenderer

I try to convert HTML to PDF using HtmlRenderer. This is part of code: private byte[] CreateHtmlContent() { string htmlContent = File.ReadAllText(@"htmlExample.txt"); using (MemoryStream ms = new MemoryStream()) { PdfDocument…
kiriz
  • 655
  • 1
  • 7
  • 24
8
votes
1 answer

Create PDF from HTML snippet using PdfSharp having external CSS classes included in the HTML

I would like to know if there is any way by which I can Create PDF from HTML snippet using PdfSharp having external CSS classes included in the HTML. I have found a way to generate a pdf file using HTML content but my css classes are not getting…
Arti
  • 2,993
  • 11
  • 68
  • 121
5
votes
4 answers

Create PDF from HTML using TheArtOfDev.HtmlRenderer.PdfSharp

I need to convert a well-formatted HTML string to a PDF document. I found this DLL that should do what I need, but it isn't working fine on formatting. That's the HTML code I'm trying to convert, and viewing it on browser works fine (I've used…
Michele Ietri
  • 184
  • 1
  • 4
  • 16
4
votes
4 answers

Images don't display in PDF

I have a fairly simple HTML page rendered via asp.net. It looks beautiful in the PDF after running it through HtmlRenderer.PdfSharp EXCEPT that the images don't appear. Just the red X of a missing image in the PDF even though the web page itself…
HerrimanCoder
  • 6,835
  • 24
  • 78
  • 158
3
votes
1 answer

How to download embedded image using library TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator in finally generated pdf document in c#?

I have tried to generate the pdf document using the library TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator in C#, but the inline images inside the body HTML do not show up. Does anyone have an idea or solution how to do that? Embedded image added in…
Dipak Patel
  • 79
  • 1
  • 5
3
votes
3 answers

HtmlRenderer & PDFsharp add footer to each page

I am trying to put a copyright symbol at the bottom of each page when the PDF is generated but I cant seem to get it to work. How would I go about doing such a thing? I am using HtmlRenderer and PDFsharp, take my HTML body and convert it to a PDF…
andy wilson
  • 920
  • 5
  • 16
  • 38
3
votes
3 answers

How to Page Break HTML Content in HTML Renderer

I have a project where HTML code is converted to a PDF using HTML Renderer. The HTML code contains a single table. The PDF is displayed but the issue is that the contents of the table are cut off at the end. So is there any solution to the…
Darshaka
  • 179
  • 3
  • 12
3
votes
3 answers

How to give custom size to PdfSharp generated Pdf

I was trying to generate a pdf from HTML which containing a table using PdfSharp and HTMLRenderer. The following shows the code. pdf = PdfGenerator.GeneratePdf(html, PageSize.A3); byte[] fileContents = null; …
Darshaka
  • 179
  • 3
  • 12
2
votes
1 answer

Enable UTF-8 or set custom font with TheArtOfDev's HtmlRenderer.PdfSharp

I'm using TheArtOfDev's HtmlRenderer.PdfSharp to convert an HTML string to PDF in a ASP.NET web application. The HTML contains Japanese characters. The Japanese symbols are converted to ☐ ascii characters. How can I enable UTF-8 or use a custom…
Fede G
  • 197
  • 10
2
votes
1 answer

Inputs aren't displayed on PDF when converting HTML to PDF

I am using HtmlRenderer.PdfSharp version 1.5.0.6 to create a PDF from a HTML string. I am using very basic code which I found from other Stack Overflow posts to do this (the other post didn't have input in the example). The only issue is that no…
J. Campbell
  • 354
  • 1
  • 2
  • 15
2
votes
1 answer

Use Migradoc on existing PdfSharp document

I know I can use PdfSharp to render a MigraDoc element but what I need to do is add elements to a manually created PdfDocument using MigraDoc (or something like this): I have 2 methods, PrintHeader and PrintFooter. Both use Document (migradoc) to…
Leo
  • 7,379
  • 6
  • 28
  • 44
1
vote
0 answers

How to use options parameter from rasterizeHtml.js?

I tried this logic but it didn't work: var canvas = document.getElementById("canvas"); document.body.appendChild(rasterizeHTML.drawHTML(document.body.innerHTML, canvas, {height:'1000px'})); Options is an object and I tried to pass in it the width…
1
vote
0 answers
1
vote
0 answers

How to create a pagebreak using HTML Renderer with the latest beta version

When a page break is needed I have included strPDF += "
"; I also tried using strPDF += "

"; but this seems not to work. Here I am using…
Dennis
  • 297
  • 6
  • 26
1
2 3