Reputation: 1951
I am new to PDFBox API. I would like to apply text annotation(AirPassengers) style like below marked in red box.
I am using PDF box API. I am creating text annotation as shown below.
PDAnnotationTextMarkup txtMark = new PDAnnotationTextMarkup(PDAnnotationTextMarkup.SUB_TYPE_FREETEXT);
This will result in Simple Text Annotation without any Style or background color. I would like to achieve the style as shown in screenshot. Anybody has any idea to achieve this.
Upvotes: 0
Views: 645
Reputation: 18851
Do this:
txtMark.setColor(new PDColor(new float[] { 0, 1, 1 }, PDDeviceRGB.INSTANCE));
this sets the color you mentioned (#00FFFF). In Adobe Acrobat, colors are between 0 and 1 and not between 0 and 255. Be aware that the annotation will be visible in Adobe Reader, but at this time not in PDFBox rendering or PDF.js rendering because the Appearance Stream is missing (see my comment in your previous question).
Upvotes: 1