Home : Annotations : Manipulating : Handling Unsupported Pdf Annotation Types
Q10344 - HOWTO: Handling Unsupported Pdf Annotation Types

HOWTO: Handling Unsupported Pdf Annotation Types

When dealing with PDF files which contain native Pdf annotation types unsupported by DotImage, you have a few options. You could create a custom renderer or translate the annotations to supported types or choose to ignore the unsupported types. In this article we will discuss how to convert Pdf link annotations to DotImage Hotspot annotations, in a Winforms application. We provide a renderer for Pdf link annotations for our web viewers, but not our winforms viewers

The idea is to use a PdfAnnotationImporter to import all annotations from the original file into an AnnotationDataCollection. Then iterate through the collection, if the data type is supported, just add it to the viewer's collection of annotations. If the annotation data type is a PdfLinkData object, create a HotSpotAnnotation setting the size and location property to those from the PdfLinkData object. Set the tooltip property of the HotSpotAnnotation to the Uri stored in the PdfLinkData object. Then just add the new HotSpotAnnotation to the viewer. You will to be handling the viewer's HotSpotClicked event. In the handler for this event, you will use launch a browser(if it's that type of link), pointing at the tooltip property we set earlier.

The beauty of this approach is that you can export any additional annotations over the original file(assuming you do not need to persist changes to the actual images). When exporting, exclude these temporary HotSpotAnnotations(as the original links will be in the file) and export only any other newly created annotations.

A sample application is attached.

Related Articles
No Related Articles Available.

Article Attachments
PdfLinkAnnotations.zip

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2019. InstantASP Ltd. All Rights Reserved