DO NOT REPLY [Bug 30138] - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer [EMAIL PROTECTED] changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2004-07-17 13:25 --- Hi, this error was caused by the fact, that the rtf renderer did not set an rtf style to the list. I've set the bullet list as default style, so the processing of your file should not crash anymore. But it may not look like you expect. Guess i have to invest some time in support for lists in near future. I set this bug to FIXED. Kind regards Peter Herweg
DO NOT REPLY [Bug 30138] - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer --- Additional Comments From [EMAIL PROTECTED] 2004-07-17 14:20 --- Vielen Dank, Herr Herweg. Ich bin sehr froh, dass dieser Bug nicht mein Fehler war! ;) Glen
DO NOT REPLY [Bug 30138] New: - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer Summary: NullPointerException in rtf-renderer Product: Fop Version: 1.0dev Platform: PC OS/Version: Linux Status: NEW Severity: Major Priority: Other Component: general AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] When trying to convert the attached fo-file to rtf using the fop.sh shell script, the renderer reproducingly crashes with the following NullPointerException: Exception in thread main java.lang.NullPointerException at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListTable.writeListTableEntry(RtfListTable.java:191) at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListTable.writeRtfContent(RtfListTable.java:136) at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement.writeRtf(RtfElement.java:86) at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer.writeRtfContent(RtfContainer.java:135) at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement.writeRtf(RtfElement.java:86) at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer.writeRtfContent(RtfContainer.java:135) at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement.writeRtf(RtfElement.java:86) at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile.flush(RtfFile.java:219) at org.apache.fop.render.rtf.RTFHandler.endDocument(RTFHandler.java:157) at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:224) at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(Unknown Source) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.fop.apps.Driver.render(Driver.java:230) at org.apache.fop.apps.Driver.render(Driver.java:203) at org.apache.fop.apps.Fop.main(Fop.java:57) - The code base is that of 2004-07-16 around 9.00 MEZ (head). Commenting out the offending line 191 in RtfListTable caused the conversion to run through, though resulting in not conformant rtf. The same file converted OK with a fop version that was approximately three months old (also head). The fo is produced using the current docbook stylesheets, originating from a docbook source.
DO NOT REPLY [Bug 30138] - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer --- Additional Comments From [EMAIL PROTECTED] 2004-07-16 07:49 --- Created an attachment (id=12125) fo file that causes the bug
DO NOT REPLY [Bug 30138] - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID Summary|NullPointerException in rtf-|NullPointerException in rtf- |renderer|renderer --- Additional Comments From [EMAIL PROTECTED] 2004-07-16 10:43 --- Marc Your input FO File isn't working on my machine because it's requesting a lot of graphics that you did not attach. I'm getting too many other errors. I asked you for a minimal FO file to reproduce the error. You sent me a 910-line file that's requesting several graphics instead. Note: do not attach the graphics, rather, again, reduce the FO to its minimal size that causes this error to occur. When you're willing to do so, please re-open this bug--your FO file you send us should probably be under 150 lines. Glen
DO NOT REPLY [Bug 30138] - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|CLOSED --- Additional Comments From [EMAIL PROTECTED] 2004-07-16 10:56 --- Marc, I added a NPE check to the code, the error should no longer occur. The code in question was added 4 months, 10 days ago. There may be other formatting problems still, however, if that is the case please reopen the bug or create new ones as appropriate. Glen
DO NOT REPLY [Bug 30138] - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer [EMAIL PROTECTED] changed: What|Removed |Added Status|CLOSED |REOPENED Resolution|INVALID | --- Additional Comments From [EMAIL PROTECTED] 2004-07-16 13:10 --- Thanks for your help. Unfortunately, the error persists also with the new version. I've attached a slashed down version of bug.fo (some 180 lines) that still produces the same NullPointerException.
DO NOT REPLY [Bug 30138] - NullPointerException in rtf-renderer
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30138. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30138 NullPointerException in rtf-renderer --- Additional Comments From [EMAIL PROTECTED] 2004-07-16 13:12 --- Created an attachment (id=12127) Slashed down version of bug.fo
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/09/21 15:21:11 Modified:src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: reset background-color for each paragraph, submitted by Peter Herweg, see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23302 Revision ChangesPath 1.24 +8 -3 xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- RTFHandler.java 19 Sep 2003 18:27:59 - 1.23 +++ RTFHandler.java 21 Sep 2003 22:21:11 - 1.24 @@ -689,6 +689,12 @@ rtfAttr.set(rtfValue); } +/** + * Reads background-color from bl and writes it to rtfAttr. + * + * @param bl the Block object the properties are read from + * @param rtfAttr the RtfAttributes object the attributes are written to + */ private void attrBlockBackgroundColor(Block bl, RtfAttributes rtfAttr) { ColorType fopValue = bl.properties.get(background-color).getColorType(); int rtfColor = 0; @@ -696,12 +702,11 @@ actually a transparent black, which is generally not suitable as a default here. Changing FOP's default to white causes problems in PDF output, so we will look for the default here change it to - white. */ + auto. */ if ((fopValue.getRed() == 0) (fopValue.getGreen() == 0) (fopValue.getBlue() == 0) (fopValue.getAlpha() == 0)) { -rtfColor = RtfColorTable.getInstance().getColorNumber(white).intValue(); +rtfColor = 0; //=auto currentRTFBackgroundColor = -1; -return; } else { rtfColor = convertFOPColorToRTF(fopValue); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/09/19 11:17:40 Modified:src/java/org/apache/fop/fo FOInputHandler.java FOTreeHandler.java src/java/org/apache/fop/fo/flow PageNumber.java src/java/org/apache/fop/fo/pagination PageSequence.java src/java/org/apache/fop/mif MIFHandler.java src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: add support for xsl-region-before, xsl-region-after and fo:page-number tag, submitted by Peter Herweg, see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23274 Revision ChangesPath 1.10 +17 -1 xml-fop/src/java/org/apache/fop/fo/FOInputHandler.java Index: FOInputHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOInputHandler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- FOInputHandler.java 16 Sep 2003 17:33:06 - 1.9 +++ FOInputHandler.java 19 Sep 2003 18:17:40 - 1.10 @@ -61,6 +61,7 @@ import org.apache.fop.fo.flow.Leader; import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; +import org.apache.fop.fo.flow.PageNumber; import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableColumn; import org.apache.fop.fo.flow.TableBody; @@ -131,6 +132,21 @@ public abstract void endPageSequence(PageSequence pageSeq) throws FOPException; /** + * + * @param pagenum PageNumber that is starting. + */ +public abstract void startPageNumber(PageNumber pagenum); + +/** + * + * @param pagenum PageNumber that is ending. + */ +public abstract void endPageNumber(PageNumber pagenum); + +/** + * This method is called to indicate the start of a new fo:flow or fo:static-content. + * This method also handles fo:static-content tags, because the StaticContent class + * is derived from the Flow class. * * @param fl Flow that is starting. */ 1.9 +15 -1 xml-fop/src/java/org/apache/fop/fo/FOTreeHandler.java Index: FOTreeHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- FOTreeHandler.java16 Sep 2003 17:33:06 - 1.8 +++ FOTreeHandler.java19 Sep 2003 18:17:40 - 1.9 @@ -65,6 +65,7 @@ import org.apache.fop.fo.flow.Leader; import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; +import org.apache.fop.fo.flow.PageNumber; import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableColumn; import org.apache.fop.fo.flow.TableBody; @@ -514,4 +515,17 @@ } } +/** + * + * @param pagenum PageNumber that is starting. + */ +public void startPageNumber(PageNumber pagenum) { +} + +/** + * + * @param pagenum PageNumber that is ending. + */ +public void endPageNumber(PageNumber pagenum) { +} } 1.16 +19 -0 xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java Index: PageNumber.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- PageNumber.java 19 Sep 2003 14:33:15 - 1.15 +++ PageNumber.java 19 Sep 2003 18:17:40 - 1.16 @@ -50,6 +50,11 @@ */ package org.apache.fop.fo.flow; +// XML +import org.xml.sax.Attributes; + +// FOP +import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.ColorType; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FOTreeVisitor; @@ -146,4 +151,18 @@ fotv.servePageNumber(this); } +/** + * @see org.apache.fop.fo.FObj#handleAttrs + */ +public void handleAttrs(Attributes attlist) throws FOPException { +super.handleAttrs(attlist); + +setup(); + +getFOTreeControl().getFOInputHandler().startPageNumber(this); +} + +protected void end() { +getFOTreeControl().getFOInputHandler().endPageNumber(this); +} } 1.14 +4 -0 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java Index: PageSequence.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- PageSequence.java 16 Sep 2003 05:21:06 - 1.13 +++ PageSequence.java 19 Sep 2003 18:17:40 -
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/09/19 11:27:59 Modified:src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: style changes only Revision ChangesPath 1.23 +72 -61xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- RTFHandler.java 19 Sep 2003 18:17:40 - 1.22 +++ RTFHandler.java 19 Sep 2003 18:27:59 - 1.23 @@ -115,15 +115,15 @@ private RtfDocumentArea docArea; private RtfParagraph para; private boolean warned = false; -private boolean bPrevHeaderSpecified=false;//true, if there has been a - //header in any page-sequence -private boolean bPrevFooterSpecified=false;//true, if there has been a - //footer in any page-sequence +private boolean bPrevHeaderSpecified = false;//true, if there has been a + //header in any page-sequence +private boolean bPrevFooterSpecified = false;//true, if there has been a + //footer in any page-sequence private boolean bHeaderSpecified = false; //true, if there is a header //in current page-sequence private boolean bFooterSpecified = false; //true, if there is a footer //in current page-sequence -private BuilderContext m_context = new BuilderContext(null); +private BuilderContext builderContext = new BuilderContext(null); private static final String ALPHA_WARNING = WARNING: RTF renderer is + veryveryalpha at this time, see class org.apache.fop.rtf.renderer.RTFHandler; @@ -136,6 +136,7 @@ /** * Creates a new RTF structure handler. + * @param doc the Document for which this RTFHandler is processing * @param os OutputStream to write to */ public RTFHandler(Document doc, OutputStream os) { @@ -178,10 +179,10 @@ public void startPageSequence(PageSequence pageSeq) { try { sect = docArea.newSection(); -m_context.pushContainer(sect); +builderContext.pushContainer(sect); -bHeaderSpecified=false; -bFooterSpecified=false; +bHeaderSpecified = false; +bFooterSpecified = false; } catch (IOException ioe) { // FIXME could we throw Exception in all FOInputHandler events? log.error(startPageSequence: + ioe.getMessage()); @@ -193,7 +194,7 @@ * @see org.apache.fop.fo.FOInputHandler#endPageSequence(PageSequence) */ public void endPageSequence(PageSequence pageSeq) throws FOPException { -m_context.popContainer(); +builderContext.popContainer(); } /** @@ -205,20 +206,24 @@ // if there is no header in current page-sequence but there has been // a header in a previous page-sequence, insert an empty header. if (bPrevHeaderSpecified !bHeaderSpecified) { -RtfAttributes attr=new RtfAttributes(); +RtfAttributes attr = new RtfAttributes(); attr.set(RtfBefore.HEADER); -final IRtfBeforeContainer contBefore = (IRtfBeforeContainer)m_context.getContainer(IRtfBeforeContainer.class,true,this); +final IRtfBeforeContainer contBefore = +(IRtfBeforeContainer)builderContext.getContainer +(IRtfBeforeContainer.class, true, this); contBefore.newBefore(attr); } // if there is no footer in current page-sequence but there has been // a footer in a previous page-sequence, insert an empty footer. if (bPrevFooterSpecified !bFooterSpecified) { -RtfAttributes attr=new RtfAttributes(); +RtfAttributes attr = new RtfAttributes(); attr.set(RtfAfter.FOOTER); -final IRtfAfterContainer contAfter = (IRtfAfterContainer)m_context.getContainer(IRtfAfterContainer.class,true,this); +final IRtfAfterContainer contAfter = +(IRtfAfterContainer)builderContext.getContainer +(IRtfAfterContainer.class, true, this); contAfter.newAfter(attr); } @@ -227,40 +232,44 @@ sect.newParagraph().newText
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/09/16 10:33:07 Modified:src/java/org/apache/fop/fo FOInputHandler.java FOTreeHandler.java src/java/org/apache/fop/mif MIFHandler.java src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: add structure for handling table columns in fo/FOInputHandler and its subclasses -- submitted by Peter Herweg, see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23085 Revision ChangesPath 1.9 +14 -1 xml-fop/src/java/org/apache/fop/fo/FOInputHandler.java Index: FOInputHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOInputHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- FOInputHandler.java 1 Sep 2003 19:21:07 - 1.8 +++ FOInputHandler.java 16 Sep 2003 17:33:06 - 1.9 @@ -62,6 +62,7 @@ import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; import org.apache.fop.fo.flow.Table; +import org.apache.fop.fo.flow.TableColumn; import org.apache.fop.fo.flow.TableBody; import org.apache.fop.fo.flow.TableCell; import org.apache.fop.fo.flow.TableRow; @@ -166,6 +167,18 @@ * @param tbl Table that is ending. */ public abstract void endTable(Table tbl); + +/** + * + * @param tc TableColumn that is starting; + */ +public abstract void startColumn(TableColumn tc); + +/** + * + * @param tc TableColumn that is ending; + */ +public abstract void endColumn(TableColumn tc); /** * 1.8 +16 -1 xml-fop/src/java/org/apache/fop/fo/FOTreeHandler.java Index: FOTreeHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeHandler.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- FOTreeHandler.java22 Aug 2003 17:21:48 - 1.7 +++ FOTreeHandler.java16 Sep 2003 17:33:06 - 1.8 @@ -66,6 +66,7 @@ import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; import org.apache.fop.fo.flow.Table; +import org.apache.fop.fo.flow.TableColumn; import org.apache.fop.fo.flow.TableBody; import org.apache.fop.fo.flow.TableCell; import org.apache.fop.fo.flow.TableRow; @@ -247,6 +248,20 @@ * @see org.apache.fop.fo.FOInputHandler#endTable(Table) */ public void endTable(Table tbl) { +} + +/** + * + * @param tc TableColumn that is starting; + */ +public void startColumn(TableColumn tc) { +} + +/** + * + * @param tc TableColumn that is ending; + */ +public void endColumn(TableColumn tc) { } /** 1.12 +15 -0 xml-fop/src/java/org/apache/fop/mif/MIFHandler.java Index: MIFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/mif/MIFHandler.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- MIFHandler.java 20 Aug 2003 18:09:45 - 1.11 +++ MIFHandler.java 16 Sep 2003 17:33:06 - 1.12 @@ -73,6 +73,7 @@ import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; import org.apache.fop.fo.flow.Table; +import org.apache.fop.fo.flow.TableColumn; import org.apache.fop.fo.flow.TableBody; import org.apache.fop.fo.flow.TableCell; import org.apache.fop.fo.flow.TableRow; @@ -234,6 +235,20 @@ * @see org.apache.fop.fo.FOInputHandler#endTable(Table) */ public void endTable(Table tbl) { +} + +/** + * + * @param tc TableColumn that is starting; + */ +public void startColumn(TableColumn tc) { +} + +/** + * + * @param tc TableColumn that is ending; + */ +public void endColumn(TableColumn tc) { } /** 1.19 +15 -0 xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- RTFHandler.java 16 Sep 2003 14:50:16 - 1.18 +++ RTFHandler.java 16 Sep 2003 17:33:07 - 1.19 @@ -66,6 +66,7 @@ import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; import org.apache.fop.fo.flow.Table; +import org.apache.fop.fo.flow.TableColumn; import org.apache.fop.fo.flow.TableBody; import org.apache.fop.fo.flow.TableCell; import org.apache.fop.fo.flow.TableRow; @@ -249,6 +250,20
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/09/09 07:31:08 Modified:src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: add support for font-size and font-weight, as per patch from Peter Herweg (mailto:[EMAIL PROTECTED]) Revision ChangesPath 1.17 +18 -0 xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- RTFHandler.java 1 Sep 2003 01:28:51 - 1.16 +++ RTFHandler.java 9 Sep 2003 14:31:08 - 1.17 @@ -186,6 +186,9 @@ RtfAttributes rtfAttr = new RtfAttributes(); attrBlockTextAlign(bl, rtfAttr); attrBlockBackgroundColor(bl, rtfAttr); +attrBlockFontSize(bl, rtfAttr); +attrBlockFontWeight(bl, rtfAttr); + para = sect.newParagraph(rtfAttr); } catch (IOException ioe) { // FIXME could we throw Exception in all FOInputHandler events? @@ -397,6 +400,21 @@ } catch (IOException ioe) { // FIXME could we throw Exception in all FOInputHandler events? throw new Error(IOException: + ioe); +} +} + +private void attrBlockFontSize(Block bl, RtfAttributes rtfAttr){ +int fopValue = bl.properties.get(font-size).getLength().getValue()/500; +rtfAttr.set(fs,fopValue); +} + +private void attrBlockFontWeight(Block bl, RtfAttributes rtfAttr){ +String fopValue = bl.properties.get(font-weight).getString(); +if(fopValue==bold || fopValue==700){ +rtfAttr.set(b,1); +} +else{ +rtfAttr.set(b,0); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
gmazza 2003/08/31 18:28:51 Modified:src/java/org/apache/fop/area CachedRenderPagesModel.java src/java/org/apache/fop/datatypes ColorType.java src/java/org/apache/fop/fo PropertyManager.java src/java/org/apache/fop/render AbstractRenderer.java src/java/org/apache/fop/render/awt AWTRenderer.java src/java/org/apache/fop/render/pdf PDFRenderer.java src/java/org/apache/fop/render/ps PSRenderer.java src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: 1. Partial implementation of fo:region-xxx and background-color property in AWTRenderer. 2. ColorType has a new getAWTColor() method, also alpha() function renamed to getAlpha(). Definition of Alpha values switched to make consistent with java.awt.Color (i.e., 0 is transparent and 1 is opaque). 3. AbstractRenderer's handleViewportTraits() renamed to handleRegionTraits() to lesson confusion (FOP has three types of viewports-- Page, Region, and Block--handleViewportTraits() was only good for Region.) Revision ChangesPath 1.2 +1 -1 xml-fop/src/java/org/apache/fop/area/CachedRenderPagesModel.java Index: CachedRenderPagesModel.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/CachedRenderPagesModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CachedRenderPagesModel.java 11 Mar 2003 13:05:27 - 1.1 +++ CachedRenderPagesModel.java 1 Sep 2003 01:28:51 - 1.2 @@ -68,7 +68,7 @@ * A simple cached render pages model. * If the page is prepared for later rendering then this saves * the page contents to a file and once the page is resolved - * the contents a reloaded. + * the contents are reloaded. */ public class CachedRenderPagesModel extends RenderPagesModel { private Map pageMap = new HashMap(); 1.3 +20 -9 xml-fop/src/java/org/apache/fop/datatypes/ColorType.java Index: ColorType.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/ColorType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ColorType.java5 Jul 2003 03:23:23 - 1.2 +++ ColorType.java1 Sep 2003 01:28:51 - 1.3 @@ -50,6 +50,7 @@ */ package org.apache.fop.datatypes; +import java.awt.Color; import java.io.Serializable; import java.util.StringTokenizer; @@ -61,22 +62,24 @@ /** * the red component */ -protected float red; +protected float red = 0f; /** * the green component */ -protected float green; +protected float green = 0f; /** * the blue component */ -protected float blue; +protected float blue = 0f; /** - * the alpha component + * the alpha component (indicator of opaque-ness) + * 0.0 - 1.0; 0.0 is completely transparent; 1.0 is completely opaque + * see definition at http://java.sun.com/j2se/1.3/docs/api/java/awt/Color.html */ -protected float alpha = 0; +protected float alpha = 1f; /** * Main constructor @@ -177,7 +180,7 @@ this.red = 0; this.green = 0; this.blue = 0; -this.alpha = 1; +this.alpha = 0; } else { boolean found = false; for (int count = 0; count NAMES.length; count++) { @@ -225,11 +228,19 @@ } /** - * Returns the alpha (transparency) component of the color. - * @return float a value between 0.0 and 1.0 + * Returns the alpha (degree of opaque-ness) component of the color. + * @return float a value between 0.0 (fully transparent) and 1.0 (fully opaque) */ -public float alpha() { +public float getAlpha() { return this.alpha; +} + +/** + * Returns an AWT instance of this color + * @return float the AWT color represented by this ColorType instance + */ +public Color getAWTColor() { +return new Color(this.red, this.green, this.blue, this.alpha); } /** 1.12 +1 -1 xml-fop/src/java/org/apache/fop/fo/PropertyManager.java Index: PropertyManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyManager.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- PropertyManager.java 24 Aug 2003 17:46:10 - 1.11 +++ PropertyManager.java 1 Sep 2003 01:28:51 - 1.12 @@ -337,7 +337,7
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/08/11 23:18:43 Modified:src/java/org/apache/fop/apps Driver.java src/java/org/apache/fop/extensions Bookmarks.java src/java/org/apache/fop/fo FOInputHandler.java FOTreeHandler.java src/java/org/apache/fop/mif MIFHandler.java src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: 1. convert fo.FOTreeHandler to fire events when it completes a PageSequence or document object 2. move logic that starts layout from fo.FOTreeHandler to apps.Driver. 3. add logic to apps.Driver to handle the events fired from fo.FOTreeHandler 4. end result is that FOTreeHandler now allows other objects to handle page-sequence and document objects in a manner similar to the way SAX allows them to handle XML elements. Revision ChangesPath 1.21 +58 -4 xml-fop/src/java/org/apache/fop/apps/Driver.java Index: Driver.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Driver.java 11 Aug 2003 18:08:06 - 1.20 +++ Driver.java 12 Aug 2003 06:18:43 - 1.21 @@ -51,11 +51,17 @@ package org.apache.fop.apps; // FOP +import org.apache.fop.area.AreaTree; +import org.apache.fop.area.AreaTreeModel; import org.apache.fop.fo.ElementMapping; import org.apache.fop.fo.FOTreeBuilder; import org.apache.fop.fo.FOUserAgent; import org.apache.fop.fo.FOInputHandler; import org.apache.fop.fo.FOTreeHandler; +import org.apache.fop.fo.FOTreeListener; +import org.apache.fop.fo.FOTreeEvent; +import org.apache.fop.area.Title; +import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.mif.MIFHandler; import org.apache.fop.render.Renderer; import org.apache.fop.render.awt.AWTRenderer; @@ -128,7 +134,7 @@ * driver.render(parser, fileInputSource(args[0])); * /PRE */ -public class Driver implements LogEnabled { +public class Driver implements LogEnabled, FOTreeListener { /** * Render to PDF. OutputStream must be set @@ -222,6 +228,12 @@ private FOUserAgent userAgent = null; /** + * The current AreaTree for the PageSequence being rendered. + */ +private AreaTree areaTree; +private AreaTreeModel atModel; + +/** * Main constructor for the Driver class. */ public Driver() { @@ -528,15 +540,15 @@ // TODO: - do this stuff in a better way // PIJ: I guess the structure handler should be created by the renderer. if (rendererType == RENDER_MIF) { -foInputHandler = new MIFHandler(stream); +foInputHandler = new MIFHandler(this, stream); } else if (rendererType == RENDER_RTF) { -foInputHandler = new RTFHandler(stream); +foInputHandler = new RTFHandler(this, stream); } else { if (renderer == null) { throw new IllegalStateException( Renderer not set when using standard foInputHandler); } -foInputHandler = new FOTreeHandler(stream, renderer, true); +foInputHandler = new FOTreeHandler(this, stream, renderer, true); } foInputHandler.enableLogging(getLogger()); @@ -574,7 +586,19 @@ } parser.setContentHandler(getContentHandler()); try { +if (foInputHandler instanceof FOTreeHandler) { +FOTreeHandler foTreeHandler = (FOTreeHandler)foInputHandler; +foTreeHandler.addFOTreeListener(this); +this.areaTree = new AreaTree(); +this.atModel = AreaTree.createRenderPagesModel(renderer); +//this.atModel = new CachedRenderPagesModel(renderer); +areaTree.setTreeModel(atModel); +} parser.parse(source); +if (foInputHandler instanceof FOTreeHandler) { +FOTreeHandler foTreeHandler = (FOTreeHandler)foInputHandler; +foTreeHandler.removeFOTreeListener(this); +} } catch (SAXException e) { if (e.getException() instanceof FOPException) { // Undo exception tunneling. @@ -635,5 +659,35 @@ render(reader, source); } } + +public void foPageSequenceComplete (FOTreeEvent event) throws FOPException{ +PageSequence pageSeq = event.getPageSequence(); +Title title = null; +if (pageSeq.getTitleFO() != null) { +title = pageSeq.getTitleFO().getTitleArea(); +} +areaTree.startPageSequence(title); +pageSeq.format(areaTree); +} + +public void
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/07/29 11:42:32 Modified:src/java/org/apache/fop/apps Driver.java src/java/org/apache/fop/extensions Bookmarks.java src/java/org/apache/fop/fo FONode.java FOText.java FOTreeBuilder.java FObj.java FObjMixed.java src/java/org/apache/fop/fo/flow Block.java Leader.java PageNumber.java PageNumberCitation.java src/java/org/apache/fop/fo/pagination Flow.java PageSequence.java Title.java src/java/org/apache/fop/layoutmgr LayoutHandler.java src/java/org/apache/fop/mif MIFHandler.java src/java/org/apache/fop/rtf/renderer RTFHandler.java Added: src/java/org/apache/fop/fo FOInputHandler.java Removed: src/java/org/apache/fop/fo StructureHandler.java Log: rename StructureHandler to FOInputHandler to clarify that its subclasses are handling data for output that is either structured or laid out Revision ChangesPath 1.12 +12 -12xml-fop/src/java/org/apache/fop/apps/Driver.java Index: Driver.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Driver.java 27 Jul 2003 20:16:03 - 1.11 +++ Driver.java 29 Jul 2003 18:42:30 - 1.12 @@ -57,7 +57,7 @@ import org.apache.fop.fo.ElementMapping; import org.apache.fop.fo.FOTreeBuilder; import org.apache.fop.fo.FOUserAgent; -import org.apache.fop.fo.StructureHandler; +import org.apache.fop.fo.FOInputHandler; import org.apache.fop.layoutmgr.LayoutHandler; import org.apache.fop.mif.MIFHandler; import org.apache.fop.render.Renderer; @@ -203,7 +203,7 @@ /** * the structure handler */ -private StructureHandler structHandler; +private FOInputHandler foInputHandler; /** * the source of the FO file @@ -432,7 +432,7 @@ setRenderer(org.apache.fop.render.txt.TXTRenderer()); break; case RENDER_MIF: -//structHandler will be set later +//foInputHandler will be set later break; case RENDER_XML: setRenderer(org.apache.fop.render.xml.XMLRenderer); @@ -441,7 +441,7 @@ setRenderer(org.apache.fop.render.svg.SVGRenderer); break; case RENDER_RTF: -//structHandler will be set later +//foInputHandler will be set later break; default: throw new IllegalArgumentException(Unknown renderer type); @@ -543,29 +543,29 @@ if (!isInitialized()) { initialize(); } - + if (rendererType != RENDER_PRINT rendererType != RENDER_AWT) { validateOutputStream(); } - + // TODO: - do this stuff in a better way // PIJ: I guess the structure handler should be created by the renderer. if (rendererType == RENDER_MIF) { -structHandler = new MIFHandler(stream); +foInputHandler = new MIFHandler(stream); } else if (rendererType == RENDER_RTF) { -structHandler = new RTFHandler(stream); +foInputHandler = new RTFHandler(stream); } else { if (renderer == null) { throw new IllegalStateException( -Renderer not set when using standard structHandler); +Renderer not set when using standard foInputHandler); } -structHandler = new LayoutHandler(stream, renderer, true); +foInputHandler = new LayoutHandler(stream, renderer, true); } -structHandler.enableLogging(getLogger()); +foInputHandler.enableLogging(getLogger()); treeBuilder.setUserAgent(getUserAgent()); -treeBuilder.setStructHandler(structHandler); +treeBuilder.setFOInputHandler(foInputHandler); return treeBuilder; } 1.3 +12 -12xml-fop/src/java/org/apache/fop/extensions/Bookmarks.java Index: Bookmarks.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/extensions/Bookmarks.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Bookmarks.java29 Jun 2003 19:34:33 - 1.2 +++ Bookmarks.java29 Jul 2003 18:42:31 - 1.3 @@ -3,34 +3,34 @@ * *The Apache Software License, Version 1.1
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
gmazza 2003/07/16 21:52:38 Modified:src/java/org/apache/fop/fo FOElementMapping.java StructureHandler.java src/java/org/apache/fop/fo/pagination PageSequence.java src/java/org/apache/fop/layoutmgr LayoutHandler.java PageLayoutManager.java src/java/org/apache/fop/mif MIFHandler.java src/java/org/apache/fop/rtf/renderer RTFHandler.java Added: src/java/org/apache/fop/fo/pagination ColorProfile.java Declarations.java Flow.java StaticContent.java Title.java Removed: src/java/org/apache/fop/fo ColorProfile.java Declarations.java Title.java src/java/org/apache/fop/fo/flow Flow.java StaticContent.java Log: Inter-package references between fo.flow and fo.pagination removed by moving Flow and StaticContent classes to pagination package. Pagination.PageSequence and .Root children Title, Declarations, and ColorProfile also moved under pagination. Rationale given here: http://marc.theaimsgroup.com/?l=fop-devm=105813290817472w=2 Revision ChangesPath 1.3 +5 -5 xml-fop/src/java/org/apache/fop/fo/FOElementMapping.java Index: FOElementMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOElementMapping.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FOElementMapping.java 12 Jul 2003 21:22:03 - 1.2 +++ FOElementMapping.java 17 Jul 2003 04:52:34 - 1.3 @@ -160,13 +160,13 @@ static class Dec extends ElementMapping.Maker { public FONode make(FONode parent) { -return new Declarations(parent); +return new org.apache.fop.fo.pagination.Declarations(parent); } } static class CP extends ElementMapping.Maker { public FONode make(FONode parent) { -return new ColorProfile(parent); +return new org.apache.fop.fo.pagination.ColorProfile(parent); } } @@ -250,19 +250,19 @@ static class Fl extends ElementMapping.Maker { public FONode make(FONode parent) { -return new org.apache.fop.fo.flow.Flow(parent); +return new org.apache.fop.fo.pagination.Flow(parent); } } static class SC extends ElementMapping.Maker { public FONode make(FONode parent) { -return new org.apache.fop.fo.flow.StaticContent(parent); +return new org.apache.fop.fo.pagination.StaticContent(parent); } } static class T extends ElementMapping.Maker { public FONode make(FONode parent) { -return new Title(parent); +return new org.apache.fop.fo.pagination.Title(parent); } } 1.2 +2 -2 xml-fop/src/java/org/apache/fop/fo/StructureHandler.java Index: StructureHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/StructureHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StructureHandler.java 29 Jun 2003 19:34:33 - 1.1 +++ StructureHandler.java 17 Jul 2003 04:52:34 - 1.2 @@ -61,7 +61,6 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.fo.flow.Block; import org.apache.fop.fo.flow.ExternalGraphic; -import org.apache.fop.fo.flow.Flow; import org.apache.fop.fo.flow.InstreamForeignObject; import org.apache.fop.fo.flow.Leader; import org.apache.fop.fo.flow.ListBlock; @@ -70,6 +69,7 @@ import org.apache.fop.fo.flow.TableBody; import org.apache.fop.fo.flow.TableCell; import org.apache.fop.fo.flow.TableRow; +import org.apache.fop.fo.pagination.Flow; import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.layout.FontInfo; 1.5 +0 -3 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java Index: PageSequence.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PageSequence.java 6 May 2003 07:46:05 - 1.4 +++ PageSequence.java 17 Jul 2003 04:52:36 - 1.5 @@ -53,9 +53,6 @@ // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; -import org.apache.fop.fo.Title; -import org.apache.fop.fo.flow.Flow; -import org.apache.fop.fo.flow.StaticContent; import org.apache.fop.layout.PageMaster; import org.apache.fop.area.AreaTree; import org.apache.fop.area.PageViewport; 1.1 xml-fop/src/java
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer RTFHandler.java
vmote 2003/06/17 19:10:32 Modified:src/java/org/apache/fop/rtf/renderer RTFHandler.java Log: Add support for text-align in paragraphs. Revision ChangesPath 1.5 +34 -2 xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RTFHandler.java 6 May 2003 07:46:05 - 1.4 +++ RTFHandler.java 18 Jun 2003 02:10:32 - 1.5 @@ -63,7 +63,9 @@ import org.apache.fop.layout.FontInfo; import org.apache.fop.apps.FOPException; +import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.pagination.PageSequence; +import org.apache.fop.fo.properties.Constants; import org.apache.fop.fo.flow.Block; import org.apache.fop.fo.flow.Flow; import org.apache.fop.fo.flow.ExternalGraphic; @@ -77,8 +79,10 @@ import org.apache.fop.fo.flow.TableRow; // JFOR +import org.jfor.jfor.rtflib.rtfdoc.RtfAttributes; import org.jfor.jfor.rtflib.rtfdoc.RtfFile; import org.jfor.jfor.rtflib.rtfdoc.RtfSection; +import org.jfor.jfor.rtflib.rtfdoc.RtfText; import org.jfor.jfor.rtflib.rtfdoc.RtfParagraph; import org.jfor.jfor.rtflib.rtfdoc.RtfDocumentArea; @@ -184,13 +188,16 @@ */ public void startBlock(Block bl) { try { -para = sect.newParagraph(); +RtfAttributes rtfAttr = new RtfAttributes(); +rtfAttr.set(mapBlockTextAlign(bl)); +para = sect.newParagraph(rtfAttr); } catch (IOException ioe) { // FIXME could we throw Exception in all StructureHandler events? throw new Error(IOException: + ioe); } } + /** * @see org.apache.fop.apps.StructureHandler#endBlock(Block) */ @@ -395,5 +402,30 @@ // FIXME could we throw Exception in all StructureHandler events? throw new Error(IOException: + ioe); } - } +} + +private static String mapBlockTextAlign(Block bl) { +int fopValue = bl.properties.get(text-align).getEnum(); +String rtfValue = null; +switch (fopValue) { +case Constants.CENTER: { +rtfValue = RtfText.ALIGN_CENTER; +break; +} +case Constants.END: { +rtfValue = RtfText.ALIGN_RIGHT; +break; +} +case Constants.JUSTIFY: { +rtfValue = RtfText.ALIGN_JUSTIFIED; +break; +} +default: { +rtfValue = RtfText.ALIGN_LEFT; +break; +} +} +return rtfValue; +} + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/rtf/renderer - New directory
jeremias2003/03/11 04:52:24 xml-fop/src/java/org/apache/fop/rtf/renderer - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/rtf/renderer RTFHandler.java
/anttasks Fop.java SerializeHyphPattern.java RunTest.java Compare.java src/org/apache/fop/fonts/base14 package.html src/org/apache/fop/tools/xslt XSLTransform.java TraxTransform.java src/org/apache/fop/tools DocumentInputSource.java DocumentReader.java TestConverter.java AreaTreeBuilder.java src/org/apache/fop/render/svg SVGRenderer.java src/org/apache/fop/rtf/renderer RTFHandler.java Log: Moved sources from src/org/** to src/java/org/** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/rtf/renderer RTFHandler.java
jeremias2003/03/07 01:47:56 Modified:src/org/apache/fop/rtf/renderer RTFHandler.java Log: Switched to long licence Some general checkstyle fixing Revision ChangesPath 1.4 +124 -42 xml-fop/src/org/apache/fop/rtf/renderer/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/rtf/renderer/RTFHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RTFHandler.java 29 Nov 2002 23:18:58 - 1.3 +++ RTFHandler.java 7 Mar 2003 09:47:56 - 1.4 @@ -1,120 +1,202 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * + *The Apache Software License, Version 1.1 + * + * + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + *this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + *this list of conditions and the following disclaimer in the documentation + *and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + *include the following acknowledgment: This product includes software + *developed by the Apache Software Foundation (http://www.apache.org/). + *Alternately, this acknowledgment may appear in the software itself, if + *and wherever such third-party acknowledgments normally appear. + * + * 4. The names FOP and Apache Software Foundation must not be used to + *endorse or promote products derived from this software without prior + *written permission. For written permission, please contact + *[EMAIL PROTECTED] + * + * 5. Products derived from this software may not be called Apache, nor may + *Apache appear in their name, without prior written permission of the + *Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation and was originally created by + * James Tauber [EMAIL PROTECTED]. For more information on the Apache + * Software Foundation, please see http://www.apache.org/. + */ package org.apache.fop.rtf.renderer; +// Java +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.IOException; + +// XML +import org.xml.sax.SAXException; + +// FOP import org.apache.fop.apps.StructureHandler; import org.apache.fop.layout.FontInfo; import org.apache.fop.apps.FOPException; import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.LayoutMasterSet; -import org.apache.fop.fo.pagination.SimplePageMaster; import org.apache.fop.fo.Title; import org.apache.fop.fo.flow.Block; import org.apache.fop.fo.flow.Flow; +// JFOR import org.jfor.jfor.rtflib.rtfdoc.RtfFile; import org.jfor.jfor.rtflib.rtfdoc.RtfSection; import org.jfor.jfor.rtflib.rtfdoc.RtfParagraph; import org.jfor.jfor.rtflib.rtfdoc.RtfDocumentArea; -import org.xml.sax.SAXException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.IOException; - /** * RTF Handler: generates RTF output using the structure events from * the FO Tree sent to this structure handler. * - * @author [EMAIL PROTECTED] + * @author [EMAIL
cvs commit: xml-fop/src/org/apache/fop/rtf/renderer RTFHandler.java
bdelacretaz2002/11/05 00:51:44 Modified:src/org/apache/fop/rtf/renderer RTFHandler.java Log: RTFHandler constructor IOException removed Revision ChangesPath 1.2 +5 -3 xml-fop/src/org/apache/fop/rtf/renderer/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/rtf/renderer/RTFHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RTFHandler.java 1 Nov 2002 06:44:15 - 1.1 +++ RTFHandler.java 5 Nov 2002 08:51:44 - 1.2 @@ -38,6 +38,7 @@ public class RTFHandler extends StructureHandler { private FontInfo _fontInfo = new FontInfo(); private RtfFile _rtfFile; +private final OutputStream _os; private RtfSection _sect; private RtfDocumentArea _docArea; private RtfParagraph _para; @@ -45,8 +46,8 @@ private static final String ALPHA_WARNING = WARNING: RTF renderer is veryveryalpha at this time, see class org.apache.fop.rtf.renderer.RTFHandler; -public RTFHandler(OutputStream os) throws IOException { -_rtfFile = new RtfFile(new OutputStreamWriter(os)); +public RTFHandler(OutputStream os) { +_os = os; // use pdf fonts for now, this is only for resolving names org.apache.fop.render.pdf.FontSetup.setup(_fontInfo, null); System.err.println(ALPHA_WARNING); @@ -59,6 +60,7 @@ public void startDocument() throws SAXException { // FIXME sections should be created try { +_rtfFile = new RtfFile(new OutputStreamWriter(_os)); _docArea = _rtfFile.startDocumentArea(); } catch(IOException ioe) { // FIXME could we throw Exception in all StructureHandler events? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/rtf/renderer - New directory
bdelacretaz2002/10/31 22:42:45 xml-fop/src/org/apache/fop/rtf/renderer - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/rtf/renderer RTFHandler.java
bdelacretaz2002/10/31 22:44:15 Modified:.build.xml src/org/apache/fop/apps Driver.java Added: lib jfor-0.7.1.jar jfor.LICENSE.txt src/org/apache/fop/rtf/renderer RTFHandler.java Log: first shot at RTFHandler using jfor RTF library Revision ChangesPath 1.66 +1 -0 xml-fop/build.xml Index: build.xml === RCS file: /home/cvs/xml-fop/build.xml,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- build.xml 31 Oct 2002 17:16:07 - 1.65 +++ build.xml 1 Nov 2002 06:44:14 - 1.66 @@ -64,6 +64,7 @@ include name=lib/batik.jar/ include name=lib/avalon-framework*.jar/ include name=lib/jimi*/ +include name=lib/jfor*.jar/ /fileset fileset dir=${basedir} id=dist.src 1.1 xml-fop/lib/jfor-0.7.1.jar Binary file 1.1 xml-fop/lib/jfor.LICENSE.txt Index: jfor.LICENSE.txt === * * jfor Apache-Style Software License. * Copyright (c) 2002 by the jfor project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * This product includes software developed * by the jfor project (http://www.jfor.org). * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The name jfor must not be used to endorse * or promote products derived from this software without prior written * permission. For written permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called jfor, * nor may jfor appear in their name, without prior written * permission of [EMAIL PROTECTED] * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE JFOR PROJECT OR ITS CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 1.57 +16 -6 xml-fop/src/org/apache/fop/apps/Driver.java Index: Driver.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Driver.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- Driver.java 31 Oct 2002 17:26:04 - 1.56 +++ Driver.java 1 Nov 2002 06:44:15 - 1.57 @@ -145,6 +145,11 @@ private FOTreeBuilder _treeBuilder; /** + * the renderer type code given by setRenderer + */ +private int _rendererType; + +/** * the renderer to use to output the area tree */ private Renderer _renderer; @@ -318,6 +323,7 @@ * @param renderer the type of renderer to use */ public void setRenderer(int renderer) throws IllegalArgumentException { +_rendererType = renderer; switch (renderer) { case RENDER_PDF: setRenderer(org.apache.fop.render.pdf.PDFRenderer); @@ -336,7 +342,7 @@ setRenderer(org.apache.fop.render.txt.TXTRenderer()); break; case RENDER_MIF: -//structHandler = new org.apache.fop.mif.MIFHandler(_stream); +//structHandler will be set later break; case RENDER_XML: setRenderer(org.apache.fop.render.xml.XMLRenderer); @@ -345,7 +351,7 @@ setRenderer
RE: Where to start for an RTF renderer (was: New Developer Suggestion)
Yes, we've been talking about structure-based renderers (like RTF and MIF) vs. layout-based ones (PDF being the focal point) for some time. [ ... ] 4) My suggestion is to first use the RTF library from jfor in binary form, by including jfor's jar in the FOP distribution, to create the RTF document from the StructureHandler events. The current jfor code does a similar thing where the jfor Converter (jfor/jfor/converter/Converter) uses SAX events to drive the jfor RTF library. This makes sense, and I will start looking at it. But, as I said up front, nobody should count on my being able to accomplish this, and anyone who wants to do it will not offend me by going ahead and doing it without me. -- Scott .sig wanders off, mumbling something about learning CVS. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Where to start for an RTF renderer (was: New Developer Sugges tion)
Hi Scott, . . .anyone who wants to do it will not offend me by going ahead and doing it without me. . . . We haven't had too many volunteers lately in this area, so this shouldn't be a problem. Just make sure to send your patches early, without waiting for your enhancements to be finished. This will help coordinating your work with that of other developers. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Where to start for an RTF renderer (was: New Developer Sugges tion)
Hi Bertrand, . . .anyone who wants to do it will not offend me by going ahead and doing it without me. . . . We haven't had too many volunteers lately in this area, so this shouldn't be a problem. Well, I left mid-afternoon yesterday to deal with a sick child; I've been back in for two hours now, and I'm still 150 emails behind, so I don't know how much time I will find to dedicate to it... Just make sure to send your patches early, without waiting for your enhancements to be finished. This will help coordinating your work with that of other developers. Will do, as soon as I figure out how to get CVS past my company's new firewall. Problems, always problems. :( -- Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Where to start for an RTF renderer (was: New Developer Suggestion)
Hi Scott, On Wednesday 09 October 2002 17:15, Sauyet, Scott (OTS-HAR) wrote: . . . So is integrating other renderers something that the group would eventually like to do? . . . Yes, we've been talking about structure-based renderers (like RTF and MIF) vs. layout-based ones (PDF being the focal point) for some time. The following messages might shed some light on this: http://marc.theaimsgroup.com/?l=fop-devm=102742684000426w=2 http://marc.theaimsgroup.com/?l=fop-devm=102795797014083w=2 . . . As of today, I know nothing about PDF syntax and little about RTF. I figure I'm going to have to learn both. I understand FO fairly well, and I speak Java fairly fluently. What do you think is first priority? . . . As Jeremias said, you're the one who decides what you'd like to work on. I'm personally biased towards the RTF renderer because that's the part I know best, so here are some starting points if you're interested in studying this in more detail and hopefully jumping in. You won't need much RTF knowledge to start with as the jfor RTF library will generate it for you, and no PDF knowledge at all since this RTF renderer will bypass the layout and PDF generation stages completely. Starting points: 1) org/apache/fop/apps/StructureHandler is the base class that receives structure events from the FO tree while the input XSL-FO is being parsed. The main class of the RTF renderer will inherit from this class to transform the events into an RTF document. 2) Package org/apache/fop/mif is an example of how to build a structure-based renderer similar to what the RTF renderer (org/apache/fop/rtf) will be. 3) jfor (www.jfor.org) is currently a separate project that converts XSL-FO to RTF directly, but could take advantage of FOP's much better handling of XSL-FO properties, hence the plan of replacing jfor by a FOP RTF renderer. 4) My suggestion is to first use the RTF library from jfor in binary form, by including jfor's jar in the FOP distribution, to create the RTF document from the StructureHandler events. The current jfor code does a similar thing where the jfor Converter (jfor/jfor/converter/Converter) uses SAX events to drive the jfor RTF library. Later, when FOP becomes better than jfor at generating RTF, we can move the jfor RTF library code into the FOP codebase. I'd like this to happen in a second stage to avoid having to maintain two RTF libraries while both projects coexist. Hope this helps - feel free to ask any additional questions! -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Will there be a RTF renderer?
Hi there! Out customers would like to have a Word-doc out of FOP. Will there be a RTF renderer in the near future? Is something like that planed? Christian __ DIRON Wirtschaftsinformatik GmbH Co. KG Christian Beer ([EMAIL PROTECTED]) Daimlerweg 39-41Tel. : +49(251)979-200 48163 Muenster Fax : +49(251)979-2020 Germany Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Will there be a RTF renderer?
On Monday 24 September 2001 12:18, Beer, Christian wrote: Will there be a RTF renderer in the near future? We (my company, I'm not speaking for the FOP team) have been working on an RTF renderer earlier this year, and later scrapped it for a standalone implementation known as jfor that is released under the MPL license. So currently AFAIK there is no RTF renderer for FOP, but jfor will allow you to convert XSL-FO documents to RTF. You can find more info at www.jfor.org. -- -- Bertrand Delacrétaz, www.codeconsult.ch -- web technologies consultant - OO, Java, XML, C++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
AW: Will there be a RTF renderer?
Well, I tried that jfor earlier this day, but it doesn't realy do layouting. I hoped the letter would look like the PDF but it doesn't. So if somebody knows a fo2rtf-processor that does the layouting I'd like to hear about that. Thanks Christian -Ursprüngliche Nachricht- Von: Bertrand Delacretaz [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 24. September 2001 13:40 An: [EMAIL PROTECTED] Betreff: Re: Will there be a RTF renderer? On Monday 24 September 2001 12:18, Beer, Christian wrote: Will there be a RTF renderer in the near future? We (my company, I'm not speaking for the FOP team) have been working on an RTF renderer earlier this year, and later scrapped it for a standalone implementation known as jfor that is released under the MPL license. So currently AFAIK there is no RTF renderer for FOP, but jfor will allow you to convert XSL-FO documents to RTF. You can find more info at www.jfor.org. -- -- Bertrand Delacrétaz, www.codeconsult.ch -- web technologies consultant - OO, Java, XML, C++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Will there be a RTF renderer?
Hi Christian, I recently got mail from Bertrand Delacretaz [EMAIL PROTECTED] who works on a project (sourceforge) called jfor. As far as I understood, it's a formatter from xsl-fo into rtf. Ask the expert at www.jfor.org ;-) - Corinna - Original Message - From: Beer, Christian [EMAIL PROTECTED] To: Fop-liste (E-Mail) [EMAIL PROTECTED] Sent: Monday, September 24, 2001 12:18 PM Subject: Will there be a RTF renderer? Hi there! Out customers would like to have a Word-doc out of FOP. Will there be a RTF renderer in the near future? Is something like that planed? Christian __ DIRON Wirtschaftsinformatik GmbH Co. KG Christian Beer ([EMAIL PROTECTED]) Daimlerweg 39-41Tel. : +49(251)979-200 48163 Muenster Fax : +49(251)979-2020 Germany Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]