Linking images in XFDF

75 views
Skip to first unread message

Aleks Clark

unread,
Jun 18, 2014, 10:48:56 AM6/18/14
to pdfnet-w...@googlegroups.com
I need to display image annotations in the web viewer. It seems that XFDF doesn't permit this, however I'd like to know if it's possible to link an image inside an XFDF comment, e.g. <img src="http://myserver.com/pdf_file_id/annotation_image_1">

Matt Parizeau

unread,
Jun 19, 2014, 6:40:23 PM6/19/14
to pdfnet-w...@googlegroups.com
Yep, you could include the image link as a custom attribute in the XFDF. Take a look at the custom annotations sample, particularly the diamond.js file, and look for the serialize and deserialize functions. These functions are called when the annotation is being saved to XFDF or loaded from XFDF and is where you could save your link attribute. You would create an image element from that link and then in the draw function just draw the image to the canvas.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages