Here is another idea. Its is more hacky, but it never hurts to have options.

You could build your XSL-FO document in memory. Use something similar to the
simple.fo from the examples as a base.

You could create a method using regex to determine when you have hit 80
characters as you process your text. Each 80 character block would have its
own fo:block.

Once you have created the document you could convert it to an input source
like this:

String fo_source = "the entire FO-Document you have built in memory
including your text broken into blocks";
Reader rIn = new StringReader(fo_source);
InputSource in = new InputSource(rIn);

Now you have something you can generate a document with.

Just an idea.

Luke


----- Original Message ----- 
From: "Mike Trotman" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, April 21, 2005 2:32 PM
Subject: Re: Basic help needed


> I haven't tried this - so it's purely theoretical and I'm just thinking
> aloud.
>
> To have wrapping at 80 characters look nice - use a fixed pitch font.
> To get your text to wrap - and obey justification and hyphenation if you
> want it,
> you want to produce it inside something where you can specify an width
> of 80em (or whatever the unit / scaling is for a single character width
> in the current font).
> although you could just calculate the page width and specify it in
> normal units (and read no further)
>
> If you want to do it to cope with differing numbers of characters page
> widths  and /or different fixed pitch font sizes
> then - maybe a single column table with the specified em width and with
> the font attribute set (? on the table or cell or on a enclosing block -
> I've never been exactly sure what gets inherited)
>
> However - if your document is long with only automatic page breaks then
> this sounds horribly inefficient
> - but I can't think of anything else where you could set the width based
> on the font used at that point in the document and still give you the
> normal flow benefits.
>
> Mike
>
> Ashley Martens wrote:
>
> >I trying to convert a simple text document, with no line feeds, into a
simple PDF that is wrapped at 80 characters. Can anyone suggest the FO
syntax to do this?
> >
> >E-Mail Confidentiality Notification
> >
> >-----------------------------------
> >
> >This e-mail message (and any associated files) contains information from
Associated Software Consultants (ASC), Inc. and is intended only for the use
of the individual or entity to which it is addressed and may contain
information that is confidential, subject to copyright or constitutes a
trade secret. If you are not the intended recipient you are hereby notified
that any dissemination, copying or distribution of this message, or files
associated with this message, is strictly prohibited. If you have received
this message in error, please notify us immediately by replying to the
message and deleting it from your computer. Messages sent to and from us may
be monitored.
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 20/04/2005
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to