*/
package org.apache.fop.area;
-import org.apache.fop.datatypes.FODimension;
-import org.apache.fop.fo.PropertyManager;
-import java.awt.geom.Rectangle2D;
import java.awt.Rectangle;
+import java.awt.geom.Rectangle2D;
import java.io.Serializable;
+import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.properties.WritingMode;
/**
*/
package org.apache.fop.fo;
-// FOP
-import java.util.HashMap;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.fop.fo.pagination.Root;
-// SAX
import org.apache.avalon.framework.logger.Logger;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.ElementMapping.Maker;
+import org.apache.fop.fo.pagination.Root;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-// Java
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import org.apache.fop.apps.FOUserAgent;
-
/**
* SAX Handler that passes parsed data to the various
* FO objects, where they can be used either to build
* an FO Tree, or used by Structure Renderers to build
* other data structures.
- * Now uses
- * StreamRenderer to automagically render the document as
- * soon as it receives a page-sequence end-tag. Also,
- * calls methods to set up and shut down the renderer at
- * the beginning and end of the FO document. Finally,
- * supresses adding the PageSequence object to the Root,
- * since it is parsed immediately.
- *
- * @author unascribed
- * @author Mark Lillywhite mark-fop@inomial.com
*/
public class FOTreeBuilder extends DefaultHandler {
*/
package org.apache.fop.fo;
-// Java
-import java.util.Iterator;
-import java.util.ListIterator;
import java.util.ArrayList;
-import java.util.List;
import java.util.HashMap;
-import java.util.Set;
+import java.util.Iterator;
+import java.util.ListIterator;
import java.util.Map;
-import org.xml.sax.Attributes;
+import java.util.Set;
-// FOP
import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.properties.FOPropertyMapping;
import org.apache.fop.fo.flow.Marker;
+import org.apache.fop.fo.properties.FOPropertyMapping;
+import org.xml.sax.Attributes;
/**
- * base class for representation of formatting objects and their processing
+ * Base class for representation of formatting objects and their processing.
*/
public class FObj extends FONode {
private static final String FO_URI = "http://www.w3.org/1999/XSL/Format";
import java.util.HashMap;
-import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.ElementMapping;
-import org.apache.fop.apps.FOFileHandler;
-
import org.apache.batik.util.XMLResourceDescriptor;
-import org.apache.batik.dom.svg.ExtensibleSVGDOMImplementation;
+import org.apache.fop.apps.FOFileHandler;
+import org.apache.fop.fo.ElementMapping;
+import org.apache.fop.fo.FONode;
/**
* This Element Mapping is for Batik SVG Extension elements
*/
package org.apache.fop.fo.flow;
-// Java
-import java.util.List;
-
-// FOP
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FOTreeVisitor;
+import org.apache.fop.fo.FObj;
/**
* Class modelling the fo:footnote object. See Sec. 6.10.3 of the XSL-FO
package org.apache.fop.fo.flow;
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FOTreeVisitor;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.properties.DisplayAlign;
import org.apache.fop.fo.properties.TextAlign;
-import org.w3c.dom.Document;
/**
* The instream-foreign-object flow formatting object.
*/
package org.apache.fop.fo.flow;
-// FOP
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.PercentLength;
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObjMixed;
-import org.apache.fop.fo.FOInputHandler;
import org.apache.fop.fo.FOTreeVisitor;
-import org.apache.fop.fo.properties.LeaderPattern;
+import org.apache.fop.fo.FObjMixed;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.FOTreeControl;
-import org.apache.fop.fonts.Font;
import org.apache.fop.fo.properties.CommonMarginInline;
import org.apache.fop.fo.properties.CommonRelativePosition;
+import org.apache.fop.fo.properties.LeaderPattern;
+import org.apache.fop.fonts.Font;
/**
* Class modelling fo:leader object. See Sec. 6.6.9 of the XSL-FO Standard.
*/
package org.apache.fop.fo.flow;
-// Java
-import java.util.List;
-
-// FOP
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FOTreeVisitor;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
*/
package org.apache.fop.fo.flow;
-// FOP
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTreeVisitor;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.FOTreeControl;
-import org.apache.fop.fonts.Font;
import org.apache.fop.fo.properties.CommonMarginInline;
import org.apache.fop.fo.properties.CommonRelativePosition;
-
-import org.apache.fop.datatypes.ColorType;
-import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FOInputHandler;
+import org.apache.fop.fonts.Font;
/**
* Class modelling the fo:page-number object. See Sec. 6.6.10 of the XSL-FO
*/
package org.apache.fop.fo.flow;
-// FOP
import org.apache.fop.datatypes.ColorType;
-import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FOInputHandler;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.FOTreeControl;
-import org.apache.fop.fonts.Font;
import org.apache.fop.fo.properties.CommonMarginInline;
import org.apache.fop.fo.properties.CommonRelativePosition;
+import org.apache.fop.fonts.Font;
import org.apache.fop.util.CharUtilities;
/**
*/
package org.apache.fop.fo.pagination;
-// Java
import java.awt.Rectangle;
-import java.awt.geom.Rectangle2D;
-// FOP
+import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.FODimension;
-import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTreeVisitor;
-import org.apache.fop.apps.FOPException;
-
-// SAX
+import org.apache.fop.fo.FObj;
import org.xml.sax.Attributes;
/**
*/
package org.apache.fop.fo.pagination;
-// Java
import java.awt.Rectangle;
-import java.awt.geom.Rectangle2D;
-// FOP
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FOTreeVisitor;
-import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.Property;
-import org.apache.fop.fo.properties.WritingMode;
-import org.apache.fop.datatypes.ColorType;
-import org.apache.fop.datatypes.FODimension;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.properties.CommonMarginBlock;
+import org.apache.fop.fo.properties.WritingMode;
/**
* The fo:region-body element.
*/
package org.apache.fop.layoutmgr;
-// FOP
-import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObjMixed;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonRelativePosition;
+import java.util.ArrayList;
+import java.util.List;
-import org.apache.fop.layoutmgr.LeafNodeLayoutManager;
-import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.area.inline.InlineArea;
-import java.util.List;
-import java.util.ArrayList;
-
/**
* If this bidi has a different writing mode direction
*/
package org.apache.fop.layoutmgr;
-import org.apache.fop.area.extensions.BookmarkData;
-import org.apache.fop.fo.extensions.Outline;
import org.apache.fop.apps.Document;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.layout.LayoutStrategy;
import org.apache.fop.area.AreaTree;
import org.apache.fop.area.Title;
+import org.apache.fop.area.extensions.BookmarkData;
+import org.apache.fop.fo.extensions.Outline;
import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.fo.FOTreeHandler;
+import org.apache.fop.layout.LayoutStrategy;
/**
* The implementation of LayoutStrategy for the "redesign" or second generation
import java.io.IOException;
import java.io.OutputStream;
-// XML
-import org.xml.sax.SAXException;
-
-// FOP
-import org.apache.fop.apps.Driver;
-import org.apache.fop.fo.FOInputHandler;
-import org.apache.fop.fo.flow.Block;
-import org.apache.fop.fo.pagination.Flow;
-import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.fo.pagination.PageSequenceMaster;
-import org.apache.fop.fo.pagination.SimplePageMaster;
import org.apache.fop.apps.Document;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FOInputHandler;
+import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.ExternalGraphic;
import org.apache.fop.fo.flow.InstreamForeignObject;
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.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.TableColumn;
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.fo.pagination.PageSequenceMaster;
+import org.apache.fop.fo.pagination.SimplePageMaster;
+import org.xml.sax.SAXException;
// TODO: do we really want every method throwing a SAXException
private String author = null;
private String subject = null;
private String keywords = null;
+ private Date creationDate = null;
/**
* the name of the application that created the
this.keywords = k;
}
+ /**
+ * @return last set creation date
+ */
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ /**
+ * @param date Date to store in the PDF as creation date. Use null to force current system date.
+ */
+ public void setCreationDate(Date date) {
+ creationDate = date;
+ }
+
/**
* @see org.apache.fop.pdf.PDFObject#toPDF()
*/
bout.write(encode("\n"));
// creation date in form (D:YYYYMMDDHHmmSSOHH'mm')
- final Date date = new Date();
+ if(creationDate==null) {
+ creationDate = new Date();
+ }
final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
- final String str = sdf.format(date) + "+00'00'";
+ final String str = sdf.format(creationDate) + "+00'00'";
bout.write(encode("/CreationDate "));
bout.write(encodeString("D:" + str));
bout.write(encode("\n>>\nendobj\n"));
}
return bout.toByteArray();
}
+
}
// Java
import java.awt.Color;
-import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
-import java.awt.geom.Rectangle2D;
+import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.print.PageFormat;
import java.awt.print.Pageable;
import java.awt.print.Printable;
-import java.awt.RenderingHints;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.Vector;
-// FOP
import org.apache.fop.apps.Document;
-import org.apache.fop.apps.InputHandler;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.InputHandler;
import org.apache.fop.area.Area;
import org.apache.fop.area.Page;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.RegionViewport;
import org.apache.fop.area.Trait;
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.fo.properties.BackgroundRepeat;
-import org.apache.fop.fonts.Font;
import org.apache.fop.image.FopImage;
import org.apache.fop.image.ImageFactory;
import org.apache.fop.render.AbstractRenderer;
package org.apache.fop.servlet;
import java.io.File;
-import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
-import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.TransformerFactory;
-import org.xml.sax.InputSource;
-
-// Avalon
import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.framework.logger.Logger;
-
-// FOP
import org.apache.fop.apps.Driver;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.area.PageViewport;
import org.apache.fop.apps.XSLTInputHandler;
import org.apache.fop.render.awt.AWTPrintRenderer;
+import org.xml.sax.InputSource;
/**
* Example servlet to generate a fop printout from a servlet.