You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by ausj81 ausj81 <au...@hotmail.com> on 2007/07/18 18:45:27 UTC
fop cutting off lines - way to force wrap around?
Hi, I'm using fop with an xsl to convert xml documents (although the main
part of the xml to be converted is just html markup) to pdf. It is also
using unicode font to convert special/foreign characters. The problem is
that if it encounters lines without spaces that overflow the margins, it
cuts it off - fop error output gives "area contents overflows area in line
<text>" when it encounters this. This isn't a problem for western language
docs since they will have spaces between words and so it won't be a huge
string that gets cut off. But eastern languages are not working properly
since the paragraphs are just one long continuous string.
The characters are encoded as entities in the xml so
ampersand#x30a6;ampersand#x30a7;... and so on but they don't have spaces in
them at all and so lines are always getting cutoff in the pdf when it runs
out of space. So like a whole paragraph will just have maybe the first 1 or
2 lines max of a paragraph show up on the pdf before hitting the margin end
and not wrapping around to show the rest of the lines forming the paragraph
because there are no spaces/breaks within the paragraph. Then because there
is a break between paragraphs, it will again just show the first line of the
second paragraph and so on throughout the document so like 80% of the
document could potentially not be showing up since you only get the first
couple of lines of each paragraph.
Is there a way to get the text to wrap around (like it does in web browsers)
or something rather than just overflowing/truncating? I've tried changing
the layout of the pdf from portrait to landscape and that adds about 25%
more characters, but still cuts off a lot. Thanks.
_________________________________________________________________
Local listings, incredible imagery, and driving directions - all in one
place! http://maps.live.com/?wip=69&FORM=MGAC01
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop cutting off lines - way to force wrap around?
Posted by ausj81 ausj81 <au...@hotmail.com>.
Thanks for the reply Andreas - I had already considered option a but was
hoping there was a way around having to parse the body since it'd be a
headache but might have to grit my teeth and do it.
Does anyone know if the wrap-option="wrap" property put in an fo:block works
in 0.93 or 0.92? I am currently using 0.25 (and wrap-option doesn't seem to
work there - I put wrap-option="wrap" and still get the same overflow errors
and lines cutoff with japanese/korean/chinese documents), and know I will
have to spend quite a bit of time reworking my code if I upgrade since a lot
of the api has been changed from 0.25 and don't want to do that unless the
wrap-option functions correctly (which would be worth the upgrade trouble as
opposed to the "parse body and insert break characters where appropriate"
method which seems to be the only other alternative unless I'm missing
something). Thanks for any input.
>From: Andreas L Delmelle <a_...@pandora.be>
>Reply-To: fop-users@xmlgraphics.apache.org
>To: fop-users@xmlgraphics.apache.org
>Subject: Re: fop cutting off lines - way to force wrap around?
>Date: Wed, 18 Jul 2007 20:53:19 +0200
>
>On Jul 18, 2007, at 18:45, ausj81 ausj81 wrote:
>
>Hi
>
><snip />
>>The characters are encoded as entities in the xml so
>>ampersand#x30a6;ampersand#x30a7;... and so on but they don't have spaces
>>in them at all and so lines are always getting cutoff in the pdf when it
>>runs out of space.
>
>Indeed. Maybe your particular case isn't covered by the implementation
>yet, but normally FOP supports Unicode compliant line- breaking.
>IOW: if Unicode says "no break", then FOP says "no break", unless XSL- FO
>specific properties force it otherwise.
>
>If the rules for the languages you are using are covered by FOP's
>implementation of UAX#14, then the only valid ways around it are:
>
>a) pre-process the text, and insert characters that generate legal
>break-opportunities
>b) use the XSL-FO wrap-option="wrap" property on the surrounding fo:block
>
>Unfortunately, last I checked, b) was either unimplemented or broken in
>FOP 0.93 and the Trunk, so a) would be the only solution... but before you
>start working on that, I hope someone chimes in who can confirm with
>certainty that it is not merely a limitation in FOP's current
>implementation.
>
>
>Cheers
>
>Andreas
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
_________________________________________________________________
Now you can see troubleĀ
before he arrives
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_0507
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop cutting off lines - way to force wrap around?
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jul 18, 2007, at 18:45, ausj81 ausj81 wrote:
Hi
<snip />
> The characters are encoded as entities in the xml so
> ampersand#x30a6;ampersand#x30a7;... and so on but they don't have
> spaces in them at all and so lines are always getting cutoff in the
> pdf when it runs out of space.
Indeed. Maybe your particular case isn't covered by the
implementation yet, but normally FOP supports Unicode compliant line-
breaking.
IOW: if Unicode says "no break", then FOP says "no break", unless XSL-
FO specific properties force it otherwise.
If the rules for the languages you are using are covered by FOP's
implementation of UAX#14, then the only valid ways around it are:
a) pre-process the text, and insert characters that generate legal
break-opportunities
b) use the XSL-FO wrap-option="wrap" property on the surrounding
fo:block
Unfortunately, last I checked, b) was either unimplemented or broken
in FOP 0.93 and the Trunk, so a) would be the only solution... but
before you start working on that, I hope someone chimes in who can
confirm with certainty that it is not merely a limitation in FOP's
current implementation.
Cheers
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org