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

Andreas Lehmkühler commented on PDFBOX-2261:
--------------------------------------------

Maybe I wasn't specific enough ....

I've understood that according to the spec everything is fine with the 
structure of the pdf. But the mentiond piece of code seems wrong to me
{code}
    private static boolean isButton(PDAcroForm form, COSDictionary field) 
throws IOException
    {
        String fieldType = PDField.findFieldType(field);
        List<COSObjectable> kids = PDField.getKids(form, field);
        if (fieldType == null && kids != null && !kids.isEmpty())
        {
            // sometimes if it is a button the type is only defined by one of 
the kids entries
            // TODO JH: this is due to inheritance, we need proper support for 
"non-terminal fields"

            COSDictionary kid = (COSDictionary)kids.get(0).getCOSObject();
            return isButton(form, kid);
        }
        return "Btn".equals(fieldType);
    }
{code}
The question is, does it make sense to search for a button field typ among the 
child nodes if the parent node hasn't any field type?

> Extremely long hang during getFields() on a few PDF files
> ---------------------------------------------------------
>
>                 Key: PDFBOX-2261
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2261
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 1.8.6
>            Reporter: Tim Allison
>            Priority: Minor
>         Attachments: 966679.pdf, screenshot-pdfdebugger.png
>
>
> When I run oap.examples.fdf.PrintFields from trunk, the code seems to hang 
> during acroForm.getFields().  This is a heavy load hang.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to