pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Examples of word-wrapping
Date Fri, 17 May 2019 17:26:26 GMT
Am 17.05.2019 um 15:54 schrieb Christopher Schultz:
> It occurs to me that my code is doing more work than necessary to
> print paragraphs, and that maybe manual word-wrapping is not
> necessary. Are there any examples that show how to print a paragraph
> of text without having to compute the width of text and manually chop
> things up into lines? Or is that part of the price of PDF?

There is no feature in PDF that does automatic word wrap. Yes you have 
to do it yourself.

There is a class in the PDFBox source code, PlainTextFormatter, that can 
also do it, but it was designed for form fields. It is used in 
AppearanceGeneratorHelper. You'd have to copy  the code, it is not public.


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

View raw message