pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: Migrate form field entries from one pdf to another
Date Mon, 29 Jun 2015 12:03:47 GMT
Hi,

<snip>
>>> 
>>> 
>> 
>> 
>> getValue and getOnValue/getOffValue return different settings of the
>> field. getValue works on the field dictionaries 'V' entry whereas
>> getOnValue/getOffValue look at the fields appearance settings.
>> 
> 
> This explains the code in PDFBox, thanks. Unfortunately, within two days, I
> suspect I can't really understand the PDF standard to the degree necessary
> to pose intelligent questions.

what you are finding is that different PDF software might work differently. Some set the value
some don't. Some need it some don't.

> 
> 
>> Normally when a checkbox is checked the fields value AND the appearance
>> need to be updated. This is not the case with your form. How was the value
>> of the original form set? Which software?
>> 
> 
> The value set in the form is by simply clicking it in Adobe Acrobat
> (Reader). It sets the field accordingly, nevertheless for a set field,
> getValue() still returns null. The forms themselves were created with
> InDesign, I think. Not sure though. So, you're kind of implying that
> independent of the field type (Textbox, PrintButton, Checkbox,
> Radiobutton), PDFBox would normally expect the value of a field to be !null?

I did a quick test with a newly created form using Adobe Acrobat and setting the checkbox
also with Acrobat. There the value is not null when the checkbox has been checked.


> 
> How could I deal with this? Because this is exactly what seems to fail and
> also cause this dreaded exception message when trying to fill out the forms
> with anything other than PDTextbox.

Without looking at the form:

a) test if getValue returns null if not take that value
b) if it returns null test if the box has been checked - if yes take that value.

use the value retrieved from a) or b) to set the fields value in the pdf template.

What would be helpful is either a screenshot of the form fields entries using the PDFDebugger
[http://pdfbox.apache.org/1.8/commandline.html#pdfDebugger] or the printout of the fields
getDictionary() method so there is some more information about how the field definition looks
lie. Best would be to have the form of course.


> 
> Would anybody here be willing to have a Skype or Teamviewer session with me
> tonight or tomorrow night to have a look at the problem? We're willing to
> pay for such support. If so, please send a private message to me, so we
> don't clutter this mailing list.

I'm currently on travel so won't be able to do that.

> 
> Best regards
> Roberto
> 
> ps.: I didn't expect PDF to be so intricately complex ... it hides well
> behind the tools which just seem to always work in conjunction with PDF.


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


Mime
View raw message