[FOray-commit] SF.net SVN: foray: [9867] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-06-28 16:44:46
|
Revision: 9867
http://svn.sourceforge.net/foray/?rev=9867&view=rev
Author: victormote
Date: 2007-06-28 09:44:24 -0700 (Thu, 28 Jun 2007)
Log Message:
-----------
Conform to axsl change removing the content rectangle from the parameters passed to the graphics system when drawing an SVG to PDF. Positioning and scaling are now done entirely by the client application.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-06-28 16:18:34 UTC (rev 9866)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-06-28 16:44:24 UTC (rev 9867)
@@ -425,7 +425,7 @@
* {@inheritDoc}
*/
public void drawPdfStreamContent(final OutputStream output,
- final Rectangle2D location, final GraphicPdfContext pdfContext,
+ final GraphicPdfContext pdfContext,
final FontConsumer fontConsumer, final boolean strokeText)
throws GraphicException {
SVGDocument doc = null;
@@ -436,8 +436,8 @@
e.printStackTrace();
return;
}
- final PDFGraphics2D graphics = getPDFContent4SVG(location,
- fontConsumer, doc, strokeText, pdfContext, output);
+ final PDFGraphics2D graphics = getPDFContent4SVG(fontConsumer, doc,
+ strokeText, pdfContext, output);
graphics.dispose();
if (graphics == null) {
throw new GraphicException("Unable to convert to PDF: "
@@ -451,8 +451,6 @@
/**
* Convert an SVG document to a PDFGraphics2D.
- * @param contentRectangle The location of the rectangle containing the
- * SVG content.
* @param fontConsumer The font consumer.
* @param svgDocument The SVG document.
* @param strokeSVGText Indicates whether text should be stroked.
@@ -461,8 +459,8 @@
* @param outputStream The output stream to which this processor writes its
* PDF output.
*/
- public PDFGraphics2D getPDFContent4SVG(final Rectangle2D contentRectangle,
- final FontConsumer fontConsumer, final SVGDocument svgDocument,
+ public PDFGraphics2D getPDFContent4SVG(final FontConsumer fontConsumer,
+ final SVGDocument svgDocument,
final boolean strokeSVGText, final GraphicPdfContext pdfContext,
final OutputStream outputStream) {
/* If not running in a graphical environment, log an error message
@@ -486,8 +484,6 @@
ctx.setTextPainter(textPainter);
final PDFAElementBridge aBridge = new PDFAElementBridge();
- aBridge.setCurrentTransform(new AffineTransform(1, 0, 0, -1,
- contentRectangle.getX(), contentRectangle.getY()));
ctx.putBridge(aBridge);
GraphicsNode root;
@@ -495,9 +491,8 @@
ctx = null;
builder = null;
- final PDFGraphics2D graphics = new PDFGraphics2D(true, contentRectangle,
- svgDocument, fontConsumer, this.getLogger(), pdfContext,
- outputStream);
+ final PDFGraphics2D graphics = new PDFGraphics2D(true, svgDocument,
+ fontConsumer, this.getLogger(), pdfContext, outputStream);
graphics.setGraphicContext(
new org.apache.batik.ext.awt.g2d.GraphicContext());
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/batik/PDFGraphics2D.java 2007-06-28 16:18:34 UTC (rev 9866)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/batik/PDFGraphics2D.java 2007-06-28 16:44:24 UTC (rev 9867)
@@ -159,8 +159,6 @@
* existing document.
* @param textAsShapes Set this to true so that text will be rendered
* using curves and not the font.
- * @param contentRectangle The rectangle into which the image content should
- * be placed.
* @param svgDocument The SVG document to be drawn.
* @param fontConsumer The font consumer for this document.
* @param logger The logger.
@@ -169,7 +167,7 @@
* PDF output.
*/
public PDFGraphics2D(final boolean textAsShapes,
- final Rectangle2D contentRectangle, final SVGDocument svgDocument,
+ final SVGDocument svgDocument,
final FontConsumer fontConsumer, final Log logger,
final GraphicPdfContext pdfContext,
final OutputStream outputStream) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2007-06-28 16:18:34 UTC (rev 9866)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2007-06-28 16:44:24 UTC (rev 9867)
@@ -367,7 +367,7 @@
try {
this.transformSVGCoordinates(contentRectangle,
svg.getSVGDocument());
- svg.drawPdfStreamContent(this.getOutputStream(), contentRectangle,
+ svg.drawPdfStreamContent(this.getOutputStream(),
this.getPDFDocument(), fontConsumer, strokeSVGText);
} catch (final GraphicException e) {
// TODO Auto-generated catch block
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|