Forum How do I...?

Is it possible to generate a unique annotation for separated content?

ns426
Hello,

I'm working with PDF annotations using PrinceXML version 15.4.1, and I was wondering if it is possible to generate a single annotation for content that is located in separate nodes. I tried using ids, but two different annotations are generated:

#comment {
  -prince-pdf-annotation-type: text;
  -prince-pdf-annotation-contents: 'Are you sure?';
}

<body>
  <p>
    This is just
    <span id="comment"> a comment </span>
  </p>
  <p><span id="comment"> with some random </span> content</p>
</body>


Is there any way to generate a unique annotation?

Thanks in advance!
mikeday
We don't have a mechanism to create one annotation from two elements; how exactly would you want that to look like in the PDF?
ns426
We have an application that allows arbitrary text selections, so for example given this list:

<ul>
  <li>
    <p>My item1 with content</p>
  </li>
  <li>
    <p>My item2 with content</p>
  </li>
</ul>


It may happen that the content to which the comment is applied is "with content My item2". In such cases, I want to display only a single comment for that selection. The result that I expect in the generated PDF is the one from the attached image
  1. Screenshot 2025-04-01 at 10.49.46.png29.2 kB
mikeday
Right, I will add this to the development roadmap.