pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: PDFBox "helper" to create a form
Date Wed, 30 Mar 2016 20:08:16 GMT
Hi,

> Am 30.03.2016 um 21:52 schrieb Al Grant <bigal.nz@gmail.com>:
> 
> Thanks Maruan
> 
> So there is no way for Pdfbox to update a open pdf form?
> 
> The process would look like :
> 
> 1.User opens form and starts to fill out in reader
> 2. Just gets to ID field and puts in ID number and a form button submits ID
> via html to listener application which gets name Address etc back from
> database
> 3. This information is then used to update the still open form.
> 

If you'd like to do it via PDFBox then populate the PDF with the new data on the server and
serve back the populated PDF form. This response will replace the PDF in Adobe Reader. But
as you already have the form open in Adobe Reader you can return the pure data (FDF, XFDF)
and Adobe Reader does the update for you. There are also some more fine grained options like
doing a web request and parse the response using JavaScript and as I outlined earlier you
could use your browser - if the PDF is hosted in a web page - as a proxy.

From what you are writing above the easiest is to do a submit and return FDF/XFDF. 

BR
Maruan



> Step 3 seems to be the step from your previous answer that is not possible,
> unless there is a way with pdfbox?
> 
> Cheers
> 
> Al
> On 31/03/2016 8:41 am, "Maruan Sahyoun" <sahyoun@fileaffairs.de> wrote:
> 
>> Hi,
>> 
>>> Am 30.03.2016 um 20:25 schrieb Tilman Hausherr <THausherr@t-online.de>:
>>> 
>>> Am 30.03.2016 um 20:21 schrieb Al Grant:
>>>> Yes
>>> 
>>> Don't know / never observed this. The only thing I can think of is
>> related to "submit", I think this was discussed in an earlier answer.
>>> 
>>> Tilman
>>> 
>>>> On 31/03/2016 6:35 am, "Tilman Hausherr" <THausherr@t-online.de> wrote:
>>>> 
>>>>> Am 30.03.2016 um 19:27 schrieb Al Grant:
>>>>> 
>>>>>> I assume the value of the fields in a form cannot be updated while
the
>>>>>> form
>>>>>> is open?
>>>>>> 
>> 
>> 
>> I'm not sure why you'd like to do that - maybe you can explain that in a
>> little more detail.
>> 
>> Options you have are instead of opening a PDF opening a FDF, XFDF or XDP
>> (XML Data Package, not to be confused with a LiveCycle Designer Form File
>> which is also called XDP!) containing the data and the form (or a link to
>> it). Adobe Reader will open the form and update the fields with the values
>> supplied in the data files.
>> 
>> For 'real time' updates there is also an option but for that the Adobe
>> Reader must be run in a hosting environment such as a web browser. The you
>> can use a JavaScript Bridge between the hosting environment and the Adobe
>> Reader. E.g. your web browser could be connected to a web socket doing live
>> update between the browser and the socket with the browser in turn
>> forwarding the data to the PDF. The same way a user entry in the PDF could
>> be reflected back.
>> 
>> All of that is not really related to PDFBox, which - as outlined before -
>> would populate the form with the data before it's opened by Adobe Reader.
>> 
>> One thing to keep in mind is that the JavaScript Bridge is available in
>> Adobe Reader and Adobe Acrobat only which will limit your PDF viewer
>> options which may or may not be important for your application.
>> 
>> BR
>> Maruan
>> 
>> 
>>>>> You mean, while the form is displayed in Adobe Reader?
>>>>> 
>>>>> Tilman
>>>>> 
>>>>> 
>>>>>> On Wed, Mar 30, 2016 at 8:44 PM, Al Grant <bigal.nz@gmail.com>
wrote:
>>>>>> 
>>>>>> Yeah. That's pretty much what I plan to do.
>>>>>>> Just checking my method.
>>>>>>> 
>>>>>>> Thanks.
>>>>>>> On 30/03/2016 8:43 pm, "Tilman Hausherr" <THausherr@t-online.de>
>> wrote:
>>>>>>> 
>>>>>>> Am 30.03.2016 um 09:21 schrieb Al Grant:
>>>>>>>> Hi Tilman
>>>>>>>>> My bad. The form already exists.
>>>>>>>>> 
>>>>>>>>> Is more about filling it out progmatically from the database.
>>>>>>>>> 
>>>>>>>>> I can use any version of Pdfbox.
>>>>>>>>> 
>>>>>>>>> Then get the field, and use setValue(). See e.g. the
FillFormField
>>>>>>>> example in the source code download, or the SetField example.
>>>>>>>> 
>>>>>>>> 
>>>>>>>>             // Retrieve an individual field and set it's
value.
>>>>>>>>             PDTextField field = (PDTextField) acroForm.getField(
>>>>>>>> "sampleField" );
>>>>>>>>             field.setValue("Text Entry");
>>>>>>>> 
>>>>>>>>             // If a field is nested within the form tree
a fully
>>>>>>>> qualified name
>>>>>>>>             // might be provided to access the field.
>>>>>>>>             field = (PDTextField) acroForm.getField(
>>>>>>>> "fieldsContainer.nestedSampleField" );
>>>>>>>>             field.setValue("Text Entry");
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Tilman
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Regards
>>>>>>>>> Al
>>>>>>>>> On 30/03/2016 8:12 pm, "Tilman Hausherr" <THausherr@t-online.de>
>>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>> Am 30.03.2016 um 08:57 schrieb Al Grant:
>>>>>>>>> 
>>>>>>>>>> Hi All,
>>>>>>>>>> 
>>>>>>>>>>> I am looking for a way to get a PDF Form to be
partly populated
>> from
>>>>>>>>>>> a
>>>>>>>>>>> database.
>>>>>>>>>>> 
>>>>>>>>>>> Is your question how to create a form dynamically,
or how to
>> fill an
>>>>>>>>>>> 
>>>>>>>>>> existing form? What PDFBox version are you using?
>>>>>>>>>> 
>>>>>>>>>> Tilman
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> The database is propriety and I will scrape the data,
then use
>> PDFBox
>>>>>>>>>> to
>>>>>>>>>> 
>>>>>>>>>>> generate a copy of the form with some of the
fields filled out
>> with
>>>>>>>>>>> the
>>>>>>>>>>> relevant information that was previously scraped.
>>>>>>>>>>> 
>>>>>>>>>>> Does anyone see any issues with this?
>>>>>>>>>>> 
>>>>>>>>>>> The environment is XP, and it only has to work
across a company
>> LAN.
>>>>>>>>>>> 
>>>>>>>>>>> Regards,
>>>>>>>>>>> 
>>>>>>>>>>> Al
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>> ---------------------------------------------------------------------
>>>>>>>>>>> 
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>> 
>>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>> 
>> 


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


Mime
View raw message