I'm trying to convert a html document to pdf. I tried multiple tools like iTextSharp, OpenHtmlToPdf, etc. But the Output File doesnt contain the text of the html.
Input File: https://wetransfer.com/downloads/49dbb404cf25f36dc5d1cbcfe0e1491820210523120756/47bb00
Output File: https://wetransfer.com/downloads/7e44ec94f42eb5a6bb9e4d2d986a820d20210523120732/0f3799 Can someone please help me? I'm trying to do this since a week and I havent found a solution that works.
I tried something like this:
using System.IO;
using System;
using NReco.PdfGenerator;
namespace test
{
class te
{
static void Main(string[] args)
{
var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
htmlToPdf.GeneratePdfFromFile(@"C:/Temp/input.html", null, @"C:/Temp/export.pdf");
}
}
}
using System.IO;
using System;
using OpenHtmlToPdf;
namespace test
{
class te
{
static void Main(string[] args)
{
string html = File.ReadAllText(@"C:/Temp/input.html");
var pdf = Pdf.From(html);
byte[] content = pdf.Content();
File.WriteAllBytes(@"C:/Temp/Test.pdf", content);
}
}
}