[
https://issues.apache.org/jira/browse/PDFBOX-2627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14290015#comment-14290015
]
John Hewson edited comment on PDFBOX-2627 at 1/23/15 9:40 PM:
--------------------------------------------------------------
{quote}
Acrobat applies a padding dependent on the width of the border before placing
the text. I’ve already put that in as part of my previous work on appearance
generation but the current code is not very clean as that has been put in to
fix some restrictions in 1.8. For 2.0 I think it makes sense to have a better
approach. That’s were the box model requirement came from.
{quote}
That's not a box model. A _box model_ is a very specific thing: it's when you
have styled, _nested_ boxes. It does not mean adding a border or padding around
a single block of text. You can trivially do that _after_ the text has been
composed - no need for box models.
{quote}
Paragraph separation needs to be done as one can put a CR into a fields value
which will be a paragraph separator. There is a slight difference in how
Acrobat handles spacing between paragraphs and lines so that has to be taken
into account.
{quote}
Ok, you will need to handle CR as a paragraph then. I'm not sure what you mean
by "slight difference in how Acrobat handles spacing between paragraphs and
lines"? Line spacing is a constant value measured in em.
{quote}
Vertical alignment is not needed for multiline text but for single line text as
the text is vertically centered in the box. So the composer would be able to be
used for that.
{quote}
Again, as with the box model, this is not what vertical alignment means,
because you're not dealing with nested boxes, or any kind of vertical styled
layout. What you're talking about is simply placing text in the middle of a
rectangle, which is done _after_ the text has been composed.
Come to think of it, are you sure that Acrobat supports vertically centred
text? I don't see that in the spec? or is that just what happens if you
specific a large single-line text field with a small text size? Either way,
this is not going to be part of your text compositor, but a trivial calculation
which is done afterwards.
was (Author: jahewson):
{quote}
Acrobat applies a padding dependent on the width of the border before placing
the text. I’ve already put that in as part of my previous work on appearance
generation but the current code is not very clean as that has been put in to
fix some restrictions in 1.8. For 2.0 I think it makes sense to have a better
approach. That’s were the box model requirement came from.
{quote}
That's not a box model. A _box model_ is a very specific thing: it's when you
have styled, _nested_ boxes. It does not mean adding a border or padding around
a single block of text. You can trivially do that _after_ the text has been
composed - no need for box models.
{quote}
Paragraph separation needs to be done as one can put a CR into a fields value
which will be a paragraph separator. There is a slight difference in how
Acrobat handles spacing between paragraphs and lines so that has to be taken
into account.
{quote}
Ok, you will need to handle CR as a paragraph then. I'm not sure what you mean
by "light difference in how Acrobat handles spacing between paragraphs and
lines"? Line spacing is a constant value measured in em.
{quote}
Vertical alignment is not needed for multiline text but for single line text as
the text is vertically centered in the box. So the composer would be able to be
used for that.
{quote}
Again, as with the box model, this is not what vertical alignment means,
because you're not dealing with nested boxes, or any kind of vertical styled
layout. What you're talking about is simply placing text in the middle of a
rectangle, which is done _after_ the text has been composed.
Come to think of it, are you sure that Acrobat supports vertically centred
text? I don't see that in the spec? or is that just what happens if you
specific a large single-line text field with a small text size? Either way,
this is not going to be part of your text compositor, but a trivial calculation
which is done afterwards.
> Add block composer to handle multiline text
> -------------------------------------------
>
> Key: PDFBOX-2627
> URL: https://issues.apache.org/jira/browse/PDFBOX-2627
> Project: PDFBox
> Issue Type: Sub-task
> Components: AcroForm
> Affects Versions: 2.0.0
> Reporter: Maruan Sahyoun
> Fix For: 2.0.0
>
>
> In order to generate the appearance for multiline text a *basic* plain text
> block composer needs to be developed.
> Features
> - box model
> - paragraph separation
> - line breaking
> - horizontal and vertical alignment
> - font setting, line height …
> Conceptually it should also include writing mode likely with the only initial
> implementation being lr-tb.
> There should be no new dependencies on projects such as ICU which will limit
> the capabilities but should be acceptable to the needs of form filling.
> To not create the *false* assumption that this is a generic composer it will
> be sub packaged within the (AcroForms) forms package(s).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)