MortenMoulder MortenMoulder - 13 days ago 6
C# Question

Cannot access internal property 'ConvertedHtmlElementSelector' here

I am using HiQPdf Free to generate PDFs from an URL. I noticed in their documentation, you can simply grab a specific element instead of the whole page. It would go something like this:

HtmlToPdf htmlToPdfConverter = new HtmlToPdf();

htmlToPdfConverter.ConvertedHtmlElementSelector = "#logo";

htmToPdfConverter.ConvertUrlToFile("https://your-website.com/", "/path/to/pdf.pdf");


However, when I do the
htmlToPdfConverter.ConvertedHtmlElementSelector
in my code, it tells me this error:


Cannot access internal property 'ConvertedHtmlElementSelector' here


Could this be because it's a paid only feature? That seems like the only obvious reason, however, I haven't been able to find any source on that.

Answer

Converting only a region of the HTML page to PDF is a feature of the full version and it is not available in the free version. There is an example for this feature with C# and VB.NET code samples at http://www.hiqpdf.com/demo/ConvertHtmlRegionToPdf.aspx

Comments