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

Tim Allison commented on PDFBOX-3772:
-------------------------------------

Y, that's what my proposal would be:
{noformat}
        if (openAction == null)
        {
            return null;
        }
        else if (openAction instanceof COSBoolean)
        {
            if (((COSBoolean)openAction).getValue() == false)
            {
                return null;
            }
            else
            {
                throw new IOException("Can't create OpenAction from 
COSBoolean='yes'");
            }
        }
        else if (openAction instanceof COSDictionary)
{noformat}

Is this reasonable?

Thank you for the tip on testing!

> Add COSBoolean(false) as option in PDDocumentCatalog's getOpenAction
> --------------------------------------------------------------------
>
>                 Key: PDFBOX-3772
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3772
>             Project: PDFBox
>          Issue Type: Improvement
>            Reporter: Tim Allison
>            Priority: Trivial
>         Attachments: 020196.pdf
>
>
> Over on Tika, we've started allowing users to extract PDActions.  In our 
> recent regression tests, we found a few new exceptions while trying to get 
> the OpenAction from PDDocumentCatalog.
> The easy one to fix is: 
> {noformat}
> java.io.IOException: Unknown OpenAction false
>       at 
> org.apache.pdfbox.pdmodel.PDDocumentCatalog.getOpenAction(PDDocumentCatalog.java:261)
>       at 
> org.apache.tika.parser.pdf.AbstractPDF2XHTML.startDocument(AbstractPDF2XHTML.java:460)
> {noformat}
> The object is a COSBoolean with value=false.
> I'll open a separate issue for the other new (to us) exception.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to