Reputation: 113
I have used the following code to convert from html to pdf using EO
private void CreatePDFFromHtml(string strFilePath, string strFileExt)
{
string strGetFileName = System.IO.Path.GetFileName(strFilePath);
string strFileLocation = txtTarget.Text + "\\" + strGetFileName.Replace(strFileExt, ".pdf");
if (System.IO.File.Exists(strFileLocation))
{
File.Delete(strFileLocation);
}
HtmlToPdf.ConvertHtml(strGetFileName, strFileLocation);
}
However the output that i get is completely blank in the pdf file. I have installed it using nuget install-package EO.pdf
Upvotes: 0
Views: 1786
Reputation: 113
I finally figured out the problem. In the first parameter for HTMLToPDF.ConvertHtml(string html, pdfdocument) I had supplied the html file name, it was expecting the actual html in string format.
Upvotes: 1