Q:
Does PDFNet SDK have the ability to "display" and edit annotations
created in Acrobat? i.e. open a comment note? Please see attached.
Tried annot.SetTextAnnotOpen(true); could not get the contents to
display.
-----------------------------
A:
By default, PDFNet SDK renders all annotations that have appearance
streams (AP entry in the annotation dictionary).
If the annotation is missing the appearance stream and you only need to
display static annotations on top of the page, the simplest approach is
to build annotation appearance streams. Because the annotation is
missing the static appearance, the viewer needs to give it a default
look and as a result the annotation may look different in Acrobat 5,
Acrobat 7 Pro, and in a third party viewer. A PDF consumer can create a
default look for an annotation by creating the missing appearance. For
an example of how to create a new annotation appearance, please see
CreateCheckmarkAppearance() and CreateButtonAppearance() methods at the
end of InteractiveForms sample project
(www.pdftron.com/net/samplecode.html#InteractiveForms; for more sample
code you may want to take a look at ElementBuilder sample project -
www.pdftron.com/net/samplecode.html#ElementBuilder). The appearances
need to be created only once (usually just after the document is
opened).
If you would like to implement interactive annotations (such as pop-up
text, etc.), you will probably want to disable rendering of default
annotation appearances (using
pdfview/pdfdraw.SetDrawAnnotations(false)) and draw all annotations on
top of the page (e.g. using GDI for C++ or GDI+ under .Net). This can
be done by implementing a custom OnDraw/OnPaint method in a derived
class from the PDFView control (e.g. as illustrated in PDFView sample
project - www.pdftron.com/net/samplecode.html#PDFView). In this case,
you are not limited to annotation types offered as part of Acrobat and
it is possible to implement custom annotations that are suitable for a
specific industry. The downside of this approach is that you would need
to implement drawing and manipulation of annotations that are drawn on
top of the page.
One more note regarding the PDFView sample project: The drawing created
using the 'pencil' markup tool is written to the main page. Creating a
PDF document with markup stored in a separate annotation would be even
simpler (just create e_Polyline annotations instead of
serializing/appending the markup to the page).
Please let me know if this helps and if you have any questions.