0

I am using EvoPDF - I get the required info from a webpage and add it to a pdf document like this:

HtmlToPdfElement html = new HtmlToPdfElement(0, yLocation, onlinePress[i].HyperLink);

// Optionally set a delay before conversion to allow asynchronous scripts to finish
html.ConversionDelay = 2;

// Add the first HTML to PDF document
AddElementResult firstAddResult = page.AddElement(html);

What I would like to do, before adding it to the PDF is edit some of the HTML. e.g. maybe wrap an inline style around a certain keyword for example.

I cannot figure out how to get the HTML from the above calls. Does anyone know hot to get the HTML?

Percy
  • 2,855
  • 2
  • 33
  • 56

2 Answers2

1

The answer to this it NO - although I don't know why - @EvoPdf, it would be such a useful addition to your product - it turns out that getting HTML from a dynamic web page is a real pain the backside, yet you seem to be able to do it flawlessly - please allow users access to the HTML that you use to create the PDF document.

Percy
  • 2,855
  • 2
  • 33
  • 56
0

You can get first the HTML string from that URL with HttpWebRequest class from .Net Framework, modify the HTML and then convert the modified HTML string using the HtmlToPdfElement constructor taking as parameters the modified HTML string and the base URL (which can be the URL you were previously converting).

EvoPdf
  • 523
  • 3
  • 9
  • Hi, thanks for the feedback - I was doing this originally but some of the sites I need to get HTML for are dynamic - using javascript to load additional data. Using the method you descibe you end up getting all the javascript rather than the HTML the javascript eventually loads. EvoPDF doesn't have this issue and gets the full HTML as required - that's why I was hoping to pull the HTML out of the EvoPDF object... – Percy Apr 14 '16 at 10:09