Ignore:
Timestamp:
02/26/10 00:55:07 (2 years ago)
Author:
jharrop
Message:

Convert line to SVG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/pptx4j/java/org/pptx4j/convert/out/svginhtml/pptx2svginhtml.xslt

    r1061 r1085  
    11 
    22<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     3        xmlns="http://www.w3.org/1999/xhtml"  
    34    xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" 
    45    xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" 
     
    3031       
    3132      but, for now, make indent yes--> 
    32 <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" indent="yes" />  
     33<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"  
     34doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
     35     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> 
     36<!-- either strict or transitional work for inline SVG -->  
    3337 
    3438<!--  Input to this transform is a Shape Tree p:spTree.  
    3539 
    36         Ouput is SVG in HTML. 
     40        Output is SVG in HTML. 
    3741 
    3842        <text x="{$x}" y="{$y}"><xsl:value-of select="a:p/a:r/a:t"/></text> 
     
    5559        <xsl:param name="wmlPackage"/> <!--  really, its pml --> 
    5660        <xsl:param name="resolvedLayout"/> 
    57 <!--  
    58         <xsl:param name="modelStates"/>  
    59         <xsl:param name="imageDirPath"/> 
    60             
    61         <xsl:param name="fontMapper"/>   
    62         <xsl:param name="fontFamilyStack"/> 
    63          
    64         <xsl:param name="conditionalComments"/>  
    65          --> 
    66  
    67 <!--  
    68  
    69 <p:spTree xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"> 
    70     <p:nvGrpSpPr> 
    71         <p:cNvPr name="" id="1"/> 
    72         <p:cNvGrpSpPr/> 
    73         <p:nvPr/> 
    74     </p:nvGrpSpPr> 
    75     <p:grpSpPr> 
    76         <a:xfrm> 
    77             <a:off y="0" x="0"/> 
    78             <a:ext cy="0" cx="0"/> 
    79             <a:chOff y="0" x="0"/> 
    80             <a:chExt cy="0" cx="0"/> 
    81         </a:xfrm> 
    82     </p:grpSpPr> 
    83     <p:sp> 
    84         <p:nvSpPr> 
    85             <p:cNvPr name="Title 1" id="2"/> 
    86             <p:cNvSpPr> 
    87                 <a:spLocks noGrp="true"/> 
    88             </p:cNvSpPr> 
    89             <p:nvPr/> 
    90         </p:nvSpPr> 
    91         <p:spPr> 
    92             <a:xfrm> 
    93                 <a:off y="2130425" x="685800"/> 
    94                 <a:ext cy="1470025" cx="7772400"/> 
    95             </a:xfrm> 
    96         </p:spPr> 
    97         <p:txBody> 
    98             <a:bodyPr/> 
    99             <a:lstStyle/> 
    100             <a:p> 
    101                 <a:r> 
    102                     <a:rPr smtClean="false" lang="en-US"/> 
    103                     <a:t>My title</a:t> 
    104                 </a:r> 
    105                 <a:endParaRPr lang="en-US"/> 
    106             </a:p> 
    107         </p:txBody> 
    108     </p:sp> 
    109     <p:sp> 
    110         <p:nvSpPr> 
    111             <p:cNvPr name="Subtitle 2" id="3"/> 
    112             <p:cNvSpPr> 
    113                 <a:spLocks noGrp="true"/> 
    114             </p:cNvSpPr> 
    115             <p:nvPr/> 
    116         </p:nvSpPr> 
    117         <p:spPr> 
    118             <a:xfrm> 
    119                 <a:off y="3886200" x="1371600"/> 
    120                 <a:ext cy="1752600" cx="6400800"/> 
    121             </a:xfrm> 
    122         </p:spPr> 
    123         <p:txBody> 
    124             <a:bodyPr/> 
    125             <a:lstStyle/> 
    126             <a:p> 
    127                 <a:r> 
    128                     <a:rPr smtClean="false" lang="en-US"/> 
    129                     <a:t>My subtitle</a:t> 
    130                 </a:r> 
    131                 <a:endParaRPr lang="en-US"/> 
    132             </a:p> 
    133         </p:txBody> 
    134     </p:sp> 
    135 </p:spTree> 
    13661 
    13762 
    138  
    139  --> 
    140  
    14163<xsl:template match="/"> 
    142         <html> 
     64        <html xmlns="http://www.w3.org/1999/xhtml"  
     65      xmlns:svg="http://www.w3.org/2000/svg" 
     66      xmlns:xlink="http://www.w3.org/1999/xlink"> 
    14367                <head> 
    14468                        <title>Slide output proof of concept</title> 
     
    15579                </head> 
    15680                <body> 
    157                  
    15881                        <xsl:apply-templates/>           
    159                  
    16082                </body> 
    161         </html> 
    162          
    163 <!--  
    164         <svg width="600px" height="600px" version="1.1" 
    165                         baseProfile="full"> 
    166                 <xsl:apply-templates/> 
    167         </svg> 
    168          --> 
     83        </html>  
    16984</xsl:template> 
    17085 
     
    17691<xsl:template match="p:grpSpPr"/> 
    17792 
    178 <!--  
    179     <p:sp> 
    180         <p:nvSpPr> 
    181             <p:cNvPr name="Title 1" id="2"/> 
    182             <p:cNvSpPr> 
    183                 <a:spLocks noGrp="true"/> 
    184             </p:cNvSpPr> 
    185             <p:nvPr/> 
    186         </p:nvSpPr> 
    187         <p:spPr> 
    188             <a:xfrm> 
    189                 <a:off y="2130425" x="685800"/> 
    190                 <a:ext cy="1470025" cx="7772400"/> 
    191             </a:xfrm> 
    192         </p:spPr> 
    193         <p:txBody> 
    194             <a:bodyPr/> 
    195             <a:lstStyle/> 
    196             <a:p> 
    197                 <a:r> 
    198                     <a:rPr smtClean="false" lang="en-US"/> 
    199                     <a:t>My title</a:t> 
    200                 </a:r> 
    201                 <a:endParaRPr lang="en-US"/> 
    202             </a:p> 
    203         </p:txBody> 
    204     </p:sp> 
    205  --> 
    20693 <xsl:template match="p:sp"> 
    20794        <xsl:apply-templates select="p:txBody"/> 
     
    233120        <!--  At present, docx4j doesn't do text boxes in its docx html, 
    234121              so handle the box here.  --> 
    235         <div style="position: absolute; width:{$cx}; height:{$cy}; left:{$x}; top:{$y}; border: red dashed;"> 
     122        <div style="position: absolute; width:{$cx}px; height:{$cy}px; left:{$x}px; top:{$y}px; border: red dashed;"> 
    236123                <xsl:apply-templates select="a:p"/> 
    237124        </div> 
    238125 </xsl:template> 
     126 
     127 <xsl:template match="p:cxnSp"> 
     128 
     129                <xsl:variable name="shape" select="."/> 
     130 
     131                <xsl:copy-of select="java:org.pptx4j.convert.out.svginhtml.SvgExporter.shapeToSVG( 
     132                        $wmlPackage, $shape)" /> 
     133  
     134 </xsl:template> 
     135 
    239136 
    240137 <xsl:template match="a:p"> 
Note: See TracChangeset for help on using the changeset viewer.