[ 
https://issues.apache.org/jira/browse/PDFBOX-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14346817#comment-14346817
 ] 

Maruan Sahyoun commented on PDFBOX-1402:
----------------------------------------

I've added an initial version of a formatter for multiline text.
 - uses font.encode() to encode a string
 - uses some code from PDPageContentStream to avoid raw commands (shall be 
moved into a joint class later)
 - uses BreakIterator to get line breaking candidates instead of relying on the 
space character
 - uses AttributedString (although limited to width) to handle additional 
properties. To be extended especially for Bidi support.
hopefully that's a good start to do further enhancements.

I'll now look into bringing in some of the changes [~oliverHofmann] proposed.

There are still a number of features missing but thought I'll commit anyway as 
it already addresses some of the current issues.

> Improve handling of multiline text boxes
> ----------------------------------------
>
>                 Key: PDFBOX-1402
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1402
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: AcroForm
>    Affects Versions: 1.7.1
>            Reporter: Will May
>            Assignee: Maruan Sahyoun
>              Labels: Appearance
>             Fix For: 2.0.0
>
>         Attachments: automatic-font-size-calculation.patch, multiLine.patch, 
> multiline_linebreaks_alignment.patch, multiline_positioning.patch, 
> pdf-sample-fields-out.pdf, pdf-sample-fields.filled.pdf, pdf-sample-fields.pdf
>
>
> The current implementation for setting the appearance of content that is 
> added to a multiline text box is incorrect in a number of ways:
> * Doesn't position the start of the text in the correct location
> * Incorrectly uses font size '0' instead of auto-sizing the font
> * Doesn't break up very long lines
> * If the font size is very large, then the next line is started too close to 
> the previous line.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to