I have downloaded the free version of GemBox and am trying to code up an initial test. I am running the HTML to PDF example.
However, when I put the same code that is in the example I get errors. I added a few more references thinking that would work but it doesn’t.
In this code:
var htmlLoadOptions = new HtmlLoadOptions();
using (var htmlStream = new MemoryStream(htmlLoadOptions.Encoding.GetBytes(html)))
{
// Load input HTML text as stream.
var document = DocumentModel.Load(htmlStream, htmlLoadOptions);
// Save output PDF file.
document.Save("Output.pdf");
}
There is a problem with “new MemoryStream(htmlLoadOptions.Encoding.GetBytes(html)))” The ‘Encoding’ is in red with this message when I hover over it: Reference to type ‘Encoding’ claims it is defined in ‘System.Runtime’, but it couldn’t be found
I specifically included a reference to “System.Text.Encoding” but that didn’t seem to help. What is missing?
Thanks in advance,
Paul