In the JPedal Java PDF Library, we have implemented features allowing you to create and edit annotations on your PDF files. Here’s a quick summary of how it works:
We’ve added a new tab to the sidebar, labelled “Annotations”. From here, you can select a variety of annotation types to add to your PDF. Most require a simple click and drag/move, but each button has a helpful tool-tip if you’re unsure on what to do.
After selecting an annotation type, the cursor will change to a crosshair when you move your mouse over the page (or if using the highlight tool, an I-cursor when over un-highlighted text). You’re now free to start drawing!
To select an existing annotation, simply left click anywhere over it. You’ll know if it’s selected – there will now be a fancy border around it and tabs around the edges for resizing the annotation.
To move annotations, simply click and hold anywhere on one, then drag it wherever you please on the page. Additionally, resizing is just as easy – click and drag one of the tabs around the edge of the annotation.
For more in-depth customisation, right-clicking an annotation will open a context menu from which you can select “properties”. This will open the properties window, where you can edit the line width, line colour and fill colour (where these options are supported) to your heart’s content – just click on an option to change it.
Of course, we aren’t stopping here – we already have plans to add more annotation types and features in the near future.
Is there anything you’d like to see in the next annotations update? Let us know in the comments below.
IDRsolutions develop a Java PDF library, a PDF forms to HTML5 converter, a PDF to HTML5 or SVG converter and a Java Image Library that doubles as an ImageIO replacement. On the blog our team post about anything interesting they learn about.