cloudformatter format requests: 6,182,712    pages delivered: 14,110,761

Comments in PDF

xportability LLC

Comments in PDF


Notice: Of course, you need to use a PDF viewer that supports the viewing of PDF comments. Chrome does not support this feature but Firefox does. You can also download and open the PDF with Adobe Reader to see how the comments are rendered within their viewer.

Because the rendering backend support injecting PDF comments (annotations) into the document, we can use some XML inside the HTML markup to encase the comment. This example paragraph has a comment insertedSample PDF CommentThis is comment text. Only the textual content of this <comment-text> element will be carried through to the PDF comment text. right inline. The XEPOnline stylesheets have implemented the comment structure shown below, will recognize it and transfer it to the backend. You can implement inside the html as:

<comment icon-type="comment">
            <title>Sample PDF Comment</title>
            <comment-text>This is comment text. You cannot have any markup in this element, 
            only the textual content will be used.</comment-text>

We have implemented some CSS to style these comments as popup ballons, much like they would be in the PDF. This is another paragraph with different commentsAnother PDF CommentYou can put inline markup in the comment for the HTML, but it cannot be carried through to the PDF. Only the text of the <comment-text> element will be used. in it. This paragraphThird Long PDF CommentEos nisl sadipscing amet. Dolore sed enim. Ipsum eos wisi. Aliquam diam sit ipsum sea sed ea vel gubergren et labore eirmod sadipscing. Eos lorem vel aliquyam iriure labore et dolores vel accusam ea est velit ullamcorper nonummy dolore nostrud sanctus liber. Minim aliquyam kasd labore duis accusam dolore accusam rebum consectetuer nonummy takimata. Possim sanctus et diam duo lorem consetetur diam. Consetetur magna dolore ipsum invidunt sea no kasd dolore nulla dolor stet. No vero delenit invidunt accusam feugiat augue ipsum et veniam elitr sea amet. Dolores consetetur elitr eros clita ipsum dolor invidunt rebum sit no labore dolore dolore. is another example of this technique.

You can set the color and opacity of the annotation using css styles. These will also carry through to the PDF. The examples on this page all have different colors assigned which you can do in many ways (like through classes) and the last example shows a different opacity applied.