[
https://issues.apache.org/jira/browse/PDFBOX-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16819301#comment-16819301
]
Tilman Hausherr commented on PDFBOX-4515:
-----------------------------------------
I answered in the mailing list... either you're not subscribed, or you didn't
get the answer (which is possible, I don't get them either since the mail
server crash last week).
The type should be PDAnnotationMarkup. Yes the class structure is weird in 2.0,
it will be better in 3.0. Here's code from the trunk that would help you:
{code}
/**
* This will set the coordinates of the callout line.
*
* @param callout An array of four or six numbers specifying a callout line
attached to the free
* text annotation. Six numbers [ x1 y1 x2 y2 x3 y3 ] represent the
starting, knee point, and
* ending coordinates of the line in default user space, four numbers [ x1
y1 x2 y2 ] represent
* the starting and ending coordinates of the line.
*/
public final void setCallout(float[] callout)
{
COSArray newCallout = new COSArray();
newCallout.setFloatArray(callout);
getCOSObject().setItem(COSName.CL, newCallout);
}
/**
* This will get the coordinates of the callout line.
*
* @return An array of four or six numbers specifying a callout line
attached to the free text
* annotation. Six numbers [ x1 y1 x2 y2 x3 y3 ] represent the starting,
knee point, and ending
* coordinates of the line in default user space, four numbers [ x1 y1 x2
y2 ] represent the
* starting and ending coordinates of the line.
*/
public float[] getCallout()
{
COSBase base = getCOSObject().getDictionaryObject(COSName.CL);
if (base instanceof COSArray)
{
return ((COSArray) base).toFloatArray();
}
return null;
}
{code}
The rectangle box is just the ordinary rectangle IIRC.
Don't forget to set the Intent, which must be "FreeTextCallout".
> Support for Add Text Callout Annotation tool.
> ---------------------------------------------
>
> Key: PDFBOX-4515
> URL: https://issues.apache.org/jira/browse/PDFBOX-4515
> Project: PDFBox
> Issue Type: Wish
> Reporter: Kaushlendra Singh
> Priority: Major
> Labels: Annotations
> Attachments: Screen Shot 2019-04-15 at 5.39.31 PM.png
>
>
> I am trying to extract information related to "Add Text Callout" annotation
> tool from pdf. I get to know from initial research that it's a "FreeText"
> type annotation and it's intent is "FreeTextCallout". But I am unable to
> figure out like how can I get the rectangle info for both the box and arrow
> attached to it. I am able to get the bounding box which encloses both the
> markups. I don't know it's already implemented or not.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]