keiron 01/08/21 01:26:11
Modified: src/org/apache/fop/apps StreamRenderer.java
src/org/apache/fop/extensions Outline.java
src/org/apache/fop/fo FOTreeBuilder.java
src/org/apache/fop/fo/pagination Root.java
src/org/apache/fop/render/pdf PDFRenderer.java
Log:
put back bookmark extension - not complete
Revision Changes Path
1.5 +18 -0 xml-fop/src/org/apache/fop/apps/StreamRenderer.java
Index: StreamRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/StreamRenderer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- StreamRenderer.java 2001/08/20 11:19:22 1.4
+++ StreamRenderer.java 2001/08/21 08:26:11 1.5
@@ -82,6 +82,11 @@
*/
private IDReferences idReferences = new IDReferences();
+ /**
+ * The list of extensions.
+ */
+ private Vector extensions = new Vector();
+
private Logger log;
public StreamRenderer(OutputStream outputStream, Renderer renderer) {
@@ -97,6 +102,10 @@
return idReferences;
}
+ public void addExtension(ExtensionObj ext) {
+ extensions.addElement(ext);
+ }
+
public void startRenderer()
throws SAXException {
pageCount = 0;
@@ -168,6 +177,15 @@
throws SAXException {
AreaTree a = new AreaTree(this);
a.setFontInfo(fontInfo);
+
+ for(Enumeration e = extensions.elements(); e.hasMoreElements(); ) {
+ ExtensionObj ext = (ExtensionObj)e.nextElement();
+ try {
+ ext.format(a);
+ } catch (FOPException fope) {
+ throw new SAXException(fope);
+ }
+ }
try {
pageSequence.format(a);
1.4 +3 -4 xml-fop/src/org/apache/fop/extensions/Outline.java
Index: Outline.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/extensions/Outline.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Outline.java 2001/07/30 20:29:20 1.3
+++ Outline.java 2001/08/21 08:26:11 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: Outline.java,v 1.3 2001/07/30 20:29:20 tore Exp $
+ * $Id: Outline.java,v 1.4 2001/08/21 08:26:11 keiron Exp $
* 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.
@@ -11,7 +11,6 @@
import org.apache.fop.pdf.PDFGoTo;
import org.apache.fop.pdf.PDFAction;
import org.apache.fop.datatypes.IDReferences;
-import org.apache.fop.messaging.MessageHandler;
import java.util.*;
@@ -53,11 +52,11 @@
_externalDestination =
this.properties.get("external-destination").getString();
if (_externalDestination != null &&!_externalDestination.equals("")) {
- MessageHandler.errorln("WARNING: fox:outline external-destination not
supported currently.");
+ log.warn("fox:outline external-destination not supported currently.");
}
if (_internalDestination == null || _internalDestination.equals("")) {
- MessageHandler.errorln("WARNING: fox:outline requires an
internal-destination.");
+ log.warn("fox:outline requires an internal-destination.");
}
for (FONode node = getParent(); node != null;
1.26 +10 -4 xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java
Index: FOTreeBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- FOTreeBuilder.java 2001/08/20 11:19:22 1.25
+++ FOTreeBuilder.java 2001/08/21 08:26:11 1.26
@@ -1,5 +1,5 @@
/*
- * $Id: FOTreeBuilder.java,v 1.25 2001/08/20 11:19:22 keiron Exp $
+ * $Id: FOTreeBuilder.java,v 1.26 2001/08/21 08:26:11 keiron Exp $
* 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.
@@ -14,6 +14,7 @@
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.system.BufferManager;
import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.extensions.ExtensionObj;
import org.apache.log.Logger;
@@ -159,8 +160,13 @@
// [EMAIL PROTECTED] - tell the stream renderer to render
// this page-sequence
//
- if(currentFObj instanceof PageSequence)
+ if(currentFObj instanceof PageSequence) {
streamRenderer.render((PageSequence) currentFObj);
+ } else if(currentFObj instanceof ExtensionObj) {
+ if(!(currentFObj.getParent() instanceof ExtensionObj)) {
+ streamRenderer.addExtension((ExtensionObj)currentFObj);
+ }
+ }
currentFObj = (FObj)currentFObj.getParent();
}
@@ -246,12 +252,12 @@
*
* @param areaTree the area tree to format into
*/
- public void format(AreaTree areaTree) throws FOPException {
+/* public void format(AreaTree areaTree) throws FOPException {
log.info("formatting FOs into areas");
this.bufferManager.readComplete();
((Root)this.rootFObj).format(areaTree);
}
-
+*/
public void reset() {
currentFObj = null;
rootFObj = null;
1.16 +3 -3 xml-fop/src/org/apache/fop/fo/pagination/Root.java
Index: Root.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Root.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Root.java 2001/08/20 11:19:24 1.15
+++ Root.java 2001/08/21 08:26:11 1.16
@@ -1,5 +1,5 @@
/*
- * $Id: Root.java,v 1.15 2001/08/20 11:19:24 keiron Exp $
+ * $Id: Root.java,v 1.16 2001/08/21 08:26:11 keiron Exp $
* 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.
@@ -101,7 +101,7 @@
public void setLayoutMasterSet(LayoutMasterSet layoutMasterSet) {
this.layoutMasterSet = layoutMasterSet;
}
-
+/*
public void format(AreaTree areaTree) throws FOPException {
// log.debug(" Root[" + marker + "] ");
if (layoutMasterSet == null) {
@@ -118,5 +118,5 @@
}
}
}
-
+*/
}
1.85 +11 -9 xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java
Index: PDFRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- PDFRenderer.java 2001/08/21 06:18:55 1.84
+++ PDFRenderer.java 2001/08/21 08:26:11 1.85
@@ -1,5 +1,5 @@
/*
- * $Id: PDFRenderer.java,v 1.84 2001/08/21 06:18:55 keiron Exp $
+ * $Id: PDFRenderer.java,v 1.85 2001/08/21 08:26:11 keiron Exp $
* 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.
@@ -122,6 +122,8 @@
*/
protected Hashtable options;
+ protected Vector extensions = null;
+
/**
* create the PDF renderer
*/
@@ -152,6 +154,7 @@
public void stopRenderer(OutputStream stream)
throws IOException {
+ renderRootExtensions(extensions);
FontSetup.addToResources(this.pdfDoc, fontInfo);
pdfDoc.outputTrailer(stream);
}
@@ -685,11 +688,11 @@
this.pdfResources = this.pdfDoc.getResources();
this.pdfDoc.setIDReferences(idReferences);
this.renderPage(page);
-
- //FontSetup.addToResources(this.pdfDoc, fontInfo);
- // TODO: this needs to be implemented
- renderRootExtensions(page);
+ Vector exts = page.getExtensions();
+ if(exts != null) {
+ extensions = exts;
+ }
// log.debug("writing out PDF");
this.pdfDoc.output(outputStream);
@@ -797,10 +800,9 @@
return rs;
}
- protected void renderRootExtensions(Page page) {
- Vector v = page.getExtensions();
- if (v != null) {
- Enumeration e = v.elements();
+ protected void renderRootExtensions(Vector exts) {
+ if (exts != null) {
+ Enumeration e = exts.elements();
while (e.hasMoreElements()) {
ExtensionObj ext = (ExtensionObj)e.nextElement();
if (ext instanceof Outline) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]