FOP: RTF page breaks

2007-01-31 Thread freem

Hi.
I have some problems with page breaks in rtf format.
Also i'm found at Mailing list
archivehttp://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200606.mbox/[EMAIL
 PROTECTED]that
this feature just not implemented for rtf yet.
So, can you please sugest, how i can implement it my self ?
Where exactly placed RTF render driver ?
And maybe, even, where need to add page breaks processing ?

--
Ни что в жизни не даётся так легко как хотелось-бы...


Re: FOP: RTF page breaks

2007-01-31 Thread Jeremias Maerki
All the RTF code is under src/java/org/apache/fop/render/rtf.
The package org.apache.fop.render.rtf contains the FOEventHandler that
converts the FO tree into RTF by using the RTF library which is in the
package org.apache.fop.render.rtf.rtflib.

It's a good idea to get a copy of Microsoft's RTF specification:
http://www.microsoft.com/downloads/details.aspx?FamilyID=e5b8ebc2-6ad6-49f0-8c90-e4f763e3f04fDisplayLang=en

Look for \pagebb in the spec which provides break-before
functionality. \page is a required page break. I haven't looked
into which command will be best to get the right result. I assume \page
is thing to look into. There are already some classes which deal with
page breaks, particularly \page. See RtfPageBreak.java and
IRtfPageBreakContainer. RtfParagraph.java contains a method
newPageBreak(). This at least indicates that the RTF library itself
knows how to create page breaks.

The next thing is to figure out how and where to call this functionality
from the RTFHandler. I'd start by experimenting with
RTFHandler.startBlock (or endBlock). The formatting object (Block.java
and other block-level FOs!!!) will contain methods like getBreakBefore()
and getBreakAfter(). The method result will be one of the EN_ constants
defined in org.apache.fop.fo.Constants as documented in the XSL-FO spec.

That should get you going. We're looking forward to your patch.

On 31.01.2007 09:57:14 freem wrote:
 Hi.
 I have some problems with page breaks in rtf format.
 Also i'm found at Mailing list
 archivehttp://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200606.mbox/[EMAIL
  PROTECTED]that
 this feature just not implemented for rtf yet.
 So, can you please sugest, how i can implement it my self ?
 Where exactly placed RTF render driver ?
 And maybe, even, where need to add page breaks processing ?
 



Jeremias Maerki