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

37 questions
31
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
  • 3,714
  • 10
  • 37
  • 65
17
votes
4 answers

HTML to PDF - page break with PdfSharp and HtmlRenderer

I try to convert HTML to PDF using PdfSharp and HtmlRenderer. This is part of code: private byte[] CreateHtmlContent() { string htmlContent = File.ReadAllText(@"htmlExample.txt"); using (MemoryStream ms = new MemoryStream()) { …
kiriz
  • 505
  • 1
  • 6
  • 24
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
  • 91
  • 1
  • 1
  • 9
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
  • 5,858
  • 20
  • 65
  • 111
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
  • 69
  • 1
  • 5
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
  • 169
  • 1
  • 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
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
  • 665
  • 3
  • 11
  • 34
2
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
  • 169
  • 1
  • 10
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,061
  • 6
  • 26
  • 43
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
  • 285
  • 6
  • 26
1
vote
0 answers

In react-page ORY editor, is there a way to get html string output with inline styles?

A quick note: Since I do not have enough reputations, I cannot create new relevant tags related to ORY Editor. I'm not sure whether this question will reach the right people. While using react-page currently, we can get a HTML string output by…
1
vote
1 answer

HTML Renderer/PDFsharp Combine Two HTML-Generated PDF Documents

I am trying to add two pages in one document. These two pages are generated from HTML. Info : HTML Renderer for PDF using PDFsharp, HtmlRenderer.PdfSharp 1.5.0.6 var config = new PdfGenerateConfig { PageOrientation =…
Alican Kablan
  • 379
  • 5
  • 15
0
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
  • 129
  • 6
1
2 3