forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ferdin...@apache.org
Subject svn commit: r615252 - /forrest/branches/UpdateFOPto094/main/webapp/skins/common/xslt/fo/document-to-fo.xsl
Date Fri, 25 Jan 2008 15:54:48 GMT
Author: ferdinand
Date: Fri Jan 25 07:54:48 2008
New Revision: 615252

URL: http://svn.apache.org/viewvc?rev=615252&view=rev
Log:
Adjustements to imagehandling for fop94: Added content-width and content-height=scale-to-fit
so that image fills available space of surrounding box. Added a hack for lacking support for
scale-down-to-fit in fop094. Because of some shortcomings in fop94, images that are high and
narrow may overflow the page, moved one page up and clipped to page height and scaling with
%heights will not work.

Modified:
    forrest/branches/UpdateFOPto094/main/webapp/skins/common/xslt/fo/document-to-fo.xsl

Modified: forrest/branches/UpdateFOPto094/main/webapp/skins/common/xslt/fo/document-to-fo.xsl
URL: http://svn.apache.org/viewvc/forrest/branches/UpdateFOPto094/main/webapp/skins/common/xslt/fo/document-to-fo.xsl?rev=615252&r1=615251&r2=615252&view=diff
==============================================================================
--- forrest/branches/UpdateFOPto094/main/webapp/skins/common/xslt/fo/document-to-fo.xsl (original)
+++ forrest/branches/UpdateFOPto094/main/webapp/skins/common/xslt/fo/document-to-fo.xsl Fri
Jan 25 07:54:48 2008
@@ -291,8 +291,7 @@
                         margin-bottom=".5in" />
                     <fo:region-before
                         region-name="even-header"
-                        extent="0.5in"
-                        />
+                        extent="0.5in" />
                     <!-- commented out from region-body
                            because it is not standard conforming
                         border-bottom="0.5pt solid"  -->
@@ -524,13 +523,9 @@
                         select="$heading-color" />
                 </xsl:attribute>
                 <xsl:attribute
-                    name="padding-left">
-                    3pt
-                </xsl:attribute>
+                    name="padding-left"> 3pt </xsl:attribute>
                 <xsl:attribute
-                    name="padding-top">
-                    2pt
-                </xsl:attribute>
+                    name="padding-top"> 2pt </xsl:attribute>
             </xsl:if>
             <xsl:attribute
                 name="id">
@@ -806,7 +801,7 @@
         <fo:block
             margin-left="0.25in"
             margin-right="0.25in"
-            padding-left= "3pt"
+            padding-left="3pt"
             font-weight="bold"
             font-size="10pt"
             font-family="serif"
@@ -856,7 +851,7 @@
         <fo:block
             margin-left="0.25in"
             margin-right="0.25in"
-            padding-left= "3pt"
+            padding-left="3pt"
             font-weight="bold"
             font-size="10pt"
             color="#ffffff"
@@ -907,7 +902,7 @@
         <fo:block
             margin-left="0.25in"
             margin-right="0.25in"
-            padding-left= "3pt"
+            padding-left="3pt"
             font-weight="bold"
             font-size="10pt"
             color="#FFFFFF"
@@ -1039,11 +1034,14 @@
                 src="{$imgpath}">
                 <xsl:if
                     test="@height">
+
                     <xsl:attribute
                         name="height">
                         <xsl:value-of
                             select="@height" />
                     </xsl:attribute>
+                    <xsl:attribute
+                        name="content-height">scale-to-fit</xsl:attribute>
                 </xsl:if>
                 <xsl:if
                     test="@width">
@@ -1052,6 +1050,20 @@
                         <xsl:value-of
                             select="@width" />
                     </xsl:attribute>
+                    <xsl:attribute
+                        name="content-width">scale-to-fit</xsl:attribute>
+                </xsl:if>
+                <!-- Work around for fop094 not supporting 
+                scale-down-to-fit, to be replaces as soon as fop095 is released
+                -->
+                <xsl:if
+                    test=" not((@width|@height))">
+                    <xsl:attribute
+                        name="width">100%</xsl:attribute>
+                    <xsl:attribute
+                        name="content-width">scale-to-fit</xsl:attribute>
+                    <xsl:attribute
+                        name="content-height">100%</xsl:attribute>
                 </xsl:if>
             </fo:external-graphic>
             <!-- alt text -->



Mime
View raw message