Forum How do I...?

HTML To PDF and back again... how to remember template data

tiditisj
Hi,

Our HTML templates have <divs> in them to optionally highlight a box in overlay (like a piece of text that can grow)
When we generate a PDF from the HTML, we want to display the rendered PDF in the browser, using something like PDF.js. It would be great if we can still can show the highlighted boxes, in their new sizes, as HTML overlay.
Does anybody have an idea to preserve original data (like div IDs from HTML into the PDF) so we can possibly get that data back when we want to show the PDF in a browser again, as HTML.

thanks!
mikeday
Hmm why not highlight the boxes in the PDF? I'm not sure I quite understand your requirements.
tiditisj
Thanks for the quick turnaround.
The highlights are for administrative purpose only. We don't want the generated PDF to have them. They are just an overlay in html that one should be able to turn on / off + the highlights have some clickable javascript attached that needs to execute in the browser. They should not be visible in the actual generated PDF.

But: here's a route that might work: with the box tracking API, we are able to get the xy coördinates of each placed box generated in the PDF based on a certain html class in the input html file.

We can use these coördinates to draw an html overlay when we display the generated PDF within the browser using PDF.js.

We can get the box coördinates using prince from console, but since we're working in .net and use the prince dll...our last challenge is to get the coördinates back in our app, from the dll..
mikeday
A specially formatted log message which you pick up in the event handler is the easiest way for now. We're going to add another way of doing this in the next version of the C# wrapper.
tiditisj
Thanks. Works!

Tom