pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilad Denneboom <gilad.denneb...@gmail.com>
Subject Re: PDFBox form fields help
Date Fri, 10 Jun 2011 08:31:48 GMT
Sorry about that... I wasn't aware of the mailinglist.

I've tried adding the widget to the page annotations list, but to no avail.
Here's the code I've used to create the field:
        PDTextbox textField = new
        PDRectangle rect = new PDRectangle();
        rect.setLowerLeftX((float) 88.14579772949219);
        rect.setLowerLeftY((float) 394.781005859375);
        rect.setUpperRightX((float) 232.9340057373047);
        rect.setUpperRightY((float) 416.5929870605469);
        textField.setValue("some text");

I then tried adding it to the acroform/page in various ways:
        PDPage page0 = (PDPage)
This yielded no results.


When I run any of these lines the field is added (I checked the length of
the getFields()), and in Acrobat I can see (through the JS console) that
there's a field called "Text1" with the correct value, but the field is not
visible, and I get the aforementioned error messages about it being

PS - is there a web interface for these mailing-lists? Like Google Groups?


2011/6/10 Andreas Lehmkühler <andreas@lehmi.de>

> Hi Gilad,
> please don't contact the developers directly. Adress your questions to the
> mailinglists, so that everybody from the community has the chance to help
> and to learn as well.
> I've cc'd my answer to the users-list.
> Am 09.06.11 12:10, schrieb Gilad Denneboom:
>  Hi Andreas,
>> Thanks for helping out with the issues I've created for PDFBox.
>> I would really appreciate it if you could help me out with the
>> following: I'm trying to add form fields to a file using PDFBox and am
>> having a lot of problems with it. I was unable to find any real examples
>> on how it should be done, neither online or in the example packages.
>> The closest I've come so far is in the attached file. When I open the
>> result PDF in Acrobat, though, I can't see the field. When I open the JS
>> console it says "Some fields are malformed, and may not work as
>> expected. Please contact the author for a fix".
>> I am then able to execute getField("Text1").value and get the value I've
>> set, but most other properties and methods fail.
>> Any help you can offer will be greatly appreciated, and I might even
>> create an example class for the next release of PDFBox, if you think
>> it's a good idea...
> I'm not an acroform expert but you have to link the new field to the page
> it should be rendered on. I guess it has to be done by using an annotation
> widget.
> A simple example woiuld be great.
> BR
> Andreas Lehmkühler

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