You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Shawn Oplinger - NOAA Affiliate <sh...@noaa.gov.INVALID> on 2018/09/10 19:41:30 UTC
Text not wrapping on a fillable PDF field
Hi,
I have a fillable PDF form, that I am using PDFBox to successfully populate
with text values from my database.
I have one field however, that can contain up to 2,000 characters.
Using Adobe Acrobat Pro 2017, I set the field to "Multi-line", so that long
text will wrap instead of truncating. (see screenshot below).
If I paste 2,000 characters into the form field, using Adobe Acrobat, the
text successfully wraps, and I can see all 2,000 characters in the PDF form
field.
When I use PDFBox however to populate the field with 2,000 characters, the
text does not wrap, and just truncates when it gets to the edge of the form
field in the PDF.
I upgraded to PDFBox version 2.0.11, based on Tilman's recommendation to a
similar issue I found on StackOverFlow:
https://stackoverflow.com/questions/51161660/pdfbox-fill-pdtextbox-in-pdf-with-word-wrap
-But after upgrading, the text still does not wrap, it just truncates when
it reaches the edge of the form field.
Any suggestions on how to get the text to wrap?
Thanks,
Shawn
--
Shawn Oplinger
Systems Integration & Development, Inc. (SID)
National Oceanic and Atmospheric Administration
Email: Shawn.Oplinger@noaa.gov
Phone: 301-427-8844
Cell: 571-274-8078
Re: Text not wrapping on a fillable PDF field
Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,
> Am 10.09.2018 um 21:41 schrieb Shawn Oplinger - NOAA Affiliate <sh...@noaa.gov.INVALID>:
>
> Hi,
>
> I have a fillable PDF form, that I am using PDFBox to successfully populate with text values from my database.
>
> I have one field however, that can contain up to 2,000 characters.
> Using Adobe Acrobat Pro 2017, I set the field to "Multi-line", so that long text will wrap instead of truncating. (see screenshot below).
>
> If I paste 2,000 characters into the form field, using Adobe Acrobat, the text successfully wraps, and I can see all 2,000 characters in the PDF form field.
>
> When I use PDFBox however to populate the field with 2,000 characters, the text does not wrap, and just truncates when it gets to the edge of the form field in the PDF.
>
would it be possible to share the PDF? Please store it at a public location as the mailing list doesnât support attachments.
BR
Maruan
> I upgraded to PDFBox version 2.0.11, based on Tilman's recommendation to a similar issue I found on StackOverFlow:
> https://stackoverflow.com/questions/51161660/pdfbox-fill-pdtextbox-in-pdf-with-word-wrap
>
> -But after upgrading, the text still does not wrap, it just truncates when it reaches the edge of the form field.
>
> Any suggestions on how to get the text to wrap?
>
> Thanks,
> Shawn
>
>
>
>
> --
> Shawn Oplinger
> Systems Integration & Development, Inc. (SID)
> National Oceanic and Atmospheric Administration
> Email: Shawn.Oplinger@noaa.gov
> Phone: 301-427-8844
> Cell: 571-274-8078
Re: Text not wrapping on a fillable PDF field
Posted by Shawn Oplinger <sh...@gmail.com>.
Thanks Maruan and Tillman,
The solution was in Tillman's referenced Jira issue:
https://issues.apache.org/jira/browse/PDFBOX-3835
In the comments, there was a comment that "if you add spaces it will work"
-My test string of 2,000 characters did not have any spaces (dumb mistake
on my part).
After adding spaces, the text correctly wraps.
Thanks very much guys for your response pointing me to a solution!
Shawn
On Mon, Sep 10, 2018 at 4:50 PM Tilman Hausherr <TH...@t-online.de>
wrote:
> Your image didn't get through.
>
> I wonder if it is this issue?
> https://issues.apache.org/jira/browse/PDFBOX-3835
>
> Tilman
>
> Am 10.09.2018 um 21:41 schrieb Shawn Oplinger - NOAA Affiliate:
> > Hi,
> >
> > I have a fillable PDF form, that I am using PDFBox to successfully
> > populate with text values from my database.
> >
> > I have one field however, that can contain up to 2,000 characters.
> > Using Adobe Acrobat Pro 2017, I set the field to "Multi-line", so that
> > long text will wrap instead of truncating. (see screenshot below).
> >
> > If I paste 2,000 characters into the form field, using Adobe Acrobat,
> > the text successfully wraps, and I can see all 2,000 characters in the
> > PDF form field.
> >
> > When I use PDFBox however to populate the field with 2,000 characters,
> > the text does not wrap, and just truncates when it gets to the edge of
> > the form field in the PDF.
> >
> > I upgraded to PDFBox version 2.0.11, based on Tilman's recommendation
> > to a similar issue I found on StackOverFlow:
> >
> https://stackoverflow.com/questions/51161660/pdfbox-fill-pdtextbox-in-pdf-with-word-wrap
> >
> > -But after upgrading, the text still does not wrap, it just truncates
> > when it reaches the edge of the form field.
> >
> > Any suggestions on how to get the text to wrap?
> >
> > Thanks,
> > Shawn
> >
> >
> >
> >
> > --
> > Shawn Oplinger
> > Systems Integration & Development, Inc. (SID)
> > National Oceanic and Atmospheric Administration
> > Email: Shawn.Oplinger@noaa.gov <ma...@noaa.gov>
> > Phone: 301-427-8844 <tel:301-427-8844>
> > Cell: 571-274-8078 <tel:571-274-8078>
>
>
>
Re: Text not wrapping on a fillable PDF field
Posted by Tilman Hausherr <TH...@t-online.de>.
Your image didn't get through.
I wonder if it is this issue?
https://issues.apache.org/jira/browse/PDFBOX-3835
Tilman
Am 10.09.2018 um 21:41 schrieb Shawn Oplinger - NOAA Affiliate:
> Hi,
>
> I have a fillable PDF form, that I am using PDFBox to successfully
> populate with text values from my database.
>
> I have one field however, that can contain up to 2,000 characters.
> Using Adobe Acrobat Pro 2017, I set the field to "Multi-line", so that
> long text will wrap instead of truncating. (see screenshot below).
>
> If I paste 2,000 characters into the form field, using Adobe Acrobat,
> the text successfully wraps, and I can see all 2,000 characters in the
> PDF form field.
>
> When I use PDFBox however to populate the field with 2,000 characters,
> the text does not wrap, and just truncates when it gets to the edge of
> the form field in the PDF.
>
> I upgraded to PDFBox version 2.0.11, based on Tilman's recommendation
> to a similar issue I found on StackOverFlow:
> https://stackoverflow.com/questions/51161660/pdfbox-fill-pdtextbox-in-pdf-with-word-wrap
>
> -But after upgrading, the text still does not wrap, it just truncates
> when it reaches the edge of the form field.
>
> Any suggestions on how to get the text to wrap?
>
> Thanks,
> Shawn
>
>
>
>
> --
> Shawn Oplinger
> Systems Integration & Development, Inc. (SID)
> National Oceanic and Atmospheric Administration
> Email: Shawn.Oplinger@noaa.gov <ma...@noaa.gov>
> Phone: 301-427-8844 <tel:301-427-8844>
> Cell: 571-274-8078 <tel:571-274-8078>