diff -r -u -w fop-0.20.4.orig/src/org/apache/fop/render/pdf/PDFRenderer.java fop-0.20.4/src/org/apache/fop/render/pdf/PDFRenderer.java
--- fop-0.20.4.orig/src/org/apache/fop/render/pdf/PDFRenderer.java	Fri Jul  5 19:06:20 2002
+++ fop-0.20.4/src/org/apache/fop/render/pdf/PDFRenderer.java	Thu Oct 10 15:12:30 2002
@@ -301,7 +301,7 @@
 
                 SVGDocument svg = ((SVGImage) image).getSVGDocument();
                 currentStream.add("ET\nq\n");
-                renderSVGDocument(svg, x, y, fs);
+                renderSVGDocument(svg, x, y, w, h, fs);
                 currentStream.add("Q\nBT\n");
             } catch (FopImageException e) {}
 
@@ -368,7 +368,7 @@
                         cx1 + " " + cy2 + " l\n" +
                         "W\n" +
                         "n\n");
-                renderSVGDocument(svg, imgX, imgY, fs);
+                renderSVGDocument(svg, imgX, imgY, imgW, imgH, fs);
                 currentStream.add("Q\nBT\n");
             } catch (FopImageException e) {}
 
@@ -470,7 +470,7 @@
         // place at the current instream offset
         int x = this.currentXPosition;
         int y = this.currentYPosition;
-        renderSVGDocument(area.getSVGDocument(), x, y, area.getFontState());
+        renderSVGDocument(area.getSVGDocument(), x, y, -1, -1, area.getFontState());
     }
 
     /**
@@ -479,9 +479,11 @@
      * @param doc  the document to render
      * @param x    the x offset
      * @param y    the y offset
+     * @param csWidth  the scaled width of the content
+     * @param csHeight the scaled height of the content
      * @param fs   the fontstate to use
      */
-    protected void renderSVGDocument(Document doc, int x, int y,
+    protected void renderSVGDocument(Document doc, int x, int y, int csWidth, int csHeight, 
             FontState fs) {
         float sx = 1;
         float sy = -1;
@@ -520,6 +522,19 @@
         // get the 'width' and 'height' attributes of the SVG document
         float w = (float) ctx.getDocumentSize().getWidth() * 1000f;
         float h = (float) ctx.getDocumentSize().getHeight() * 1000f;
+        
+        // If we have been given the expected width and height of the 
+        // document, then set the scale factors.
+        if (csWidth!=-1) 
+            sx = csWidth/w;
+        if (csHeight!=-1)
+            sy = -csHeight/h;
+        
+        // If we have not been given the expected width and height, then
+        // set the expected size to be the actual size.
+        if (csWidth==-1) csWidth=(int)w;
+        if (csHeight==-1) csHeight=(int)h;
+        
         ctx = null;
         builder = null;
 
@@ -529,12 +544,11 @@
          * an fo:block-container
          */
         currentStream.add("q\n");
-        if (w != 0 && h != 0) {
+        if (csWidth != 0 && csHeight != 0) {
             currentStream.add(x / 1000f + " " + y / 1000f + " m\n");
-            currentStream.add((x + w) / 1000f + " " + y / 1000f + " l\n");
-            currentStream.add((x + w) / 1000f + " " + (y - h) / 1000f
-                    + " l\n");
-            currentStream.add(x / 1000f + " " + (y - h) / 1000f + " l\n");
+            currentStream.add((x + csWidth) / 1000f + " " + y / 1000f + " l\n");
+            currentStream.add((x + csWidth) / 1000f + " " + (y - csHeight) / 1000f + " l\n");
+            currentStream.add(x / 1000f + " " + (y - csHeight) / 1000f + " l\n");
             currentStream.add("h\n");
             currentStream.add("W\n");
             currentStream.add("n\n");

