diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-12-12 19:28:33 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-12-12 19:28:33 +0000 |
commit | 2e5d2f964f2855112a480d0863a529fd295cde9f (patch) | |
tree | bb2441b6a0ca95fdeac33827474d10601a141984 /src/java/org/apache/fop/render/rtf/rtflib | |
parent | 2c8dfa0ea8e3f6d125399a556bd4c476b9619465 (diff) | |
download | xmlgraphics-fop-2e5d2f964f2855112a480d0863a529fd295cde9f.tar.gz xmlgraphics-fop-2e5d2f964f2855112a480d0863a529fd295cde9f.zip |
Quick fix to get the size of images right in RTF output. It looks like \picwgoalN|\pichgoalN should not be used together with \picscalexN|\pixscaleyN. Some problems remain with uniform scaling and such.
Added support for SVG in external-graphic. SVG images are converted to JPEG through Batik at 300 dpi. Note that instream-foreign-object is not supported, yet. It might be good to reuse code from external-graphic for that.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@356345 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/rtf/rtflib')
-rw-r--r-- | src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java index a0d8ebbae..ad1ee1885 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java @@ -227,7 +227,7 @@ public class RtfExternalGraphic extends RtfElement { protected URL url = null; /** - * The height of the image + * The height of the image (in pixels) */ protected int height = -1; @@ -237,7 +237,7 @@ public class RtfExternalGraphic extends RtfElement { protected int heightPercent = -1; /** - * The desired height + * The desired height (in twips) */ protected int heightDesired = -1; @@ -247,7 +247,7 @@ public class RtfExternalGraphic extends RtfElement { protected boolean perCentH = false; /** - * The width of the image + * The width of the image (in pixels) */ protected int width = -1; @@ -257,7 +257,7 @@ public class RtfExternalGraphic extends RtfElement { protected int widthPercent = -1; /** - * The desired width + * The desired width (in twips) */ protected int widthDesired = -1; @@ -491,10 +491,10 @@ public class RtfExternalGraphic extends RtfElement { if (perCentW) { writeControlWord("picscalex" + widthDesired); } else { - writeControlWord("picscalex" + widthDesired * 100 / width); + //writeControlWord("picscalex" + widthDesired * 100 / width); + writeControlWord("picwgoal" + widthDesired); } - writeControlWord("picwgoal" + widthDesired); } else if (scaleUniform && heightDesired != -1) { if (perCentH) { writeControlWord("picscalex" + heightDesired); @@ -507,10 +507,10 @@ public class RtfExternalGraphic extends RtfElement { if (perCentH) { writeControlWord("picscaley" + heightDesired); } else { - writeControlWord("picscaley" + heightDesired * 100 / height); + //writeControlWord("picscaley" + heightDesired * 100 / height); + writeControlWord("pichgoal" + heightDesired); } - writeControlWord("pichgoal" + heightDesired); } else if (scaleUniform && widthDesired != -1) { if (perCentW) { writeControlWord("picscaley" + widthDesired); @@ -527,7 +527,7 @@ public class RtfExternalGraphic extends RtfElement { /** * Sets the desired height of the image. * - * @param theHeight The desired image height + * @param theHeight The desired image height (as a string in twips or as a percentage) */ public void setHeight(String theHeight) { this.heightDesired = ImageUtil.getInt(theHeight); @@ -537,7 +537,7 @@ public class RtfExternalGraphic extends RtfElement { /** * Sets the desired width of the image. * - * @param theWidth The desired image width + * @param theWidth The desired image width (as a string in twips or as a percentage) */ public void setWidth(String theWidth) { this.widthDesired = ImageUtil.getInt(theWidth); |