Hi, > Am 05.05.2015 um 11:59 schrieb Gilad Denneboom <[email protected]>: > > Correct. And in some of the cases (example1) I can't even edit the form > fields properly after inserting the file to another PDF.
reason is that importPage/addPage add the page content but not the form fields. You'd need to add the AcroForms manually (potentially looking at which PDWidgetAnnotations are really pointing at the page you are adding) BR Maruan > > On Tue, May 5, 2015 at 11:55 AM, Maruan Sahyoun <[email protected]> > wrote: > >> Hi Gilad, >> >>> Am 05.05.2015 um 11:45 schrieb Gilad Denneboom < >> [email protected]>: >>> >>> Hi Maruan, >>> >>> Sure, here they are... >>> >>> Gilad >>> >>> batch_sequences 1.pdf >>> < >> https://docs.google.com/file/d/0B_eBFHMNjkhsNmlPNjJMcTJVXzQ/edit?usp=drive_web >>> >>> >>> Input form.pdf >>> < >> https://docs.google.com/file/d/0B_eBFHMNjkhsaWlHbmYzSEFpX0U/edit?usp=drive_web >>> >>> >>> >>> On Tue, May 5, 2015 at 11:36 AM, Maruan Sahyoun <[email protected]> >>> wrote: >>> >>>> Hi Gilad, >>>> >>>>> Am 05.05.2015 um 11:30 schrieb Gilad Denneboom < >>>> [email protected]>: >>>>> >>>>> Hi guys, >>>>> >>>>> This should be a simple task, but it turns out to be quite a complex >> and >>>>> problematic one, I'm afraid... >>>>> I'm trying to combine two files, one with a bunch of form fields in it >> (a >>>>> single page, created in Acrobat) and one without any fields. I have >> tried >>>>> doing it using three different methods, and all three have failed, in >>>>> various ways. >>>>> >>>>> Method 1: PDDocument importPage >>>>> I tried importing the page with the form fields into the existing >> files. >>>>> The page is placed at the end of the document (I need it at the >>>> start...), >>>>> but that's not the big issue. The big issue is that although the page >>>> with >>>>> the form fields is added to the file, the PDAcroForm in the new file is >>>>> null and I'm having weird problems editing the form fields in Acrobat >>>> (see >>>>> "example1.pdf", try to make a selection in one of the drop-downs in >>>>> Acrobat). >>>>> >>>>> Method 2: PDDocument addPage (how is this different from importPage, by >>>> the >>>>> way? The documentation is very lacking on this point. Also, why isn't >> it >>>>> possible to specify the page number where you want to insert the new >>>> page?) >>>>> The result is similar to importPage, only now I am able to make a >>>> selection >>>>> in the drop-down fields in Acrobat, but they are still not picked up by >>>>> PDFBox when I re-load the file and try to access them (see >>>> "example2.pdf"). >>>>> >>>>> Method 3: PDFMergerUtililty >>>>> In order to get the right page order I decided to merge the files >> instead >>>>> of adding one to the other. >>>>> Here the PDAcroForm object does exist in the merged files, but the >> values >>>>> of the fields are not picked up. Using getValue on the fields returns >> the >>>>> default value for the drop-downs and null for the text fields, even >>>> though >>>>> they are clearly filled-in (see "example3.pdf"). >> >> So what you are saying is that looking at the form with Adobe Reader the >> form is fine but trying to get the value using PDFBox you are not getting >> the value you are looking for? >> >> BR >> Maruan >> >> >>>>> >>>>> Any help is appreciated… >>>> >>>> Could you also upload the individual files prior to merging? >>>> >>>> BR >>>> Maruan >>>> >>>> >>>>> >>>>> Regards, Gilad. >>>>> >>>>> example1.pdf >>>>> < >>>> >> https://docs.google.com/file/d/0B_eBFHMNjkhscDdvcGhXNjRMZ28/edit?usp=drive_web >>>>> >>>>> >>>>> example2.pdf >>>>> < >>>> >> https://docs.google.com/file/d/0B_eBFHMNjkhsck9RSTlNTWFtaHc/edit?usp=drive_web >>>>> >>>>> >>>>> example3.pdf >>>>> < >>>> >> https://docs.google.com/file/d/0B_eBFHMNjkhsQXBRdVdDMGkyR2s/edit?usp=drive_web >>>>> >>>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: [email protected] >>>> >>>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

