You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maruan Sahyoun (JIRA)" <ji...@apache.org> on 2016/11/22 08:46:58 UTC

[jira] [Commented] (PDFBOX-3586) Unable to detect form - pdCatalog.getAcroForm() return null

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

Maruan Sahyoun commented on PDFBOX-3586:
----------------------------------------

The document doesn't have an AcroForm entry so it's correct that this is null. What it has are widget annotations which Adobe Reader detects as form fields. To process these you'd need to get the pages annotations. 

Now looking at your code I think want you'd want to do is flatten the form fields. This is currently implemented for AcroForm but not for annotations defined as part of the pages. Maybe you can outline a little bit what you are trying to achieve so wo can come up with an approach for you and maybe implement that as part of PDFBox.  

> Unable to detect form - pdCatalog.getAcroForm() return null
> -----------------------------------------------------------
>
>                 Key: PDFBOX-3586
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3586
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.3
>         Environment: Latest macOS Sierra 10.12.1. Java 1.8.0_73
>            Reporter: steve neo
>
> I have a PDF document which has form.  I can type either from browser, Adobe  reader, they all have an editable form. But when I use getAcroForm(), it return null.   The PDF https://drive.google.com/file/d/0B3Uah3i8yt9qTUVldFVWeTFob2c/view?usp=sharing
> {code}
>         PDDocument document = PDDocument.load(input);
>         PDDocumentCatalog pdCatalog = document.getDocumentCatalog();
>         PDAcroForm formPdf = pdCatalog.getAcroForm(); // here return null
>         if (formPdf != null) {
>             formPdf.flatten();
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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