Highlighted

How to make the annotation border rectangular

Feb 21, 2020

Copy link to clipboard

Copied

I want to create an annotation for a selected piece of text. I use the CreateAnnotations example for this at the page https://github.com/datalogics/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/Annotati....
Create annotation:
static ASAtom atH = ASAtomFromString ("Highlight");
PDAnnot highlight = PDPageCreateAnnot (p, atH, & annotationRect);
and set its coordinates and color (I use the SetAnnotationQuads function from the example for this).
Naturally, only the main part of the code is given here.
As a result, the selected text fragment is painted in the desired color, but the border of the selected fragment is not rectangular, as I would like, but some strange shape to the left and right of the text. This can be seen in the figure.scr.PNG

Please tell me how to make the annotation border rectangular.

I would be grateful for your help.

Topics

Acrobat SDK and JavaScript

Views

24

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to make the annotation border rectangular

Feb 21, 2020

Copy link to clipboard

Copied

I want to create an annotation for a selected piece of text. I use the CreateAnnotations example for this at the page https://github.com/datalogics/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/Annotati....
Create annotation:
static ASAtom atH = ASAtomFromString ("Highlight");
PDAnnot highlight = PDPageCreateAnnot (p, atH, & annotationRect);
and set its coordinates and color (I use the SetAnnotationQuads function from the example for this).
Naturally, only the main part of the code is given here.
As a result, the selected text fragment is painted in the desired color, but the border of the selected fragment is not rectangular, as I would like, but some strange shape to the left and right of the text. This can be seen in the figure.scr.PNG

Please tell me how to make the annotation border rectangular.

I would be grateful for your help.

Topics

Acrobat SDK and JavaScript

Views

25

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have something to add?

Join the conversation
Resources
One Stop Solution for Acrobat
Edit a PDF
Add a group