import org.apache.fop.area.Title;
import org.apache.fop.render.Renderer;
import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.fo.pagination.LayoutMasterSet;
import org.apache.avalon.framework.logger.Logger;
//log.debug("Avg render time: " + (timeUsed / pageCount) + "ms/page");
}
+ public void startPageSequence(PageSequence pageSeq, org.apache.fop.fo.Title seqTitle, LayoutMasterSet lms) {
+ Title title = null;
+ if(seqTitle != null) {
+ title = seqTitle.getTitleArea();
+ }
+ areaTree.startPageSequence(title);
+ }
+
/**
Format the PageSequence. The PageSequence
formats Pages and adds them to the AreaTree,
// fo:flow per fo:page-sequence only.
private boolean isFlowSet = false;
+ // for structure handler
+ private boolean sequenceStarted = false;
+
//
// state attributes used during layout
//
/**
* The fo:title object for this page-sequence.
*/
- private FObj titleFO;
+ private Title titleFO;
public PageSequence(FONode parent) {
// this.properties.get("country");
// this.properties.get("language");
setupID();
-
- structHandler.startPageSequence(this, layoutMasterSet);
}
if (childName.equals("fo:title")) {
if (this._flowMap.size()>0) {
log.warn("fo:title should be first in page-sequence");
+ } else {
+ this.titleFO = (Title)child;
+ structHandler.startPageSequence(this, titleFO, layoutMasterSet);
+ sequenceStarted = true;
}
- this.titleFO = (FObj)child;
}
else if (childName.equals("fo:flow")) {
if (this.mainFlow != null) {
+ " per fo:page-sequence");
}
else {
+ if(!sequenceStarted) {
+ structHandler.startPageSequence(this, titleFO, layoutMasterSet);
+ sequenceStarted = true;
+ }
this.mainFlow = (Flow)child;
addFlow(mainFlow);
super.addChild(child); // For getChildren
" must precede fo:flow; ignoring");
}
else {
+ if(!sequenceStarted) {
+ structHandler.startPageSequence(this, titleFO, layoutMasterSet);
+ sequenceStarted = true;
+ }
addFlow((Flow)child);
}
}
// If no main flow, nothing to layout!
if (this.mainFlow == null) return;
- areaTree.startPageSequence(null);
-
// Initialize if already used?
this.layoutMasterSet.resetPageMasters();
* This creates the pages in the MIF document that will be used
* by the following flows and static areas.
*/
- public void startPageSequence(PageSequence pageSeq, LayoutMasterSet lms) {
+ public void startPageSequence(PageSequence pageSeq, Title seqTitle, LayoutMasterSet lms) {
// get the layout master set
// setup the pages for this sequence
String name = pageSeq.getProperty("master-reference").getString();