Tamkin khan

Tamkin khan Tamkin D:::::

Niner since 2009

SW EnG...

Comments

  • Introduction to Office Open XML Code Snippets

    I have to create a Custom Connector like a Custom Shape in a PPTX using OOXml. As, bent connector or curve connector bent on 90 degree only, so like a custom shape i have to create a custom connector, because my connector can go through any path. I download the "OfficeOpenXML-DrawingMLGeometries.zip" where i found a definition of preset Shapes on the file "presetShapeDefinitions.xml" , in this file Bentconnector2 is defined by:

    ----------------------------------------------------------------------------------------------------
    <bentConnector2>
        <rect l="l" t="t" r="r" b="b" xmlns="http://schemas.openxmlformats.org/drawingml/2006/main" />
        <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
          <path fill="none">
            <moveTo>
              <pt x="l" y="t" />
            </moveTo>
            <lnTo>
              <pt x="r" y="t" />
            </lnTo>
            <lnTo>
              <pt x="r" y="b" />
            </lnTo>
          </path>
        </pathLst>
      </bentConnector2> 
    -----------------------------------------------------------------------------------------------------
    That means bent connector2 is being drawn in this way. But, now i want to create a custom connector like above one. My slide1.xml contain a connection shape like....

    ----------------------------------------------------------------------------------------------------
    <p:cxnSp>
            <p:nvCxnSpPr/>    
            <p:spPr>
              <a:xfrm >
                <a:off x="3886200" y="2362200"/>
                <a:ext cx="914400" cy="914400"/>
              </a:xfrm>
              <a:custGeom >
                    <rect l="l" t="t" r="r" b="b" xmlns="http://schemas.openxmlformats.org/drawingml/2006/main" />
                         <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
                             <path fill="none">
                                    <moveTo>
                                       <pt x="l" y="t" />
                                  </moveTo>
                                 <lnTo>
                                       <pt x="r" y="t" />
                              </lnTo>
                              <lnTo>
                                      <pt x="r" y="b" />
                             </lnTo>
                            </path>
                          </pathLst>
              </a:custGeom>
            </p:spPr>
            <p:style/>        
    </p:cxnSp>
    -----------------------------------------------------------------------------------------------------
    Rather than....
    ----------------------------------------------------------------------------------------------------
    <p:cxnSp>
            <p:nvCxnSpPr/>    
            <p:spPr>
              <a:xfrm >
                <a:off x="3886200" y="2362200"/>
                <a:ext cx="914400" cy="914400"/>
              </a:xfrm>
              <a:prstGeom prst="bentConnector2">  // Generally We define in this way to create a Predefined Connector
                <a:avLst/>            
              </a:prstGeom>
            </p:spPr>
            <p:style/>        
    </p:cxnSp>
    -----------------------------------------------------------------------------------------------------
     But it gives always an error when open that pptx, It says pptx has been corrupted .....
     Plz, help me how i can fix this problem...??? If it is not possible for you to help me rgarding this metter, then Where should i go ? where i can get the actual cause, Plz mention me....

    Thanks and Regards
    Tamkin
    SW ENG. (KAZ Software)
    Bangladesh