Hi Ricky,

I've looked at the docx file you've attached to PDFBOX-3809. Could it be that 
there is some misconception?

Flatten a field means that fields annotation becomes part of the page content 
stream and the field and the fields annotation are removed. Now the total 
fields you have in your form has a calculation script attached to it. The 
calculation is executed in Adobe Reader and calculates the fields content at 
run time.  PDFBox doesn't execute such calculations so the field doesn't have 
any value if you (only) open it in PDFBox. As a result the field doesn't 
contain any value. You'd have to calculate and set the fields value yourself 
and not depend on the fields calculate action.

BR
Maruan 

> Am 14.04.2018 um 09:55 schrieb Maruan Sahyoun <sahy...@fileaffairs.de>:
> 
> Hi Ricky,
> 
> I've tested with the jar file pdfbox-3.0.0-20180411.183355-618.jar and it 
> works fine using the test documents I have.
> 
> BR
> Maruan
> 
> 
>> Am 12.04.2018 um 17:51 schrieb Baker, Ricky <ricky.ba...@ttu.edu>:
>> 
>> I do  note that the PDAcroForm.java for revision 1828871 is not the same as 
>> what is in pdfbox-3.0.0-20180411.183355-618.jar
>> 
>> 
>> 
>> -----Original Message-----
>> From: Maruan Sahyoun <sahy...@fileaffairs.de> 
>> Sent: Thursday, April 12, 2018 10:45 AM
>> To: users@pdfbox.apache.org
>> Subject: Re: flatten specific fields in a pdf
>> 
>> Mhmm,
>> 
>>> Am 12.04.2018 um 17:25 schrieb Baker, Ricky <ricky.ba...@ttu.edu>:
>>> 
>>> Maruan, using the new jar it still behaves the same. 
>>> 
>>> Basically I am creating a list as I loop over and passing the list to the 
>>> flatten method.
>>> 
>>> List<PDField> listFields = [];
>>>              acroForm.getFields().each {
>>>                  def fieldName = it.getFullyQualifiedName();
>>>                  PDField pdFieldName = acroForm.getField(fieldName);
>>> 
>>>                 -------for proof of concept, I am only looking for one
>>>                  if (fieldName == 'ein') {
>>>                      listFields.push(pdFieldName);
>>>                  }
>>> 
>>> Then 
>>>  acroForm.flatten(listFields, false);
>> 
>> the unit test is fine and the resulting PDF document has 4 fields flattened 
>> and the rest still open.
>> 
>> Could you verify with the test from 
>> PDAcroFormTest.testFlattenSpecificFieldsOnly() ?
>> 
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsvn.apache.org%2Fviewvc%2Fpdfbox%2Ftrunk%2Fpdfbox%2Fsrc%2Ftest%2Fjava%2Forg%2Fapache%2Fpdfbox%2Fpdmodel%2Finteractive%2Fform%2FPDAcroFormTest.java%3Fview%3Dlog&data=02%7C01%7Cricky.baker%40ttu.edu%7C3703e4525c8e454688c708d5a08c57f9%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C636591447000108253&sdata=MUp2OnX5RrS9FwSIPeb5wviLR4nxp94KhVdCK72tncc%3D&reserved=0
>> 
>> BR
>> Maruan
>> 
>> 
>> 
>>> 
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Maruan Sahyoun <sahy...@fileaffairs.de> 
>>> Sent: Thursday, April 12, 2018 9:19 AM
>>> To: users@pdfbox.apache.org
>>> Subject: Re: flatten specific fields in a pdf
>>> 
>>> 
>>>> Am 12.04.2018 um 16:15 schrieb Baker, Ricky <ricky.ba...@ttu.edu>:
>>>> 
>>>> Maruan, is this the one?
>>>> pdfbox-3.0.0-20180411.183355-618.jar
>>> 
>>> yes 
>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Frepository.apache.org%2Fcontent%2Fgroups%2Fsnapshots%2Forg%2Fapache%2Fpdfbox%2Fpdfbox%2F3.0.0-SNAPSHOT%2Fpdfbox-3.0.0-20180411.183355-618.jar&data=02%7C01%7Cricky.baker%40ttu.edu%7Cd0c5b1bd1d64483bd0c308d5a0804f7f%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C636591395311661285&sdata=tj6SObbOC12JjlwVHJ%2BTgRSX9aBJvzBXsdfZeMl%2Bst0%3D&reserved=0
>>> 
>>> 
>>>> 
>>>> Wed Apr 11 18:33:57 UTC 2018
>>>> 
>>>> 2584679
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Ricky
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -----Original Message-----
>>>> From: Maruan Sahyoun <sahy...@fileaffairs.de>
>>>> Sent: Thursday, April 12, 2018 8:32 AM
>>>> To: users@pdfbox.apache.org
>>>> Subject: Re: flatten specific fields in a pdf
>>>> 
>>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> 
>>>> 
>>>>> Am 12.04.2018 um 15:28 schrieb Baker, Ricky 
>>>>> <ricky.ba...@ttu.edu<mailto:ricky.ba...@ttu.edu>>:
>>>> 
>>>>> 
>>>> 
>>>>> Maruan, I do not see PDFBOX 3.0.0 on the PDFBOX download page. Where can 
>>>>> I get it?
>>>> 
>>>> 
>>>> 
>>>> You need to download a development snapshot from 
>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Frepository.apache.org%2Fcontent%2Fgroups%2Fsnapshots%2Forg%2Fapache%2Fpdfbox%2F&data=02%7C01%7Cricky.baker%40ttu.edu%7C30f179f424d6470de0aa08d5a079cea6%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C636591367376358147&sdata=T6wC2x0K8AxMiSXJ9NbNIlmWdjVSS6HIasLiaJW32Uc%3D&reserved=0
>>>>  sepcifically 
>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Frepository.apache.org%2Fcontent%2Fgroups%2Fsnapshots%2Forg%2Fapache%2Fpdfbox%2Fpdfbox%2F3.0.0-SNAPSHOT%2F&data=02%7C01%7Cricky.baker%40ttu.edu%7C30f179f424d6470de0aa08d5a079cea6%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C636591367376358147&sdata=V4Cp2X2b2MkfTs74UsO1qTQTwLBYmRzuEA85f8aytJk%3D&reserved=0
>>>> 
>>>> 
>>>> 
>>>> Sroll down to get the latest build from yesterday.
>>>> 
>>>> 
>>>> 
>>>> Please let me know if there are issues with that.
>>>> 
>>>> 
>>>> 
>>>> BR
>>>> 
>>>> Maruan
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> 
>>>> 
>>>>> Thanks
>>>> 
>>>>> Ricky
>>>> 
>>>>> 
>>>> 
>>>>> 
>>>> 
>>>>> -----Original Message-----
>>>> 
>>>>> From: Maruan Sahyoun 
>>>>> <sahy...@fileaffairs.de<mailto:sahy...@fileaffairs.de>>
>>>> 
>>>>> Sent: Wednesday, April 11, 2018 3:08 AM
>>>> 
>>>>> To: users@pdfbox.apache.org<mailto:users@pdfbox.apache.org>
>>>> 
>>>>> Subject: Re: flatten specific fields in a pdf
>>>> 
>>>>> 
>>>> 
>>>>> I've just commited the change to PDFBox 3.0.0 - see details in 
>>>>> PDFBOX-3809. Please test with that version and let me know if that works 
>>>>> for you. If it's fine I'll also implement the change for 2.0.
>>>> 
>>>>> 
>>>> 
>>>>> BR
>>>> 
>>>>> Maruan
>>>> 
>>>>> 
>>>> 
>>>>>> Am 10.04.2018 um 16:56 schrieb Baker, Ricky 
>>>>>> <ricky.ba...@ttu.edu<mailto:ricky.ba...@ttu.edu>>:
>>>> 
>>>>>> 
>>>> 
>>>>>> Maruan, have you had an opportunity to look at the flatten for specific 
>>>>>> fields?
>>>> 
>>>>>> 
>>>> 
>>>>>> Thanks
>>>> 
>>>>>> ricky
>>>> 
>>>>>> 
>>>> 
>>>>>> -----Original Message-----
>>>> 
>>>>>> From: Baker, Ricky
>>>> 
>>>>>> Sent: Monday, April 2, 2018 12:52 PM
>>>> 
>>>>>> To: 'users@pdfbox.apache.org' 
>>>>>> <users@pdfbox.apache.org<mailto:users@pdfbox.apache.org>>
>>>> 
>>>>>> Subject: RE: flatten specific fields in a pdf
>>>> 
>>>>>> 
>>>> 
>>>>>> Maruan, I added the pdf and a word doc showing a screen shot of some
>>>> 
>>>>>> of the fields to PDFBOX-3809
>>>> 
>>>>>> 
>>>> 
>>>>>> thanks
>>>> 
>>>>>> Ricky
>>>> 
>>>>>> 
>>>> 
>>>>>> 
>>>> 
>>>>>> 
>>>> 
>>>>>> -----Original Message-----
>>>> 
>>>>>> From: Maruan Sahyoun 
>>>>>> <sahy...@fileaffairs.de<mailto:sahy...@fileaffairs.de>>
>>>> 
>>>>>> Sent: Sunday, April 1, 2018 12:24 PM
>>>> 
>>>>>> To: users@pdfbox.apache.org<mailto:users@pdfbox.apache.org>
>>>> 
>>>>>> Subject: Re: flatten specific fields in a pdf
>>>> 
>>>>>> 
>>>> 
>>>>>> Could you add a sample PDF and the list of fields you'd like to get
>>>> 
>>>>>> flattened to
>>>> 
>>>>>> 
>>>> 
>>>>>>       • PDFBOX-3809
>>>> 
>>>>>> 
>>>> 
>>>>>> I'll look to get something done but that's based on the requirements 
>>>>>> that all fields and their annotations need to be properly defined i.e. 
>>>>>> have the pages they relate to set etc.
>>>> 
>>>>>> 
>>>> 
>>>>>> BR
>>>> 
>>>>>> Maruan
>>>> 
>>>>>> 
>>>> 
>>>>>> 
>>>> 
>>>>>>> Am 01.04.2018 um 16:02 schrieb Tilman Hausherr 
>>>>>>> <thaush...@t-online.de<mailto:thaush...@t-online.de>>:
>>>> 
>>>>>>> 
>>>> 
>>>>>>> Known bug :-(
>>>> 
>>>>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fiss
>>>> 
>>>>>>> ues.apache.org%2Fjira%2Fbrowse%2FPDFBOX-3809&data=02%7C01%7Cricky.ba
>>>> 
>>>>>>> ker%40ttu.edu%7C46e2d9b7e87d4c4c8f6a08d597f5724a%7C178a51bf8b2049ffb
>>>> 
>>>>>>> 65556245d5c173c%7C0%7C1%7C636582002816162481&sdata=3r5VDNmYuyBQOr%2F
>>>> 
>>>>>>> 7OmtcVWjilFGtaFbBD4vXIFlX2VA%3D&reserved=0
>>>> 
>>>>>>> 
>>>> 
>>>>>>> Tilman
>>>> 
>>>>>>> 
>>>> 
>>>>>>> Am 30.03.2018 um 20:02 schrieb Baker, Ricky:
>>>> 
>>>>>>>> I have tried using the flatten for specific fields but it flattens all 
>>>>>>>> fields even when I only pass in one  PDField. Can someone point me to 
>>>>>>>> a working example?
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> public void
>>>> 
>>>>>>>> flatten(List<https://na01.safelinks.protection.outlook.com/?url=htt
>>>> 
>>>>>>>> p%3A%2F%2Fdownload.oracle.com%2Fjavase%2F1.6.0%2Fdocs%2Fapi%2Fjava%
>>>> 
>>>>>>>> 2Futil%2FList.html%3Fis-external%3Dtrue&data=02%7C01%7Cricky.baker%
>>>> 
>>>>>>>> 40ttu.edu%7C46e2d9b7e87d4c4c8f6a08d597f5724a%7C178a51bf8b2049ffb655
>>>> 
>>>>>>>> 56245d5c173c%7C0%7C1%7C636582002816162481&sdata=xRt17TzZraSs5iZvMTV
>>>> 
>>>>>>>> M%2BT6lJhUqQaAFLGSK4SfUWGI%3D&reserved=0><PDField<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fna01.safe&data=02%7C01%7Cricky.baker%40ttu.edu%7Cd0c5b1bd1d64483bd0c308d5a0804f7f%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C636591395311661285&sdata=7XHcpd1PROU22OZqbhjpZdnRZvIidlbDOlUMY%2F5sJVc%3D&reserved=0
>>>> 
>>>>>>>> links.protection.outlook.com/?url=https%3A%2F%2Fpdfbox.apache.org%2
>>>> 
>>>>>>>> Fdocs%2F2.0.7%2Fjavadocs%2Forg%2Fapache%2Fpdfbox%2Fpdmodel%2Fintera
>>>> 
>>>>>>>> ctive%2Fform%2FPDField.html&data=02%7C01%7Cricky.baker%40ttu.edu%7C
>>>> 
>>>>>>>> 46e2d9b7e87d4c4c8f6a08d597f5724a%7C178a51bf8b2049ffb65556245d5c173c
>>>> 
>>>>>>>> %7C0%7C1%7C636582002816172489&sdata=ksC3C1itEatd18%2B5XCFpzayUK6YQO
>>>> 
>>>>>>>> sH8%2Fidomr1Lt3s%3D&reserved=0>> fields,
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>>      boolean refreshAppearances)
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>>        throws
>>>> 
>>>>>>>> IOException<https://na01.safelinks.protection.outlook.com/?url=http
>>>> 
>>>>>>>> %3A%2F%2Fdownload.oracle.com%2Fjavase%2F1.6.0%2Fdocs%2Fapi%2Fjava%2
>>>> 
>>>>>>>> Fio%2FIOException.html%3Fis-external%3Dtrue&data=02%7C01%7Cricky.ba
>>>> 
>>>>>>>> ker%40ttu.edu%7C46e2d9b7e87d4c4c8f6a08d597f5724a%7C178a51bf8b2049ff
>>>> 
>>>>>>>> b65556245d5c173c%7C0%7C1%7C636582002816172489&sdata=05r6c92%2BC2303
>>>> 
>>>>>>>> zUtStQRukNryOvkIXJcU8jZ5eLYFOM%3D&reserved=0>
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> This will flatten the specified form fields.
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> Thanks
>>>> 
>>>>>>>> Ricky Baker
>>>> 
>>>>>>>> 
>>>> 
>>>>>>>> 
>>>> 
>>>>>>> 
>>>> 
>>>>>>> 
>>>> 
>>>>>>> --------------------------------------------------------------------
>>>> 
>>>>>>> - To unsubscribe, e-mail: 
>>>>>>> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org>
>>>> 
>>>>>>> For additional commands, e-mail: 
>>>>>>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org>
>>>> 
>>>>>>> 
>>>> 
>>>>>> 
>>>> 
>>>>>> 
>>>> 
>>>>>> ---------------------------------------------------------------------
>>>> 
>>>>>> To unsubscribe, e-mail: 
>>>>>> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org>
>>>> 
>>>>>> For additional commands, e-mail: 
>>>>>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org>
>>>> 
>>>>>> 
>>>> 
>>>>>> 
>>>> 
>>>>>> ---------------------------------------------------------------------
>>>> 
>>>>>> To unsubscribe, e-mail: 
>>>>>> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org>
>>>> 
>>>>>> For additional commands, e-mail: 
>>>>>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org>
>>>> 
>>>>>> 
>>>> 
>>>>> 
>>>> 
>>>>> 
>>>> 
>>>>> ---------------------------------------------------------------------
>>>> 
>>>>> To unsubscribe, e-mail: 
>>>>> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org>
>>>> 
>>>>> For additional commands, e-mail: 
>>>>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org>
>>>> 
>>>>> 
>>>> 
>>>>> 
>>>> 
>>>>> ---------------------------------------------------------------------
>>>> 
>>>>> To unsubscribe, e-mail: 
>>>>> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org>
>>>> 
>>>>> For additional commands, e-mail: 
>>>>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org>
>>>> 
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> 
>>>> To unsubscribe, e-mail: 
>>>> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org>
>>>> 
>>>> For additional commands, e-mail: 
>>>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org>
>>>> 
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
>>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
>>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
> For additional commands, e-mail: users-h...@pdfbox.apache.org
> 


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

Reply via email to