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

Maruan Sahyoun edited comment on PDFBOX-4131 at 3/2/18 3:35 PM:
----------------------------------------------------------------

[~momaison] Do both cases show up in PDFs you have? How have these been 
created? The reason I'm asking is that there might be other objects in a PDF 
which are organized in a tree like structure where a child could reference an 
ancestor.


was (Author: msahyoun):
[~momaison] Do both cases show up in PDFs you have? How have these been created?

> Stack overflow in fields
> ------------------------
>
>                 Key: PDFBOX-4131
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4131
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.8
>            Reporter: Maison
>            Priority: Major
>         Attachments: fields_loop_kid_is_parent.pdf, 
> fields_loop_kid_is_parent_of_other_group.pdf
>
>
> Note: unfortunately I can not attach original file for confidentiality reasons
> I have a pdf containing some fields :
>  
> /AcroForm 2 0 R
> ...
> 2 0 obj
> <<
> /DR 5 0 R
> /Fields [ ...  15 0 R 16 0 R 17 0 R ...]
> >>
> and then for field object 17 :
> 17 0 obj
> <<
> /DA (/Helv 8 Tf 0 g)
> /FT /Tx
> /Ff 1
> /Kids [17 0 R 88 0 R 89 0 R]
> /MaxLen 0
> /T (Nom)
> >>
> Here we see that this field is contained in its children list : this triggers 
> a recursivity loop during parsing (or at least during method call 
> getAcroForm() )
>     at java.lang.StringBuilder.toString(StringBuilder.java:407)
>     at org.apache.pdfbox.cos.PDFDocEncoding.toString(PDFDocEncoding.java:135)
>     at org.apache.pdfbox.cos.COSString.getString(COSString.java:203)
>     at org.apache.pdfbox.cos.COSDictionary.getString(COSDictionary.java:670)
>     at 
> org.apache.pdfbox.pdmodel.interactive.form.PDFieldFactory.createField(PDFieldFactory.java:64)
>     at 
> org.apache.pdfbox.pdmodel.interactive.form.PDField.fromDictionary(PDField.java:80)
>     at 
> org.apache.pdfbox.pdmodel.interactive.form.PDNonTerminalField.getChildren(PDNonTerminalField.java:139)
>     at 
> org.apache.pdfbox.pdmodel.interactive.form.PDFieldTree$FieldIterator.enqueueKids(PDFieldTree.java:99)
>     at 
> org.apache.pdfbox.pdmodel.interactive.form.PDFieldTree$FieldIterator.enqueueKids(PDFieldTree.java:102)
> ...
>  
> I use pdfbox 2.0.8
> Similar problem with preflight parser.
> In this case a simple fix would be to ignore children fields that are the 
> same as their parent ; however the references loop may be much more 
> complicated.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to