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 Tue, 30 Jun 2015 13:06:15 GMT
Hi,

> Am 30.06.2015 um 10:21 schrieb Roberto Nibali <rnibali@gmail.com>:
> 
> Hello
> 
> Thanks for the answers. I have attached two PDFs by hopefully removing all traces that
could violate the NDA, which I can't get to work.
> 
> >> 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.
> 
> I have attached now PDFs, where with my tool the value is null.


unfortunately the attachments didn't make it through the mailing list. Could you upload them
to a public location?

BR
Maruan

> 
> > 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.
> 
> Which value?
>  
> use the value retrieved from a) or b) to set the fields value in the pdf template.
> 
> I'm not sure which value you mean.
>  
> 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 <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.
> 
> Attached. Also you can find the code here: http://pastebin.com/Ra0ebSis <http://pastebin.com/Ra0ebSis>.
Let me know if something else is needed.
> 
> The idea is that you call it with the template TestTemplate.pdf and the input PDF Test.pdf,
resulting in an output PDF that is a carbon-copy of the input PDF, but with the template PDF
CI/CD (in my test case they are identical, but it serves the purpose).
>  
> >
> > 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
> 
> Thanks, anybody else?
> 
> Cheers
> Roberto
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message