Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside of work, he’s a 1900‑rated chess player, guitarist, and French learner.

How to remove annotations from PDF files in Java (Tutorial)

39 sec read

pdf risks

The PDF file format is very complex and contains many features to boost interactivity. One such feature is the ability for PDF files to contain annotations which allow you to draw over, highlight, label, and comment on documents without modifying the existing content.

While this is a useful feature, you may want to remove annotations from documents, for example to remove text highlighting that has been done with annotations.

Our PDF toolkit JPedal allows you to remove annotations from PDF files with only a few lines of code!

To do this you need to download a JPedal jar, then run the following code:

You may also want to consider other sanitization options to clean your documents.

Resources

You can download a trial jar from our website.

Learn more about the PDF Manipulator API.

We can help you better understand the PDF format as developers who have been working with the format for more than 2 decades!



The JPedal PDF library allows you to solve these problems in Java


Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside of work, he’s a 1900‑rated chess player, guitarist, and French learner.