MR K
MR K

Reputation: 113

Error using HTML to PDF conversion using Essential objects

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

Answers (1)

MR K
MR K

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

Related Questions