I am using EvoPDF html to pdf converter (v6.16) for .NET, and am attempting to generate the PDF using a localhost url. Please see an example of this below:
public void GeneratePDF()
{
HtmlToPdfConverter converter = new HtmlToPdfConverter();
converter.ConversionDelay = 4;
// use ticks to give it a unique name.
string pdfFileName = @"C:\pdf-files\" + DateTime.Now.Ticks.ToString() + ".pdf";
try
{
string url = "http://localhost:8080/index.html#!/";
converter.ConvertUrlToFile(url, pdfFileName);
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
}
This works fine when I replace the url with one pointing to our live site, however for localhost it only outputs a blank pdf. This suggests the problem is specific to the use of a localhost url.
I have also already tried a number of different pages on the site running on localhost, each of them resulting in the same blank pdfs.
Have also tried changing the port that the site is running on locally to see if that made a difference, however still does not render out anything on the pdf.
I have done a fair bit of googling (enough to force me into asking a question on here) and not really turned up anything useful. I have already seen this question here, and it does not really provide any help.
Please note that I am also unable to get anything displaying on the pdf when I attempt to generate it using the localhost url on their demo application either.
Thanks in advance