You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2017/06/29 23:16:00 UTC

[jira] [Commented] (PDFBOX-3843) Rect of Annotation contains indirect elements + Patch

    [ https://issues.apache.org/jira/browse/PDFBOX-3843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16069172#comment-16069172 ] 

Tilman Hausherr commented on PDFBOX-3843:
-----------------------------------------

While the type of problem you mention is painfully familiar (usually a classcastexception), I couldn't reproduce it
{code}
        PDDocument doc = PDDocument.load(new File("PDFBOX-3843.pdf"));
        PDAnnotation ann = doc.getPage(24).getAnnotations().get(0);
        PDRectangle rectangle = ann.getRectangle();
        System.out.println(rectangle);
{code}
output:
{code}
[19.0947,762.613,595.328,781.779]
{code}
What did you do that failed? {{getObject()}} is able to work with references (unlike {{get()}}), and the PDRectangle COSArray constructor is also able to work with references.

> Rect of Annotation contains indirect elements + Patch
> -----------------------------------------------------
>
>                 Key: PDFBOX-3843
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3843
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.6
>            Reporter: Martin Mancuska
>            Priority: Minor
>              Labels: annotation, patch
>             Fix For: 2.0.7, 3.0.0
>
>         Attachments: 081204_gcada.pdf, AnnotRectangleIndirectElems.patch
>
>
> During processing of attached PDF file (081204_gcada.pdf) I've found out that method PDAnnotation.getRectangle() is not able to get elements from Rect of annotation if these elements are indirect cos objects ([10 0 R 11 0 R 12 0 R 13 0 R]) -> returns null.
> It works only if elements are direct cos objects.
> Affected annotation is present on page with reference number 266 0 R (page 25).
> Also I've attached a patch which solves this problems. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org