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 2015/07/13 10:43:04 UTC

[jira] [Closed] (PDFBOX-2873) Make bitfields public in PDField like in PDAnnotation

     [ https://issues.apache.org/jira/browse/PDFBOX-2873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr closed PDFBOX-2873.
-----------------------------------
    Resolution: Not A Problem

> Make bitfields public in PDField like in PDAnnotation
> -----------------------------------------------------
>
>                 Key: PDFBOX-2873
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2873
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>    Affects Versions: 2.0.0
>            Reporter: Roberto Nibali
>            Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I need to set COSName.FF and COSName.F dictionary entries to amend a broken fields clone from one PDF to another. Here is part of the code to illustrate what I'm trying to achieve:
>                 String fieldToHideName = "01.024";
>                 String fieldToShowName = "01.0251";
>                 PDField fieldToHide = tplDoc.getDocumentCatalog().getAcroForm().getField(fieldToHideName);
>                 PDField fieldToShow = tplDoc.getDocumentCatalog().getAcroForm().getField(fieldToShowName);
>                 fieldToHide.getCOSObject().setFlag(COSName.F, PDAnnotation.FLAG_HIDDEN, true);
>                 fieldToShow.getCOSObject().setFlag(COSName.F, PDAnnotation.FLAG_INVISIBLE, false);
>                 fieldToShow.getCOSObject().setFlag(COSName.FF, PDFields.FLAG_READ_ONLY, true);
> The last one is not possible because the PDField's static flags are private instead of public. I know there are methods to call, but I believe in this case the resulting code is easier to read and more straight-forward to write. After all we're talking about setting flags. For some reason the PDAnnotation's static flags are public. 



--
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