PDF Annotation Tools

Have you ever wanted to edit the content of your PDF documents? If so, you are likely to have heard about annotation tools.

PDF Annotation Tools

PDF annotation tools allow users to modify their documents in order to:

  • Add text notes and comments
  • Highlight or underline texts
  • Add HTML hyperlinks to their pages
  • Draw geometrical forms such as rectangles, lines, arrows, squares, circles, etc.
  • Manage AcroForms

And much more!

The PlugPDF SDK comes out of the box with a set of specialized Java classes designed to accomplish this purpose. Please visit PlugPDF’s Class List and go to com/epapyrus/plugpdf/core/annotation for more information.

PDF annotation tools allow users to modify their documents

You’ll notice about twenty different Java classes for inserting any kind of PDF annotation: From common geometric figures such as squares, circles or lines, right up to HTML links, stamps, sounds and files. All of them share the same operating principle.

Let’s now take the Hello World example and turn the main activity’s onCreate method (lines 26-32):

Into the code snippet shown below:

As you see, this code waits for the user’s interaction to draw a circle on the lorem_ipsum.pdf document.

Since the gesture type is set to EDIT during all the execution of the program, it is possible for the user to draw as many circles as they want. After drawing, however, the gesture type should be set to VIEW to disable the drawing capability.

Let’s put some PDF annotations into action. Attached below are four sample annotations for you to see how they are set from the ReaderView object.

In order to run this exercise you just have to take the Android snippet above and update line number 6:

As mentioned before, all annotations are initialized the same way.

Figure 1. Underline text

Figure 1. Underline text

Figure 2. Highlight text

Figure 2. Highlight text

Figure 3. The ink annotation is a freehand drawing tool

Figure 3. The ink annotation is a freehand drawing tool

Figure 4. Drawing a circle

Figure 4. Drawing a circle

So these are the basics to edit and modify PDFs. Inserting an annotation with a ReaderView object is a piece of cake! We will soon provide more information about this topic. Meanwhile, you are strongly encouraged to browse the PlugPDF API Reference for discovering the nuts and bolts of all the annotations available.

Did you like today’s post? If so, please share it with your friends or leave us a comment.

5 replies
  1. Dr. Plug
    Dr. Plug says:

    Hello Ben,

    Thank you for the inquiry.
    if you refer these sample codes, you could use a note feature.

    mReader.changeGestureType(BaseGestureProcessor.GestureType.EDIT);
    mReader.setAnnotationTool(AnnotToolType.NOTE);

    Thank you.

    Reply
  2. Vitalii
    Vitalii says:

    Hi,

    And what about AnnotRichMedia ? I’d like to add a sound record or camera image. Seems it is possible, but i cant find appropriate one in AnnotToolType enum.

    Reply
  3. Dr. Plug
    Dr. Plug says:

    Hello Vitalii,
    Thank you for the inquiry. As you said, our PlugPDF SDK have not AnnotToolType about AnnotRichMedia. Because that feature is not supported. Our PlugPDF SDK has supported viewing and playing rich media.

    Thank you,

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *