xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matthias reinert <matthias.rein...@web.de>
Subject Re: Footnotes in RTF
Date Mon, 07 Nov 2005 07:23:05 GMT
RTF not supported in fop0.20.5....

I tried to get accomplished with the source of the trunk-snapshot last weekend 
and I found that RTF is working but seemed not to render
- footnotes
- tables result in 1 column in openoffice (tables which eaxctly showed 2 
columns in Word97)
and for PDF: foonote-mark but no footnote-body if footnote is within a 

For the footnotes in RTF I would propose the follwing code-update for the 
class RTFHandler.java. It could produce some footnote code, which shows up in 
openoffice and word97 as footnote, but I was unsure if it fits with any of 
Your code guidelines and design concepts (not to say quite sure that it fits 
not...) Hence I wouldnt dare to submit this to existing code. In addition to 
that errors in my .fo test docs cn't be excluded.

For the difference between Word97 and OpenOffice ~rendering~ of RTF-Tables I 
think it is related to Word2000 table-peculiarities stated in the 
Msdn-RTF-Reference as word200 expects the row Properties at the end of a row 
and I guess  openoffice is following the word2000 path and word97 has some 
kind of backward compatibility.

Anyway. The code is great and its fun to ~play~ with it, but quite hard to 
grasp the concept and to debug (for beginner like me;). 

Thanks for your help
Yours, Matthias

Heres the diff ouptut (includes some superfluous debug output lines) "fixing" 
the footnote in RTF. I found that the Footnote FONode Object had no childs 
and called them explicitly. This would damage the design schema I guess.

Index: src/java/org/apache/fop/render/rtf/RTFHandler.java
--- src/java/org/apache/fop/render/rtf/RTFHandler.java  (Revision 331154)
+++ src/java/org/apache/fop/render/rtf/RTFHandler.java  (Arbeitskopie)
@@ -1385,11 +1391,20 @@
             recurseFONode( item.getLabel());
             recurseFONode( item.getBody());
+        } else if (foNode instanceof Footnote) {
+            Footnote fn = (Footnote) foNode;
+            recurseFONode( fn.getFootnoteCitation() );
+            recurseFONode( fn.getFootnoteBody() );            
         } else {
             //Any other FO-Object: Simply recurse through all childNodes.
             if (foNode.getChildNodes() != null) {
-                for (Iterator it = foNode.getChildNodes(); it.hasNext();) {
-                    recurseFONode( (FONode) it.next() );                
+                for (Iterator it = foNode.getChildNodes(); it.hasNext();) {   
+                    FONode fn = (FONode) it.next();
+                    log.warn("  ChildNode for " + fn + " (" + fn.getName() + 
")"); //
+                    // recurseFONode( (FONode) it.next() );              
+                    recurseFONode( fn );                        

Am Montag, 7. November 2005 09:57 schrieb Jeremias Maerki:
> On 01.11.2005 20:53:24 J.Pietschmann wrote:
> > matthias reinert wrote:
> > > using the snapshot
> > > http://cvs.apache.org/snapshots/fop/fop_20051101053804.tar.gz
> > > I ran into problems with footnotes in RTF. The given examples worked
> > > well for PDF output but in RTF footnotes were not rendered.
> >
> > The RTF renderer in the development snapshot is rather incomplete.
> > You could try the stable release (0.20.5)
> Uhm, there's no RTF support in 0.20.5!!!
> BTW, there's some code in there that is supposed to handle footnotes but
> it seems it is currently not properly working. It probably needs some
> work. Help welcome.
> Jeremias Maerki
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message