Retrieve PDF highlights data and load selection in another PDF on a different device?

Q: Is there any way to retrieve highlight data from pdf to load these metadata in another device (pdf)?

A:

I am not very clear regarding your requirements and it would help if you could elaborate on what you would like to do.

PDFViewCtrl has method called getSelection ( http://www.pdftron.com/pdfnet/mobile/Javadoc/pdftron/PDF/PDFViewCtrl.html#getSelection(int) ) that can be used to obtain the current selection in the viewer.

Similarly there are methods that can be used to set the selection/highlights (**[selectByHighlights](http://www.pdftron.com/pdfnet/mobile/Javadoc/pdftron/PDF/PDFViewCtrl.html#selectByHighlights(pdftron.PDF.Highlights)), [selectByRect](http://www.pdftron.com/pdfnet/mobile/Javadoc/pdftron/PDF/PDFViewCtrl.html#selectByRect(double, double, double, double)), [selectByStruct](http://www.pdftron.com/pdfnet/mobile/Javadoc/pdftron/PDF/PDFViewCtrl.html#selectByStruct(double, double, double, double)), [clearSelection](http://www.pdftron.com/pdfnet/mobile/Javadoc/pdftron/PDF/PDFViewCtrl.html#clearSelection()), etc**),

You may also want to take a look at ‘**pdftron.PDF.Highlights**’ which also includes utility methods to save and load highlights to/from a file or sting:

http://www.pdftron.com/pdfnet/mobile/Javadoc/pdftron/PDF/Highlights.html

In case you are dealing with standard PDF annotations (’ pdftron.PDF.Annots.Highlight’) you can traverse what annotations are present in the document (as shown in Annotation sample - http://www.pdftron.com/pdfnet/samplecode.html#Annotation) then serialize the info (e.g. rect, color) in your XML packet and send it to the server or directly to another device. There you would parse the info and use PDFNet annotation API to add the a new Highlight annotation at a given location.