Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
616 views
in Technique[技术] by (71.8m points)

pdf generation - XSL-FO fop. Long text flows into adjacent cells/block, obscuring stuff there

Could anyone suggest me a way to make long words (like serial numbers) to be wrapped? I tried some commercial software and there is no such issue. Is it a fop bug or probably there is a solution available?

I can't insert zero length space after each character of every word in document. This solution sounds insane for me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can specify the wrap-option attribute in your fo:block like so:

<fo:block wrap-option="wrap"> ... stuff </fo:block>

Here's the XSL-FO specification for this attribute:

XSL Definition:

Value: no-wrap | wrap | inherit

Initial: wrap

Applies to: fo:block, fo:inline, fo:page-number, fo:page-number-citation

Inherited: yes

Percentages: N/A

Media: visual

Values have the following meanings:

no-wrap

No line-wrapping will be performed.

In the case when lines are longer than the available width of the content-rectangle, the overflow will be treated in accordance with the "overflow" property specified on the reference-area.

wrap

Line-breaking will occur if the line overflows the available block width. No special markers or other treatment will occur.

Specifies how line-wrapping (line-breaking) of the content of the formatting object is to be handled.

Implementations must support the "no-wrap" value, as defined in this Recommendation, when the value of "linefeed-treatment" is "preserve".

You can also define the wrap-option attribute in an fo:table-cell

<fo:table-cell wrap-option="wrap"> ... </fo:table-cell>

and the fo:blocks within will inherit the property.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...