iText pdf library
Website search

How to get the author of a "free text" annotation?

Is it possible to get the author of a free text annotation using iText? I can retrieve the /Type and /Contents, but I can't find a way to get the author.

Posted on StackOverflow on Feb 28, 2015 by john renfrew

If the author value is present, you'll find it in the /T entry. Please consult ISO-32000-1 table 170 "Additional entries specific to markup annotations". It defines a key named /T that is described as an optional text string that shall be displayed in the title bar of the annotation's pop-up window when open and active. This entry shall identify the user who added the annotation. The value you seek is not available for every type of annotations, only for markup annotations.

So when you have this in Adobe Acrobat:

Annotations in a PDF

Annotations in a PDF

You'll find this inside the PDF:

Annotations in iText RUPS

Annotations in iText RUPS

In iText 7 you should look for the /Annots entry using getAnnotations() method. Each annotation has a getTitle() method, so it's really easy to solve your problem:

public void manipulatePdf(String src, String dest) throws IOException {
    PdfDocument pdfDoc = new PdfDocument(new PdfReader(src), new PdfWriter(dest));
    List annots = pdfDoc.getFirstPage().getAnnotations();
    if (annots != null) {
        for (PdfAnnotation a : annots) {
            if (a.getTitle() != null)

Click this link if you want to see how to answer this question in iText 5.

Ready to use iText?

Try our iText 7 Library and add-ons FREE for 30 days. Test your proof of concept, and see if our solution is right for you.

Get my FREE trial

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now