Hey there,
I'm currently working on generating a PDF with annotations (comments), and our goal is to use some form of background color or underline (using -prince-pdf-annotation-type). Before processing and sending the XHTML to Prince, we mark comments using processing instructions (start and end), which means they can span multiple nodes with different parent elements. Here’s an example of our structure:
Since processing instructions are not treated as element nodes in the DOM, typical CSS properties don’t apply.
Would there be a way to use these processing instructions to generate PDF annotations, perhaps by assigning a class="..." attribute? Or would we need to wrap the selected text in a dummy element to apply the necessary Prince CSS properties for annotations?
I appreciate your time and any insights you can share.
Thanks in advance!
I'm currently working on generating a PDF with annotations (comments), and our goal is to use some form of background color or underline (using -prince-pdf-annotation-type). Before processing and sending the XHTML to Prince, we mark comments using processing instructions (start and end), which means they can span multiple nodes with different parent elements. Here’s an example of our structure:
<xml>
<title>My <?comment-start id="123"?>title</title>
<tips>
<tip id='edit'>You can edit everything on the left</tip>
<tip id='examples'>You can access more examples from a menu in the top right</tip>
<tip id='permalink'>Another button there lets<?comment-end id="123"?> you share your test</tip>
</tips>
</xml>
Since processing instructions are not treated as element nodes in the DOM, typical CSS properties don’t apply.
Would there be a way to use these processing instructions to generate PDF annotations, perhaps by assigning a class="..." attribute? Or would we need to wrap the selected text in a dummy element to apply the necessary Prince CSS properties for annotations?
I appreciate your time and any insights you can share.
Thanks in advance!