0

Is there a way to determine the html for the page being created (not the entire document)?

For example, if I pass this in:

 var htmlToPdfDocument = htmlToPdfConverter.ConvertHtmlToPdfDocument(htmlString, baseUrl);

Obviously, I already have the entire html, but I want to be able to, right before the page is being created, determine if certain text or css class exists on that page.

I looked at: https://www.hiqpdf.com/documentation/multiple-html-layers.aspx

PdfHtml Events

But I cannot seem to find any property that shows the html for the page about to be created.

I have a work-around (not ideal), which is to generate a "temporary" pdf, read it, get a list of page #s that contain the text, then try to manipulate the DOM for the "real" PDF. But this is adds a lot of time for long PDF documents/creation.

  • The document does not seem to point out how to monitor and intercept the html being generated, but it can obtain a certain part of html and convert it to pdf. This should be similar to your solution, but I am not sure if it can shorten the time. Check [this link](https://www.hiqpdf.com/documentation/html/7f91256f-a0c7-47e3-8017-f7f4ba6915b6.htm). – Chen May 25 '23 at 09:13

0 Answers0