CrazyIter_Bin 4 éve
szülő
commit
591d818342
40 módosított fájl, 3379 hozzáadás és 884 törlés
  1. 49 0
      HTEXInk/Form1.Designer.cs
  2. 25 0
      HTEXInk/Form1.cs
  3. 60 0
      HTEXInk/Form1.resx
  4. 9 0
      HTEXInk/HTEXInk.csproj
  5. 23 0
      HTEXInk/Program.cs
  6. 8 1
      HTEXLib/DOCX/OpenXmlTool/PtOpenXmlUtil.cs
  7. 1159 0
      HTEXLib/DOCX/OpenXmlTool/WORDHelper.cs
  8. 562 3
      HTEXLib/DOCX/OpenXmlTool/WmlToHtmlConverter.cs
  9. 3 3
      HTEXLib/HTEXLib.csproj
  10. 1 1
      HTEXLib/PPTX/Builders/HtexBuilder.cs
  11. 2 2
      HTEXLib/PPTX/Builders/PPTContainerShapeBuilder.cs
  12. 2 2
      HTEXLib/PPTX/Helpers/ShapeHelpers/AnimtimeHelper.cs
  13. 12 17
      HTEXLib/PPTX/Helpers/ShapeHelpers/PPTXHelper.cs
  14. 20 20
      HTEXLib/PPTX/Helpers/ShapeHelpers/ShapeHelper.cs
  15. 690 579
      HTEXLib/PPTX/Helpers/ShapeHelpers/SvgHelper.cs
  16. 32 34
      HTEXLib/PPTX/Models/HTEX/HtexChart.cs
  17. 1 1
      HTEXLib/PPTX/Models/HTEX/HtexConnectionShape.cs
  18. 11 15
      HTEXLib/PPTX/Models/HTEX/HtexDiagram.cs
  19. 11 15
      HTEXLib/PPTX/Models/HTEX/HtexGroupShape.cs
  20. 11 15
      HTEXLib/PPTX/Models/HTEX/HtexImage.cs
  21. 14 18
      HTEXLib/PPTX/Models/HTEX/HtexMath.cs
  22. 3 3
      HTEXLib/PPTX/Models/HTEX/HtexShape.cs
  23. 2 2
      HTEXLib/PPTX/Models/PPTX/DSPShape.cs
  24. 1 1
      HTEXLib/PPTX/Models/PPTX/PPTAlternateContent.cs
  25. 1 1
      HTEXLib/PPTX/Models/PPTX/PPTGroupShape.cs
  26. 70 71
      HTEXLib/PPTX/Models/Shape.cs
  27. 15 0
      HTEXTest/HTEXTest.csproj
  28. 370 80
      HTEXTest/Program.cs
  29. BIN
      HTEXTest/dll/HandWriteRecognizerCSharp.dll
  30. BIN
      HTEXTest/dll/HandWriteRecognizerLib.dll
  31. BIN
      HTEXTest/dll/Microsoft.Ink.dll
  32. 39 0
      HTEXWebTest/Controllers/WeatherForecastController.cs
  33. 12 0
      HTEXWebTest/HTEXWebTest.csproj
  34. 26 0
      HTEXWebTest/Program.cs
  35. 30 0
      HTEXWebTest/Properties/launchSettings.json
  36. 59 0
      HTEXWebTest/Startup.cs
  37. 15 0
      HTEXWebTest/WeatherForecast.cs
  38. 9 0
      HTEXWebTest/appsettings.Development.json
  39. 10 0
      HTEXWebTest/appsettings.json
  40. 12 0
      TEAMModelHTEX.sln

+ 49 - 0
HTEXInk/Form1.Designer.cs

@@ -0,0 +1,49 @@
+
+namespace HTEXInk
+{
+    partial class Form1
+    {
+        /// <summary>
+        ///  Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        ///  Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        ///  Required method for Designer support - do not modify
+        ///  the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.SuspendLayout();
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+    }
+}
+

+ 25 - 0
HTEXInk/Form1.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HTEXInk
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 60 - 0
HTEXInk/Form1.resx

@@ -0,0 +1,60 @@
+<root>
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 9 - 0
HTEXInk/HTEXInk.csproj

@@ -0,0 +1,9 @@
+<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
+
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <UseWindowsForms>true</UseWindowsForms>
+  </PropertyGroup>
+
+</Project>

+ 23 - 0
HTEXInk/Program.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HTEXInk
+{
+    static class Program
+    {
+        /// <summary>
+        ///  The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.SetHighDpiMode(HighDpiMode.SystemAware);
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 8 - 1
HTEXLib/DOCX/OpenXmlTool/PtOpenXmlUtil.cs

@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft. All rights reserved.
+// Copyright (c) Microsoft. All rights reserved.
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
 
 using System;
@@ -2160,6 +2160,13 @@ listSeparator
     {
         public static readonly XNamespace wpg =
             "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup";
+        public static readonly XName wgp = wpg + "wgp";
+        public static readonly XName cNvGrpSpPr = wpg + "cNvGrpSpPr";
+        public static readonly XName grpSpPr = wpg + "grpSpPr";
+        public static readonly XName cNvPr = wpg + "cNvPr";
+        public static readonly XName grpSp = wpg + "grpSp";
+        public static readonly XName graphicFrame = wpg + "graphicFrame";
+        public static readonly XName extLst = wpg + "extLst";
     }
 
     public static class WPI

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1159 - 0
HTEXLib/DOCX/OpenXmlTool/WORDHelper.cs


+ 562 - 3
HTEXLib/DOCX/OpenXmlTool/WmlToHtmlConverter.cs

@@ -13,7 +13,14 @@ using System.Text;
 using System.Xml;
 using System.Xml.Linq;
 using System.Xml.Xsl;
+using DocumentFormat.OpenXml;
+using DocumentFormat.OpenXml.Drawing;
+using DocumentFormat.OpenXml.Drawing.Charts;
+using DocumentFormat.OpenXml.Office2010.Word.DrawingShape;
 using DocumentFormat.OpenXml.Packaging;
+using HTEXLib.DOCX.OpenXmlTool;
+using HTEXLib.Helpers;
+using HTEXLib.Helpers.ShapeHelpers;
 using HTEXLib.Models.Inner;
 
 // 200e lrm - LTR
@@ -564,11 +571,526 @@ namespace OpenXmlPowerTools
 
                 return element.Elements().Select(e => ConvertToHtmlTransform(wordDoc, settings, e, false, currentMarginLeft));
             }
-           
+            //处理形状
+            if (element.Name == MC.AlternateContent)
+            {
+
+                return ProcessAlternateContent(wordDoc, element,settings.ImageHandler);
+            }
+            //if (element.Name == MC.Choice)
+            //{
+
+            //    return ProcessOMath(element);
+            //}
+            //if (element.Name == W.drawing &&element.Parent.Name==MC.Choice)
+            //{
+
+            //    return ProcessOMath(element);
+            //}
+
+
             // Ignore element.
             return null;
         }
+        public static XElement ProcessAlternateContent(WordprocessingDocument wordDoc, XElement element, Func<ImageInfo, XElement> imageHandler) {
+            var drawing = element.Element(MC.Choice).Element(W.drawing).Element(WP.inline);
+            if (drawing == null) {
+                drawing = element.Element(MC.Choice).Element(W.drawing).Element(WP.anchor);
+            }
+            var graphicData = drawing.Element(A.graphic).Element(A.graphicData).Elements() ;
+         
+            foreach (var elm in graphicData) {
+                if (elm.Name==WPS.wsp)
+                {
+                    return  ProcessWps(  wordDoc, elm,  imageHandler);
+                }
+                else if (elm.Name==WPG.wgp)
+                {
+                    return ProcessWgp(wordDoc, elm, imageHandler);
+                }
+            }
+            return null;
+        }
+
+        public static XElement ProcessWgp(WordprocessingDocument wordDoc, XElement element, Func<ImageInfo, XElement> imageHandler) {
+            var extentCx = (int?)element.Elements(WP.extent)
+                .Attributes(NoNamespace.cx).FirstOrDefault();
+            var extentCy = (int?)element.Elements(WP.extent)
+                .Attributes(NoNamespace.cy).FirstOrDefault();
+            var elms=  element.Descendants(WPS.wsp);
+            XElement el = new XElement(Xhtml.div);
+            foreach (var elm in elms) {
+               var emlt= ProcessWps(wordDoc, elm, imageHandler);
+                el.Add(emlt);
+            }
+            return el;
+        }
+
+        
+        public static XElement ProcessChart(WordprocessingDocument wordDoc, XElement containerElement, Func<ImageInfo, XElement> imageHandler,
+            int? extentCx, int? extentCy, string altText, XElement element, string hyperlinkUri)
+        {
+            var ird= element.Attribute(R.id);
+           var chartird= wordDoc.MainDocumentPart.Parts.FirstOrDefault(pp => pp.RelationshipId == ird.Value);
+            ChartPart chartPart= wordDoc.MainDocumentPart.ChartParts.Where(x => x.Uri.ToString() == chartird.OpenXmlPart.Uri.ToString()).FirstOrDefault<ChartPart>();
+            if (chartPart != null)
+            {
+                ChartColorStylePart ChartColorStylePart = null;
+                ChartStylePart ChartStylePart = null;
+                foreach (var idp in chartPart.Parts)
+                {
+                    if (idp.OpenXmlPart is ChartColorStylePart ChartColorStyleParts)
+                    {
+                        ChartColorStylePart = ChartColorStyleParts;
+                    }
+                    if (idp.OpenXmlPart is ChartStylePart ChartStyleParts)
+                    {
+                        ChartStylePart = ChartStyleParts;
+                    }
+                }
+
+                if (ChartStylePart != null)
+                {
+                    var ChartStyleChildren = ChartStylePart.ChartStyle.ChildElements;
+                    foreach (var child in ChartStyleChildren)
+                    {
+                        if (child is DocumentFormat.OpenXml.Office2013.Drawing.ChartStyle.StyleEntry StyleEntry)
+                        {
+
+                         //   DoStyleEntry(StyleEntry);
+                        }
+                        ///OfficeArtExtensionList   cs: extLst
+                        // MarkerLayoutProperties    cs: dataPointMarkerLayout
+
+                    }
+                }
+
+               HTEXLib. Chart charts = DrawChart(wordDoc,chartPart.ChartSpace,element,imageHandler,null);
+              //  charts.links = slide.hyperlinks;
+               // return new List<Item> { charts };
+            }
+            return null;
+        }
+        
+        
+        public static HTEXLib.Chart DrawChart(WordprocessingDocument wordDoc, DocumentFormat.OpenXml.Drawing.Charts.ChartSpace chartSpace,XElement element, Func<ImageInfo, XElement> ImageHandler, HTEXLib.Position positionc)
+        {
+            var Chart = chartSpace.GetFirstChild<DocumentFormat.OpenXml.Drawing.Charts.Chart>();
+            var ShapeProperties = chartSpace.GetFirstChild<DocumentFormat.OpenXml.Drawing.Charts.ShapeProperties>();
+            HTEXLib.Models.HTEX.ShapeStyle shapeStyleChart = WORDHelper.DoShapeProperties(wordDoc ,ShapeProperties, element, ImageHandler, positionc);
+            var TextProperties = chartSpace.GetFirstChild<TextProperties>();
+            var style = chartSpace.GetFirstChild<DocumentFormat.OpenXml.Drawing.Charts.Style>();
+            var ColorMapOverride = chartSpace.GetFirstChild<DocumentFormat.OpenXml.Drawing.Charts.ColorMapOverride>();
+            var style2010 = chartSpace.GetFirstChild<DocumentFormat.OpenXml.Office2010.Drawing.Charts.Style>();
+            var UserShapesReference = chartSpace.GetFirstChild<UserShapesReference>();
+            var charts = DoPlotArea(Chart.PlotArea,wordDoc,element, ImageHandler,positionc);
+            HTEXLib.Models.HTEX. ShapeStyle shapeStyle = null;
+            if (Chart.Title != null)
+            {
+                var ChartShapeProperties = Chart.Title.ChartShapeProperties;
+                shapeStyle = WORDHelper.DoShapeProperties(wordDoc, ChartShapeProperties,   element, ImageHandler, positionc);
+            }
+           // var (PPTParagraphs, tBody) = DoChartTitle(Chart.Title);
+            //TextBody textBody = DrawText(PPTParagraphs, tBody);
+
+            //Shape shape= new Shape { type = "Sp",uid ="Sp-" +ShaHashHelper.GetSHA1(slide.slideIndex + "-" + (Chart.Title.GetType().Name + Chart.Title.OuterXml).Trim().ToLower()), shapeType = "rect", 
+            //    textBody = textBody , sid = sid + "titel" };
+           HTEXLib. Shape shape = new HTEXLib.Shape
+           {
+                type = "Sp",
+                uid = Guid.NewGuid().ToString(),
+                shapeType = "rect",
+               // textBody = textBody,
+               // sid = sid + "titel"
+            };
+            shape.style.fill = shapeStyle != null ? shapeStyle.fill : null;
+            shape.style.border = shapeStyle != null ? shapeStyle.border : null;
+            //var  chart= new Chart {sid=sid,charts =charts,title=shape,type=type,uid = type+"-"+ ShaHashHelper.GetSHA1(slide.slideIndex + "-" + (Chart.GetType().Name + Chart.OuterXml).Trim().ToLower()) };
+            var chart = new HTEXLib.Chart
+            {
+               // sid = sid,
+                charts = charts,
+                title = shape,
+              //  type = type,
+                uid = Guid.NewGuid().ToString(),
+            };
+            HTEXLib.Position position = new  HTEXLib.Position { /*cx = width, cy = height, x = left, y = top, rot = rot */};
+            chart.style.position = position;
+            chart.style.fill = shapeStyleChart != null ? shapeStyleChart.fill : null;
+            chart.style.border = shapeStyleChart != null ? shapeStyleChart.border : null;
+            chart.style.effect = shapeStyleChart != null ? shapeStyleChart.effect : null;
+            chart.svg = new HTEXLib.Svg
+            {
+                type = "path",
+                d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx + " " + position.cy + ",L" + 0 + " " + position.cy + " z"
+                //new Rect {
+                //    x=position.x, 
+                //    y = position.y,
+                //    width=position.cx,
+                //    height=position.cy,
+                //    type="rect"
+                //    } 
+
+            };
+            if (chart.style != null)
+            {
+                if (chart.style.fill.type == -1 || chart.style.fill.type == 0)
+                {
+                    chart.style.fill = null;
+                }
+                if (chart.style.border != null && chart.style.border.type == "none")
+                {
+                    chart.style.border = null;
+                }
+            }
+            return chart;
+        }
+        public  static List<HTEXLib. CommonChart> DoPlotArea(PlotArea plotArea, WordprocessingDocument wordDoc,  XElement element, Func<ImageInfo, XElement> ImageHandler, HTEXLib.Position positionc)
+        {
+            List<HTEXLib.CommonChart> charts = new List<HTEXLib.CommonChart>();
+            foreach (var child in plotArea.ChildElements)
+            {
+                string key = child.LocalName;
+                IEnumerable<XElement> serNodes = null;
+                switch (key)
+                {
+                    //break块中不可以随意更换,此条件用于归类不同从Chart
+                    case "pieChart":
+                    case "ofPieChart":
+                    case "pie3DChart":
+                    case "doughnutChart":
+                        HTEXLib.PieChart pieChart = new HTEXLib.PieChart { chartType = "pie" };
+                        if (key.Equals("pie3DChart"))
+                        {
+                            pieChart.is3D = true;
+                        }
+                        pieChart.pieType = key;
+                        if (key.Equals("ofPieChart"))
+                        {
+                            var ofPieType = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:ofPieType");
+                            if (ofPieType != null)
+                            {
+                                //ofPieChart-pie ofPieChart-bar  子母饼图
+                                pieChart.pieType += "-" + ofPieType.Attribute("val").Value;
+                            }
+                        }
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser") ;
+                        pieChart.datas = ExtractChartData(serNodes,wordDoc,element, ImageHandler, positionc);
+                        charts.Add(pieChart);
+                        break;
+                    case "lineChart":
+                    case "line3DChart":
+                        HTEXLib.LineChart lineChart = new HTEXLib.LineChart { chartType = "line" };
+                        if (key.Equals("line3DChart"))
+                        {
+                            lineChart.is3D = true;
+                        }
+                        lineChart.lineType = key;
+                        var LineGrouping = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:grouping");
+                        if (LineGrouping != null)
+                        {
+                            //standard stacked percentStacked
+                            lineChart.lineType += "-" + LineGrouping.Attribute("val").Value;
+                        }
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                        lineChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                        charts.Add(lineChart);
+                        break;
+                    case "barChart":
+                    case "bar3DChart":
+                        var barDir = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:barDir");
+                        if (barDir != null)
+                        {
+                            if (barDir.Attribute("val").Value.Equals("bar"))
+                            {
+                                HTEXLib.BarChart barChart = new HTEXLib.BarChart { chartType = "bar" };
+                                charts.Add(barChart);
+                                if (key.Equals("bar3DChart"))
+                                {
+                                    barChart.is3D = true;
+                                }
+
+                                barChart.barType = key;
+                                var BarGrouping = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:grouping");
+                                if (BarGrouping != null)
+                                {
+                                    //standard stacked percentStacked
+                                    barChart.barType += "-" + BarGrouping.Attribute("val").Value;
+                                }
+                                serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                                barChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                                charts.Add(barChart);
+                            }
+                            else if (barDir.Attribute("val").Value.Equals("col"))
+                            {
+                                HTEXLib.ColChart colChart = new HTEXLib.ColChart { chartType = "col" };
+                                if (key.Equals("bar3DChart"))
+                                {
+                                    colChart.is3D = true;
+                                }
+                                colChart.colType = key.Replace("bar", "col");
+                                var ColGrouping = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:grouping");
+                                if (ColGrouping != null)
+                                {
+                                    //standard stacked percentStacked
+                                    colChart.colType += "-" + ColGrouping.Attribute("val").Value;
+                                }
+                                serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                                colChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                                charts.Add(colChart);
+                            }
+                        }
+                        break;
+                    case "areaChart":
+                    case "area3DChart":
+                        HTEXLib.AreaChart areaChart = new HTEXLib.AreaChart { chartType = "area" };
+                        if (key.Equals("area3DChart"))
+                        {
+                            areaChart.is3D = true;
+                        }
+                        areaChart.areaType = key;
+                        var AreaGrouping = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:grouping");
+                        if (AreaGrouping != null)
+                        {
+                            //standard stacked percentStacked
+                            areaChart.areaType += "-" + AreaGrouping.Attribute("val").Value;
+                        }
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                        areaChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                        charts.Add(areaChart);
+                        break;
+                    case "scatterChart":
+                    case "bubbleChart":
+                        HTEXLib.ScatterChart scatterChart = new HTEXLib.ScatterChart { chartType = "scatter" };
+                        scatterChart.scatterType = key;
+                        if (key.Equals("scatterChart"))
+                        {
+                            var ScatterStyle = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:scatterStyle");
+                            if (ScatterStyle != null)
+                            {
+                                scatterChart.scatterType += "-" + ScatterStyle.Attribute("val").Value.Replace("Marker", "");
+                            }
+                        }
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                        scatterChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                        charts.Add(scatterChart);
+                        break;
+                    case "radarChart":
+                        HTEXLib.RadarChart radarChart = new HTEXLib.RadarChart { chartType = "radar" };
+                        radarChart.radarType = key;
+                        var RadarStyle = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:radarStyle");
+                        if (RadarStyle != null)
+                        {
+                            radarChart.radarType += "-" + RadarStyle.Attribute("val").Value;
+                        }
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                        radarChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                        charts.Add(radarChart);
+                        break;
+                    case "plotAreaRegion":
+                        HTEXLib.PlotAreaChart plotAreaChart = new HTEXLib.PlotAreaChart { chartType = "plotArea" };
+                        plotAreaChart.plotAreaType = key;
+                        var PlotSeries = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "cx:series");
+                        if (PlotSeries != null)
+                        {
+                            plotAreaChart.plotAreaType += "-" + PlotSeries.Attribute("val").Value;
+                        }
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                        plotAreaChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                        charts.Add(plotAreaChart);
+                        break;
+                    case "stockChart":
+                        HTEXLib.StockChart stockChart = new HTEXLib.StockChart { chartType = "stock" };
+                        stockChart.stockType = key;
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                        stockChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                        charts.Add(stockChart);
+                        break;
+                    case "surfaceChart":
+                    case "surface3DChart":
+                        HTEXLib.SurfaceChart surfaceChart = new HTEXLib.SurfaceChart { chartType = "surface" };
+                        if (key.Equals("surface3DChart"))
+                        {
+                            surfaceChart.is3D = true;
+                        }
+                        surfaceChart.surfaceType = key;
+                        var Wireframe = HTEXLib.ShapeHelper.GetPPTXNodeByPath(child, "c:wireframe");
+                        if (Wireframe != null)
+                        {
+                            surfaceChart.surfaceType += "-" + Wireframe.Attribute("val").Value;
+                        }
+                        serNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(child, "c:ser");
+                        surfaceChart.datas = ExtractChartData(serNodes, wordDoc, element, ImageHandler, positionc);
+                        charts.Add(surfaceChart);
+                        break;
+                }
+            }
+            return charts;
+        }
+
+        public static List<Dictionary<string, object>> ExtractChartData(IEnumerable<XElement> nodes, WordprocessingDocument wordDoc, XElement element, Func<ImageInfo, XElement> ImageHandler, HTEXLib.Position positionc)
+        {
+
+            if (nodes != null)
+            {
+                List<Dictionary<string, object>> listDict = new List<Dictionary<string, object>>();
+                foreach (XElement node in nodes)
+                {
+
+                    if (HTEXLib.ShapeHelper.GetPPTXNodeByPath(node, "c:xVal") != null)
+                    {
+                        Dictionary<string, object> dict = new Dictionary<string, object>();
+                        var xCvNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(node, "c:xVal/c:numRef/c:numCache/c:pt/c:v");
+                        if (xCvNodes != null)
+                        {
+                            List<string> list = new List<string>();
+                            foreach (XElement cvNode in xCvNodes)
+                            {
+                                list.Add(cvNode.Value);
+                            }
+                            dict.Add("xAxis", list);
+                        }
+                        var yCvNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(node, "c:yVal/c:numRef/c:numCache/c:pt/c:v");
+                        if (yCvNodes != null)
+                        {
+                            List<string> list = new List<string>();
+                            foreach (XElement cvNode in yCvNodes)
+                            {
+                                list.Add(cvNode.Value);
+                            }
+                            dict.Add("yAxis", list);
+                        }
+                        dict.Add("colName", "-");
+                        listDict.Add(dict);
+                    }
+                    else
+                    {
+                        Dictionary<string, object> dict = new Dictionary<string, object>();
+                        var spPr = HTEXLib.ShapeHelper.GetPPTXNodeByPath(node, "c:spPr");
+                        if (spPr != null)
+                        {
+                            var ChartShapeProperties = new ChartShapeProperties(spPr.ToString());
+                           HTEXLib.Models.HTEX. ShapeStyle shapeStyle = WORDHelper.DoShapeProperties(wordDoc,ChartShapeProperties,element, ImageHandler, positionc);
+                            dict.Add("colStyle", shapeStyle);
+                        }
+                        else
+                        {
+                            dict.Add("colStyle", null);
+                        }
+                        var colNameNode = HTEXLib.ShapeHelper.GetPPTXNodeByPath(node,"c:tx/c:strRef/c:strCache/c:pt/c:v");
+                        if (colNameNode != null)
+                        {
+                            dict.Add("colName", colNameNode.Value);
+
+                        }
+                        //name
+                        var catNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(node, "c:cat/c:strRef/c:strCache/c:pt/c:v");
+                        if (catNodes == null)
+                        {
+                            catNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(node, "c:cat/c:numRef/c:numCache/c:pt/c:v");
+                        }
+                        if (catNodes != null)
+                        {
+                            List<string> list = new List<string>();
+                            foreach (XElement cvNode in catNodes)
+                            {
+                                list.Add(cvNode.Value);
+                            }
+                            dict.Add("xAxis", list);
+                        }
+                        //value
+                        var valNodes = HTEXLib.ShapeHelper.GetPPTXNodeListByPath(node, "c:val/c:numRef/c:numCache/c:pt/c:v");
+                        if (valNodes != null)
+                        {
+                            List<string> list = new List<string>();
+                            foreach (XElement cvNode in valNodes)
+                            {
+                                list.Add(cvNode.Value);
+                            }
+                            dict.Add("yAxis", list);
+                        }
+                        listDict.Add(dict);
+                    }
+                }
+                return listDict;
+            }
+            return null;
+        }
+        public static XElement ProcessDgm(WordprocessingDocument wordDoc, XElement containerElement, Func<ImageInfo, XElement> imageHandler,
+            int? extentCx, int? extentCy, string altText, XElement element, string hyperlinkUri)
+        {
+            var rdm = element.Attribute(R.dm);
+            var dgm = wordDoc.MainDocumentPart.Parts.FirstOrDefault(pp => pp.RelationshipId == rdm.Value);
+            return null;
+        }
+        public static XElement ProcessWps(WordprocessingDocument wordDoc, XElement element, Func<ImageInfo, XElement> imageHandler) {
 
+          //  var wps = element.Element(MC.Choice).Element(W.drawing).Element(WP.anchor).Element(A.graphic).Element(A.graphicData).Element(WPS.wsp);
+            WordprocessingShape wsp = new WordprocessingShape(element.ToString());
+            var ext = element.GetWordNodeByPath("wps:spPr/a:xfrm/a:ext");
+            var cx = ext.Attribute("cx").Value;
+            var cy = ext.Attribute("cy").Value;
+            HTEXLib.Shape shape = new HTEXLib.Shape();
+            HTEXLib.Position position = new HTEXLib.Position { x = 0, y = 0, cx = double.Parse(cx) * 96.0 / 914400, cy = double.Parse(cy) * 96.0 / 914400 };
+            var prstGeom = element.GetWordNodeByPath("wps:spPr/a:prstGeom");
+            if (prstGeom != null)
+            {
+                var shapeType = prstGeom.Attribute("prst").Value;
+                var svg = SvgHelper.GenShapeSvg(new PresetGeometry(prstGeom.ToString()), shapeType, position, null);
+            }
+            else
+            {
+
+                var custGeom = element.GetWordNodeByPath("wps:spPr/a:custGeom");
+                if (custGeom != null)
+                {
+                    DocumentFormat.OpenXml.Drawing.CustomGeometry shapeTypeCustom = new CustomGeometry(custGeom.ToString());
+                    shape = PPTXHelper.DoCustomGeometry(shapeTypeCustom, shape);
+                }
+
+            }
+            var ShapeStyle = WORDHelper.DoShapeProperties(wordDoc, wsp.GetFirstChild<DocumentFormat.OpenXml.Office2010.Word.DrawingShape.ShapeProperties>(), element, imageHandler, position);
+            SlideColor slideColor = WORDHelper.DoShapeStyle(wsp.GetFirstChild<DocumentFormat.OpenXml.Office2010.Word.DrawingShape.ShapeStyle>(), wordDoc);
+            //从ShapeProperties 获取 p:spPr
+            //再从 ShapeStyle 获取 p:spPr
+            if (ShapeStyle.border == null || ShapeStyle.border.color == null || ShapeStyle.border.color.type == -1)
+            {
+                if (slideColor != null)
+                {
+                    shape.style.border.color.solidFill = slideColor.LineColor;
+                    shape.style.border.color.type = 2;
+                }
+            }
+            else
+            {
+                shape.style.border = ShapeStyle.border;
+            }
+            if (ShapeStyle.fill == null || ShapeStyle.fill.type == -1)
+            {
+                if (slideColor != null)
+                {
+                    shape.style.fill.solidFill = slideColor.FillColor;
+                    shape.style.fill.type = 2;
+                }
+            }
+            else
+            {
+                shape.style.fill = ShapeStyle.fill;
+            }
+            var wpars = element.GetWordNodeListByPath("wps:txbx/w:txbxContent/w:p");
+            List<string> pars = new List<string>();
+            if (wpars != null)
+            {
+                foreach (var wpar in wpars)
+                {
+                    if (wpar.Value != null)
+                    {
+                        pars.Add(wpar.Value);
+                    }
+                }
+            }
+            return null;
+        }
 
         public static XElement ProcessOMath(XElement element)
         {
@@ -1494,6 +2016,7 @@ namespace OpenXmlPowerTools
                 xe.AddAnnotation(style);
                 content = xe;
             }
+
             return content;
         }
 
@@ -3078,7 +3601,7 @@ namespace OpenXmlPowerTools
         // Don't process wmf files (with contentType == "image/x-wmf") because GDI consumes huge amounts
         // of memory when dealing with wmf perhaps because it loads a DLL to do the rendering?
         // It actually works, but is not recommended.
-        private static readonly List<string> ImageContentTypes = new List<string>
+        public static readonly List<string> ImageContentTypes = new List<string>
         {
             "image/png", "image/gif", "image/tiff", "image/jpeg","image/x-wmf","image/x-emf","application/vnd.openxmlformats-officedocument.oleObject"
         };
@@ -3099,6 +3622,7 @@ namespace OpenXmlPowerTools
             {
                 return ProcessPictureOrObject(wordDoc, element , imageHandler);
             }
+            
             return null;
         }
 
@@ -3133,6 +3657,42 @@ namespace OpenXmlPowerTools
                 .Attributes(NoNamespace.cy).FirstOrDefault();
             var altText = (string)containerElement.Elements(WP.docPr).Attributes(NoNamespace.descr).FirstOrDefault() ??
                           ((string)containerElement.Elements(WP.docPr).Attributes(NoNamespace.name).FirstOrDefault() ?? "");
+
+            if (containerElement.Elements(A.graphic)
+                .Elements(A.graphicData) != null)
+            {
+                XElement rest = null; 
+                var elms = containerElement.Elements(A.graphic)
+                 .Elements(A.graphicData).Elements();
+                foreach (var elm in elms)
+                {
+                    if (elm.Name == Pic._pic)
+                    {
+                        rest= ProcessPic(wordDoc, containerElement, imageHandler, extentCx, extentCy, altText, elm, hyperlinkUri);
+                        break;
+                    }
+                    if (elm.Name == C.chart)
+                    {
+                        rest = ProcessChart(wordDoc, containerElement, imageHandler, extentCx, extentCy, altText, elm, hyperlinkUri);
+                        break;
+                    }
+                    if (elm.Name == DGM.relIds)
+                    {
+                        rest = ProcessDgm(wordDoc, containerElement, imageHandler, extentCx, extentCy, altText, elm, hyperlinkUri);
+                        break;
+
+                    }
+                }
+                return rest;
+            }
+            else {
+                return null;
+            }
+
+
+        }
+      public static XElement ProcessPic(WordprocessingDocument wordDoc,  XElement containerElement, Func<ImageInfo, XElement> imageHandler,
+          int? extentCx,int? extentCy,string altText, XElement element,string hyperlinkUri) {
             var blipFill = containerElement.Elements(A.graphic)
                 .Elements(A.graphicData)
                 .Elements(Pic._pic).Elements(Pic.blipFill).FirstOrDefault();
@@ -3205,7 +3765,6 @@ namespace OpenXmlPowerTools
                 return imgElement;
             }
         }
-
         private static XElement ProcessPictureOrObject(WordprocessingDocument wordDoc,
            XElement element, Func<ImageInfo, XElement> imageHandler)
         {

+ 3 - 3
HTEXLib/HTEXLib.csproj

@@ -4,9 +4,9 @@
     <Description>模板解析类型</Description>
     <PackageReleaseNotes>模板解析类型</PackageReleaseNotes>
     <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
-    <Version>2.1.5</Version>
-    <AssemblyVersion>2.1.5.5</AssemblyVersion>
-    <FileVersion>2.1.5.5</FileVersion>
+    <Version>2.1.6</Version>
+    <AssemblyVersion>2.1.6.6</AssemblyVersion>
+    <FileVersion>2.1.6.6</FileVersion>
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="DocumentFormat.OpenXml" Version="2.11.3" />

+ 1 - 1
HTEXLib/PPTX/Builders/HtexBuilder.cs

@@ -101,7 +101,7 @@ namespace HTEXLib.Builders
             int slideIndex = 1;
             XElement root = presentationDocument.ToFlatOpcDocument().Root;
             //获取所有的多媒体数据
-            IEnumerable<XElement> media = root.GetTextByPathList(("//pkg:part[@pkg:compression='store']"));
+            IEnumerable<XElement> media = root.GetPPTXNodeListByPath(("//pkg:part[@pkg:compression='store']"));
             //处理PPT的缩略图
             if (media!=null) {
                 var thumbnail = media.Where(x => x.Attributes().Select(y => y.Value == "/docProps/thumbnail.jpeg").FirstOrDefault()).FirstOrDefault();

+ 2 - 2
HTEXLib/PPTX/Builders/PPTContainerShapeBuilder.cs

@@ -104,7 +104,7 @@ namespace HTEXLib.Builders
                             //  var a = pa.GetFirstChild<DocumentFormat.OpenXml.Office2010.Drawing.TextMath>();
                             // OfficeMath
                             ///公式插入 线性 专用,普通文本区别
-                            var oMath = shp.GetTextByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
+                            var oMath = shp.GetPPTXNodeByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
                             if (oMath != null)
                             {
                                 var element = alternateContent.ChildElements.Where(x => typeof(AlternateContentFallback).Equals(x.GetType())).FirstOrDefault();
@@ -218,7 +218,7 @@ namespace HTEXLib.Builders
                             //  var a = pa.GetFirstChild<DocumentFormat.OpenXml.Office2010.Drawing.TextMath>();
                             // OfficeMath
                             ///公式插入 线性 专用,普通文本区别
-                            var oMath = shp.GetTextByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
+                            var oMath = shp.GetPPTXNodeByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
                             if (oMath != null)
                             {
                                 var element = alternateContent.ChildElements.Where(x => typeof(AlternateContentFallback).Equals(x.GetType())).FirstOrDefault();

+ 2 - 2
HTEXLib/PPTX/Helpers/ShapeHelpers/AnimtimeHelper.cs

@@ -122,7 +122,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
             List<KeyValuePair<string, AnimtimeData>> innerDict = new List<KeyValuePair<string, AnimtimeData>>();
             int stNum = 0;
             string spid = "";
-            var pRgs = commonTimeNode.GetTextByPathList("//p:tgtEl/p:spTgt/p:txEl/p:pRg");
+            var pRgs = commonTimeNode.GetPPTXNodeListByPath("//p:tgtEl/p:spTgt/p:txEl/p:pRg");
             if (pRgs != null && pRgs.Count() > 0)
             {
                 var st = pRgs.First().Attribute("st");
@@ -131,7 +131,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
                     stNum = int.Parse(st.Value.ToString()) + 2;
                 }
             }
-            var spTgt = commonTimeNode.GetTextByPathList("//p:spTgt");
+            var spTgt = commonTimeNode.GetPPTXNodeListByPath("//p:spTgt");
             if (spTgt != null && spTgt.Count() > 0)
             {
                 spid = spTgt.First().Attribute("spid").Value;

+ 12 - 17
HTEXLib/PPTX/Helpers/ShapeHelpers/PPTXHelper.cs

@@ -254,8 +254,8 @@ namespace HTEXLib.Helpers.ShapeHelpers
                     {
                         d += " z";
                     }
-                    List<SvgShape> shapes = new List<SvgShape>() {
-                    new SvgPath {
+                    Svg  shapes = 
+                    new Svg  {
                         type = "path",
                         // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + order + ")" : Fill.Color) : "url(#imgPtrn_" + order + ")"),
                         //Stroke = "#" + shapeBorder.Color,
@@ -264,13 +264,8 @@ namespace HTEXLib.Helpers.ShapeHelpers
                         d=d,
                         start=shape.style.border.headEnd!=null?shape.style.border.headEnd:null,
                         end=shape.style.border.tailEnd!=null?shape.style.border.tailEnd:null,
-                        }
-                    };
-                    shape.svg = new Svg
-                    {
-                      //  id = index + "",
-                        svgShape = shapes
                     };
+                    shape.svg = shapes;
                     shape.shapeType = "custom";
                 }
             }
@@ -1674,7 +1669,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
             }
             { htexBlipFill.rotWithShape =true; }
            
-            var fillRect = blipFill.GetTextByPath("a:stretch/a:fillRect");///拉伸
+            var fillRect = blipFill.GetPPTXNodeByPath("a:stretch/a:fillRect");///拉伸
             if (fillRect != null) {
                 htexBlipFill.fillRect = new Vector
                 {
@@ -1684,7 +1679,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
                     b = fillRect.Attribute("b") != null ? int.Parse(fillRect.Attribute("b").Value) / 1000 : 0
                 };
             }
-            var alphaModFix = blipFill.Blip.GetTextByPath("a:alphaModFix");
+            var alphaModFix = blipFill.Blip.GetPPTXNodeByPath("a:alphaModFix");
             if (alphaModFix != null) {
                 if (alphaModFix.Attribute("amt") != null) {
                     htexBlipFill.opacity = int.Parse(alphaModFix.Attribute("amt").Value) * 1.0 / 1000;
@@ -1750,7 +1745,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
             }
             { htexBlipFill.rotWithShape = true; }
 
-            var fillRect = blipFill.GetTextByPath("a:stretch/a:fillRect");///拉伸
+            var fillRect = blipFill.GetPPTXNodeByPath("a:stretch/a:fillRect");///拉伸
             if (fillRect != null)
             {
                 htexBlipFill.fillRect = new Vector
@@ -1761,7 +1756,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
                     b = fillRect.Attribute("b") != null ? int.Parse(fillRect.Attribute("b").Value) / 1000 : 0
                 };
             }
-            var alphaModFix = blipFill.Blip.GetTextByPath("a:alphaModFix");
+            var alphaModFix = blipFill.Blip.GetPPTXNodeByPath("a:alphaModFix");
             if (alphaModFix != null)
             {
                 if (alphaModFix.Attribute("amt") != null)
@@ -1948,7 +1943,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
         public static (string type, string stroke) DoCustDash(CustomDash custDash) {
             string type = "cust";
             string stroke = "0";
-            IEnumerable<XElement> elements= custDash.GetTextByPathList("ds");
+            IEnumerable<XElement> elements= custDash.GetPPTXNodeListByPath("ds");
             if (elements != null) {
                 foreach (XElement element in elements) {
                     var d= element.Attribute("d");//线段长度
@@ -2106,7 +2101,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
                 });
             }
             gradientFill.colors = colors;
-            var lin = GradientFill.GetTextByPath("//a:lin");
+            var lin = GradientFill.GetPPTXNodeByPath("//a:lin");
             double? rot = null;
             string scaled = "";
             //线性模式
@@ -2123,14 +2118,14 @@ namespace HTEXLib.Helpers.ShapeHelpers
                 }
                 gradientFill.line = new LineFill { rot = rot, scaled = scaled };
             }
-            var path = GradientFill.GetTextByPath("//a:path");
+            var path = GradientFill.GetPPTXNodeByPath("//a:path");
             if (path != null) {
                 type = "path";
                 ///circle
                 ///rect
                 ///shape 
                 var pathType= path.Attribute("path").Value;
-                var fillToRect=path.GetTextByPath("//a:fillToRect");
+                var fillToRect=path.GetPPTXNodeByPath("//a:fillToRect");
                 if (fillToRect != null) {
                     Vector vector=  new Vector();
                     var bnode = fillToRect.Attribute("b");
@@ -2156,7 +2151,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
                     gradientFill.path =new PathFill {fillToRect= vector,pathType= pathType } ;
                 }
             }
-            var tileRect = GradientFill.GetTextByPath("//a:tileRect");
+            var tileRect = GradientFill.GetPPTXNodeByPath("//a:tileRect");
             if (tileRect != null) {
                 ///四个方向的偏移量,矩形的下边缘。例如50000/1000= 50% ,辐射百分比
                 Vector vector = new Vector();

+ 20 - 20
HTEXLib/PPTX/Helpers/ShapeHelpers/ShapeHelper.cs

@@ -19,38 +19,38 @@ namespace HTEXLib
         private const double rot60000 = 60000.00;
       
         public static XmlNamespaceManager xmlnsManager;
-        public static XmlNode GetTextByPath(this XmlDocument document, string expression)
-        {
-            return document.SelectSingleNode(expression, xmlnsManager);
-        }
-        public static XmlNode GetTextByPath(this XmlNode node, string expression)
-        {
+        //public static XmlNode GetTextByPath(this XmlDocument document, string expression)
+        //{
+        //    return document.SelectSingleNode(expression, xmlnsManager);
+        //}
+        //public static XmlNode GetTextByPath(this XmlNode node, string expression)
+        //{
 
-            return node.SelectSingleNode(expression, xmlnsManager);
-        }
+        //    return node.SelectSingleNode(expression, xmlnsManager);
+        //}
 
 
-        public static XmlNodeList GetTextByPathList(this XmlDocument document, string expression)
-        {
-            return document.SelectNodes(expression, xmlnsManager);
-        }
-        public static XmlNodeList GetTextByPathList(this XmlNode node, string expression)
-        {
-            return node.SelectNodes(expression, xmlnsManager);
-        }
-        public static IEnumerable<XElement> GetTextByPathList(this XElement xElement, string expression)
+        //public static XmlNodeList GetTextByPathList(this XmlDocument document, string expression)
+        //{
+        //    return document.SelectNodes(expression, xmlnsManager);
+        //}
+        //public static XmlNodeList GetTextByPathList(this XmlNode node, string expression)
+        //{
+        //    return node.SelectNodes(expression, xmlnsManager);
+        //}
+        public static IEnumerable<XElement> GetPPTXNodeListByPath(this XElement xElement, string expression)
         {
             return xElement.XPathSelectElements(expression, xmlnsManager);
         }
-        public static XElement GetTextByPath(this XElement xElement, string expression)
+        public static XElement GetPPTXNodeByPath(this XElement xElement, string expression)
         {
             return xElement.XPathSelectElement(expression, xmlnsManager);
         }
-        public static IEnumerable<XElement> GetTextByPathList(this OpenXmlElement node, string expression)
+        public static IEnumerable<XElement> GetPPTXNodeListByPath(this OpenXmlElement node, string expression)
         {
             return XElement.Parse(node.OuterXml).XPathSelectElements(expression, xmlnsManager);
         }
-        public static XElement GetTextByPath(this OpenXmlElement node, string expression)
+        public static XElement GetPPTXNodeByPath(this OpenXmlElement node, string expression)
         {
             return XElement.Parse(node.OuterXml).XPathSelectElement(expression, xmlnsManager);
         }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 690 - 579
HTEXLib/PPTX/Helpers/ShapeHelpers/SvgHelper.cs


+ 32 - 34
HTEXLib/PPTX/Models/HTEX/HtexChart.cs

@@ -129,11 +129,9 @@ namespace HTEXLib.Models.HTEX
             chart.style.fill = shapeStyleChart != null ? shapeStyleChart.fill : null;
             chart.style.border = shapeStyleChart != null ? shapeStyleChart.border : null;
             chart.style.effect= shapeStyleChart != null ? shapeStyleChart.effect : null;
-            chart.svg = new Svg { svgShape = new List<SvgShape> {
-                new SvgPath{
-                        type="path",
-                        d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx+" "+position.cy+",L"+0+" "+position.cy + " z"
-                    }
+            chart.svg = new Svg {
+                type = "path",
+                d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx + " " + position.cy + ",L" + 0 + " " + position.cy + " z"
                 //new Rect {
                 //    x=position.x, 
                 //    y = position.y,
@@ -141,7 +139,7 @@ namespace HTEXLib.Models.HTEX
                 //    height=position.cy,
                 //    type="rect"
                 //    } 
-                } 
+
             };
             if (chart.style != null) {
                 if (chart.style.fill.type == -1 || chart.style.fill.type == 0)
@@ -699,14 +697,14 @@ namespace HTEXLib.Models.HTEX
                         pieChart.pieType = key;
                         if (key.Equals("ofPieChart"))
                         {
-                            var ofPieType = child.GetTextByPath("c:ofPieType");
+                            var ofPieType = child.GetPPTXNodeByPath("c:ofPieType");
                             if (ofPieType != null)
                             {
                                 //ofPieChart-pie ofPieChart-bar  子母饼图
                                 pieChart.pieType += "-" + ofPieType.Attribute("val").Value;
                             }
                         }
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         pieChart.datas = ExtractChartData(serNodes);
                         charts.Add(pieChart);
                         break;
@@ -718,19 +716,19 @@ namespace HTEXLib.Models.HTEX
                             lineChart.is3D = true;
                         }
                         lineChart.lineType = key;
-                        var LineGrouping = child.GetTextByPath("c:grouping");
+                        var LineGrouping = child.GetPPTXNodeByPath("c:grouping");
                         if (LineGrouping != null)
                         {
                             //standard stacked percentStacked
                             lineChart.lineType += "-" + LineGrouping.Attribute("val").Value;
                         }
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         lineChart.datas = ExtractChartData(serNodes);
                         charts.Add(lineChart);
                         break;
                     case "barChart":
                     case "bar3DChart":
-                        var barDir = child.GetTextByPath("c:barDir");
+                        var barDir = child.GetPPTXNodeByPath("c:barDir");
                         if (barDir != null)
                         {
                             if (barDir.Attribute("val").Value.Equals("bar"))
@@ -743,13 +741,13 @@ namespace HTEXLib.Models.HTEX
                                 }
 
                                 barChart.barType = key;
-                                var BarGrouping = child.GetTextByPath("c:grouping");
+                                var BarGrouping = child.GetPPTXNodeByPath("c:grouping");
                                 if (BarGrouping != null)
                                 {
                                     //standard stacked percentStacked
                                     barChart.barType += "-" + BarGrouping.Attribute("val").Value;
                                 }
-                                serNodes = child.GetTextByPathList("c:ser");
+                                serNodes = child.GetPPTXNodeListByPath("c:ser");
                                 barChart.datas = ExtractChartData(serNodes);
                                 charts.Add(barChart);
                             }
@@ -761,13 +759,13 @@ namespace HTEXLib.Models.HTEX
                                     colChart.is3D = true;
                                 }
                                 colChart.colType = key.Replace("bar", "col");
-                                var ColGrouping = child.GetTextByPath("c:grouping");
+                                var ColGrouping = child.GetPPTXNodeByPath("c:grouping");
                                 if (ColGrouping != null)
                                 {
                                     //standard stacked percentStacked
                                     colChart.colType += "-" + ColGrouping.Attribute("val").Value;
                                 }
-                                serNodes = child.GetTextByPathList("c:ser");
+                                serNodes = child.GetPPTXNodeListByPath("c:ser");
                                 colChart.datas = ExtractChartData(serNodes);
                                 charts.Add(colChart);
                             }
@@ -781,13 +779,13 @@ namespace HTEXLib.Models.HTEX
                             areaChart.is3D = true;
                         }
                         areaChart.areaType = key;
-                        var AreaGrouping = child.GetTextByPath("c:grouping");
+                        var AreaGrouping = child.GetPPTXNodeByPath("c:grouping");
                         if (AreaGrouping != null)
                         {
                             //standard stacked percentStacked
                             areaChart.areaType += "-" + AreaGrouping.Attribute("val").Value;
                         }
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         areaChart.datas = ExtractChartData(serNodes);
                         charts.Add(areaChart);
                         break;
@@ -797,44 +795,44 @@ namespace HTEXLib.Models.HTEX
                         scatterChart.scatterType = key;
                         if (key.Equals("scatterChart"))
                         {
-                            var ScatterStyle = child.GetTextByPath("c:scatterStyle");
+                            var ScatterStyle = child.GetPPTXNodeByPath("c:scatterStyle");
                             if (ScatterStyle != null)
                             {
                                 scatterChart.scatterType += "-" + ScatterStyle.Attribute("val").Value.Replace("Marker", "");
                             }
                         }
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         scatterChart.datas = ExtractChartData(serNodes);
                         charts.Add(scatterChart);
                         break;
                     case "radarChart":
                         RadarChart radarChart = new RadarChart { chartType = "radar" };
                         radarChart.radarType = key;
-                        var RadarStyle = child.GetTextByPath("c:radarStyle");
+                        var RadarStyle = child.GetPPTXNodeByPath("c:radarStyle");
                         if (RadarStyle != null)
                         {
                             radarChart.radarType += "-" + RadarStyle.Attribute("val").Value;
                         }
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         radarChart.datas = ExtractChartData(serNodes);
                         charts.Add(radarChart);
                         break;
                     case "plotAreaRegion":
                         PlotAreaChart plotAreaChart = new PlotAreaChart { chartType = "plotArea" };
                         plotAreaChart.plotAreaType = key;
-                        var PlotSeries = child.GetTextByPath("cx:series");
+                        var PlotSeries = child.GetPPTXNodeByPath("cx:series");
                         if (PlotSeries != null)
                         {
                             plotAreaChart.plotAreaType += "-" + PlotSeries.Attribute("val").Value;
                         }
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         plotAreaChart.datas = ExtractChartData(serNodes);
                         charts.Add(plotAreaChart);
                         break;
                     case "stockChart":
                         StockChart stockChart = new StockChart { chartType = "stock" };
                         stockChart.stockType = key;
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         stockChart.datas = ExtractChartData(serNodes);
                         charts.Add(stockChart);
                         break;
@@ -846,12 +844,12 @@ namespace HTEXLib.Models.HTEX
                             surfaceChart.is3D = true;
                         }
                         surfaceChart.surfaceType = key;
-                        var Wireframe = child.GetTextByPath("c:wireframe");
+                        var Wireframe = child.GetPPTXNodeByPath("c:wireframe");
                         if (Wireframe != null)
                         {
                             surfaceChart.surfaceType += "-" + Wireframe.Attribute("val").Value;
                         }
-                        serNodes = child.GetTextByPathList("c:ser");
+                        serNodes = child.GetPPTXNodeListByPath("c:ser");
                         surfaceChart.datas = ExtractChartData(serNodes);
                         charts.Add(surfaceChart);
                         break;
@@ -869,10 +867,10 @@ namespace HTEXLib.Models.HTEX
                 foreach (XElement node in nodes)
                 {
 
-                    if (node.GetTextByPath("c:xVal") != null)
+                    if (node.GetPPTXNodeByPath("c:xVal") != null)
                     {
                         Dictionary<string, object> dict = new Dictionary<string, object>();
-                        var xCvNodes = node.GetTextByPathList("c:xVal/c:numRef/c:numCache/c:pt/c:v");
+                        var xCvNodes = node.GetPPTXNodeListByPath("c:xVal/c:numRef/c:numCache/c:pt/c:v");
                         if (xCvNodes != null)
                         {
                             List<string> list = new List<string>();
@@ -882,7 +880,7 @@ namespace HTEXLib.Models.HTEX
                             }
                             dict.Add("xAxis", list);
                         }
-                        var yCvNodes = node.GetTextByPathList("c:yVal/c:numRef/c:numCache/c:pt/c:v");
+                        var yCvNodes = node.GetPPTXNodeListByPath("c:yVal/c:numRef/c:numCache/c:pt/c:v");
                         if (yCvNodes != null)
                         {
                             List<string> list = new List<string>();
@@ -898,7 +896,7 @@ namespace HTEXLib.Models.HTEX
                     else
                     {
                         Dictionary<string, object> dict = new Dictionary<string, object>();
-                        var spPr = node.GetTextByPath("c:spPr");
+                        var spPr = node.GetPPTXNodeByPath("c:spPr");
                         if (spPr != null)
                         {
                             var ChartShapeProperties = new ChartShapeProperties(spPr.ToString());
@@ -908,17 +906,17 @@ namespace HTEXLib.Models.HTEX
                         else {
                             dict.Add("colStyle", null);
                         }
-                        var colNameNode = node.GetTextByPath("c:tx/c:strRef/c:strCache/c:pt/c:v");
+                        var colNameNode = node.GetPPTXNodeByPath("c:tx/c:strRef/c:strCache/c:pt/c:v");
                         if (colNameNode != null)
                         {
                             dict.Add("colName", colNameNode.Value);
                            
                         }
                         //name
-                        var catNodes = node.GetTextByPathList("c:cat/c:strRef/c:strCache/c:pt/c:v");
+                        var catNodes = node.GetPPTXNodeListByPath("c:cat/c:strRef/c:strCache/c:pt/c:v");
                         if (catNodes == null)
                         {
-                            catNodes = node.GetTextByPathList("c:cat/c:numRef/c:numCache/c:pt/c:v");
+                            catNodes = node.GetPPTXNodeListByPath("c:cat/c:numRef/c:numCache/c:pt/c:v");
                         }
                         if (catNodes != null)
                         {
@@ -930,7 +928,7 @@ namespace HTEXLib.Models.HTEX
                             dict.Add("xAxis", list);
                         }
                         //value
-                        var valNodes = node.GetTextByPathList("c:val/c:numRef/c:numCache/c:pt/c:v");
+                        var valNodes = node.GetPPTXNodeListByPath("c:val/c:numRef/c:numCache/c:pt/c:v");
                         if (valNodes != null)
                         {
                             List<string> list = new List<string>();

+ 1 - 1
HTEXLib/PPTX/Models/HTEX/HtexConnectionShape.cs

@@ -68,7 +68,7 @@ namespace HTEXLib.Models.HTEX
                 }
             }
            
-            Svg svg = SvgHelper.GenShapeSvg(connectionShape.element, shapeType, position,   shapeBorder);
+            Svg svg = SvgHelper.GenShapeSvg(shapeTypeNode, shapeType, position,   shapeBorder);
             Connector item = new Connector { sid =sid, type =type,cxnType=shapeType,index = index,  svg = svg ,uid= connectionShape .suid};
             item.style.position = position;
             item.style.border = shapeBorder;

+ 11 - 15
HTEXLib/PPTX/Models/HTEX/HtexDiagram.cs

@@ -156,21 +156,17 @@ namespace HTEXLib.Models.HTEX
             SetChildShape( ShapeTree, colorsPart, stylePart,layoutDefinitionPart);
             diagram.svg = new Svg
             {
-                svgShape = new List<SvgShape> 
-                {
-                     new SvgPath{
-                        type="path",
-                        d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx+" "+position.cy+",L"+0+" "+position.cy + " z"
-                    }
-                    //new Rect 
-                    //{
-                    //    x=position.x,
-                    //    y = position.y,
-                    //    width=position.cx,
-                    //    height=position.cy,
-                    //    type="rect"
-                    //} 
-                }
+                type = "path",
+                d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx + " " + position.cy + ",L" + 0 + " " + position.cy + " z"
+                //new Rect 
+                //{
+                //    x=position.x,
+                //    y = position.y,
+                //    width=position.cx,
+                //    height=position.cy,
+                //    type="rect"
+                //} 
+
             };
             return diagram;
         }

+ 11 - 15
HTEXLib/PPTX/Models/HTEX/HtexGroupShape.cs

@@ -67,21 +67,17 @@ namespace HTEXLib.Models.HTEX
             group.links = slide.hyperlinks;
             group.svg = new Svg
             {
-                svgShape = new List<SvgShape>
-                {
-                    new SvgPath{
-                        type="path",
-                        d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx+" "+position.cy+",L"+0+" "+position.cy + " z"
-                    }
-                    //new Rect
-                    //{
-                    //    x=position.x,
-                    //    y = position.y,
-                    //    width=position.cx,
-                    //    height=position.cy,
-                    //    type="rect"
-                    //}
-                }
+                type = "path",
+                d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx + " " + position.cy + ",L" + 0 + " " + position.cy + " z"
+                //new Rect
+                //{
+                //    x=position.x,
+                //    y = position.y,
+                //    width=position.cx,
+                //    height=position.cy,
+                //    type="rect"
+                //}
+
             };
             return new List<Item>() { group };
         }

+ 11 - 15
HTEXLib/PPTX/Models/HTEX/HtexImage.cs

@@ -131,21 +131,17 @@ namespace HTEXLib.Models.HTEX
 
             media.svg = new Svg
             {
-                svgShape = new List<SvgShape>
-                {
-                    new SvgPath{
-                        type="path",
-                        d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx+" "+position.cy+",L"+0+" "+position.cy + " z"
-                    }
-                    //new Rect
-                    //{
-                    //    x=position.x,
-                    //    y = position.y,
-                    //    width=position.cx,
-                    //    height=position.cy,
-                    //    type="rect"
-                    //}
-                }
+                type = "path",
+                d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx + " " + position.cy + ",L" + 0 + " " + position.cy + " z"
+                //new Rect
+                //{
+                //    x=position.x,
+                //    y = position.y,
+                //    width=position.cx,
+                //    height=position.cy,
+                //    type="rect"
+                //}
+
             };
             media.links = slide.hyperlinks;
             return new List<Item>() { media }; 

+ 14 - 18
HTEXLib/PPTX/Models/HTEX/HtexMath.cs

@@ -79,7 +79,7 @@ namespace HTEXLib.Models.HTEX
             if (shapeTypeNode != null && shapeTypeNode.Preset != null && !string.IsNullOrEmpty(shapeTypeNode.Preset.InnerText))
             {
                 var shapeType = shapeTypeNode.Preset.InnerText;
-                Svg svg = SvgHelper.GenShapeSvg(pptMath.element,shapeType, position, math.style.border);
+                Svg svg = SvgHelper.GenShapeSvg(shapeTypeNode, shapeType, position, math.style.border);
                 math.svg = svg;
                 math.shapeType = shapeType;
             }
@@ -89,11 +89,11 @@ namespace HTEXLib.Models.HTEX
             foreach (var pa in Paragraphs)
             {   // OfficeMath
                        ///公式插入 线性 专用,普通文本区别
-                var oMath = shp.GetTextByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
+                var oMath = shp.GetPPTXNodeByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
                 double pitchFamily = 18.0;
                 string typeface = "";
                 OfficeMath officeMath = new OfficeMath(oMath.ToString());
-                var rRr = oMath.GetTextByPath("//a:rPr");
+                var rRr = oMath.GetPPTXNodeByPath("//a:rPr");
                 if (rRr != null) {
                     var TextCharacterPropertiesType = new DocumentFormat.OpenXml.Drawing.RunProperties(rRr.ToString());
                     if (TextCharacterPropertiesType != null) {
@@ -178,21 +178,17 @@ namespace HTEXLib.Models.HTEX
             }
             math.svg = new Svg
             {
-                svgShape = new List<SvgShape>
-                {
-                    new SvgPath{
-                        type="path",
-                        d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx+" "+position.cy+",L"+0+" "+position.cy + " z"
-                    }
-                    //new Rect
-                    //{
-                    //    x=position.x,
-                    //    y = position.y,
-                    //    width=position.cx,
-                    //    height=position.cy,
-                    //    type="rect"
-                    //}
-                }
+                type = "path",
+                d = "M" + 0 + " " + 0 + ",L" + position.cx + " " + 0 + ",L" + position.cx + " " + position.cy + ",L" + 0 + " " + position.cy + " z"
+                //new Rect
+                //{
+                //    x=position.x,
+                //    y = position.y,
+                //    width=position.cx,
+                //    height=position.cy,
+                //    type="rect"
+                //}
+
             };
             math.links = slide.hyperlinks;
             return new List<Item> { math };

+ 3 - 3
HTEXLib/PPTX/Models/HTEX/HtexShape.cs

@@ -105,12 +105,12 @@ namespace HTEXLib.Models.HTEX
             if (shapeTypeNode != null && shapeTypeNode.Preset != null && !string.IsNullOrEmpty(shapeTypeNode.Preset.InnerText))
             {
                 shapeType = shapeTypeNode.Preset.InnerText;
-                Svg svg = SvgHelper.GenShapeSvg(Shape.element,  shapeType, position, shape.style.border);
+                Svg svg = SvgHelper.GenShapeSvg(shapeTypeNode,  shapeType, position, shape.style.border);
                 shape.svg = svg;
                 shape.shapeType = shapeType;
             }
             else {
-                Svg svg = SvgHelper.GenShapeSvg(Shape.element,  shapeType, position, shape.style.border);
+                Svg svg = SvgHelper.GenShapeSvg(shapeTypeNode,  shapeType, position, shape.style.border);
                 shape.svg = svg;
                 shape.shapeType = shapeType;
             }
@@ -190,7 +190,7 @@ namespace HTEXLib.Models.HTEX
                 if (par.RunPropList == null || par.RunPropList.Count == 0 && par.defaultRunProperties != null)  //Only paragraph!
                 {
                     float points = float.Parse(par.defaultRunProperties.FontSize.ToString()) * 72.0F / 96.0F;
-                    Font font = new System.Drawing.Font(par.defaultRunProperties.FontFamily.ToString(), points);
+                    Font font = new System.Drawing.Font(par.defaultRunProperties.FontFamily.ToString(), points<=0?12:points );
                     newTop = font.Height;
                 }
                 List<HtexText> processedElements = new List<HtexText>();

+ 2 - 2
HTEXLib/PPTX/Models/PPTX/DSPShape.cs

@@ -84,13 +84,13 @@ namespace HTEXLib.Models.PPTX
             if (shapeTypeNode != null && shapeTypeNode.Preset != null && !string.IsNullOrEmpty(shapeTypeNode.Preset.InnerText))
             {
                 shapeType = shapeTypeNode.Preset.InnerText;
-                Svg svg = SvgHelper.GenShapeSvg(shape, shapeType, position, dspshape.style.border);
+                Svg svg = SvgHelper.GenShapeSvg(shapeTypeNode, shapeType, position, dspshape.style.border);
                 dspshape.svg = svg;
                 dspshape.shapeType = shapeType;
             }
             else
             {
-                Svg svg = SvgHelper.GenShapeSvg(shape,  shapeType, position, dspshape.style.border);
+                Svg svg = SvgHelper.GenShapeSvg(shapeTypeNode,  shapeType, position, dspshape.style.border);
                 dspshape.svg = svg;
                 dspshape.shapeType = shapeType;
             }

+ 1 - 1
HTEXLib/PPTX/Models/PPTX/PPTAlternateContent.cs

@@ -43,7 +43,7 @@ namespace HTEXLib.Models.Inner
                 //  var a = pa.GetFirstChild<DocumentFormat.OpenXml.Office2010.Drawing.TextMath>();
                 // OfficeMath
                 ///公式插入 线性 专用,普通文本区别
-                var oMath = shp.GetTextByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
+                var oMath = shp.GetPPTXNodeByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
                 if (oMath != null)
                 {
                     var element = alternateContent.ChildElements.Where(x => typeof(AlternateContentFallback).Equals(x.GetType())).FirstOrDefault();

+ 1 - 1
HTEXLib/PPTX/Models/PPTX/PPTGroupShape.cs

@@ -86,7 +86,7 @@ namespace HTEXLib.Models.Inner
                             //  var a = pa.GetFirstChild<DocumentFormat.OpenXml.Office2010.Drawing.TextMath>();
                             // OfficeMath
                             ///公式插入 线性 专用,普通文本区别
-                            var oMath = shp.GetTextByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
+                            var oMath = shp.GetPPTXNodeByPath("//p:txBody/a:p/a14:m/m:oMathPara/m:oMath");
                             if (oMath != null)
                             {
                                 var Fallback = alternateContent.ChildElements.Where(x => typeof(AlternateContentFallback).Equals(x.GetType())).FirstOrDefault();

+ 70 - 71
HTEXLib/PPTX/Models/Shape.cs

@@ -17,22 +17,21 @@ namespace HTEXLib
 
     }
 
-    public class Svg {
+     
         // public string id { get; set; }
         //public string Width { get; set; }
         //public string Height { get; set; }
         //public string Top { get; set; }
         //public string Left { get; set; }
         //public string Style { get; set; }
-        public List<SvgShape> svgShape { get; set; }
+    //    public Svg Svg { get; set; }
         //public string Defs { get; set; }
       //  public string Transform { get; set; }
   
        // public string SvgData { get; set; }
-       
-    }
+    
 
-    public abstract class SvgShape {
+    public   class Svg {
         // rect ,circle ,ellipse ,line ,polygon ,polyline ,path
         public string type { get; set; }
        // public string Style { get; set; }
@@ -62,76 +61,76 @@ namespace HTEXLib
         /// 结束长度
         /// </summary>
         public string end_len { get; set; }
-
+        public string d { get; set; }
         //填充色的不透明度
         //  public string FillOpacity { get; set; } = "1";
     }
-    public class Rect : SvgShape
-    { 
-        //矩形左上角的x位置
-        public double x { get; set; }
-        //矩形左上角的y位置
-        public double y { get; set; }
-        //矩形的宽度
-        public double width { get; set; }
-        //矩形的高度
-        public double height { get; set; }
-        // 圆角的x方位的半径
-        public double rx { get; set; }
-        // 圆角的y方位的半径
-        public double ry { get; set; }
-    }
-    public class Circle : SvgShape
-    {
-        //圆的半径
-        public double r { get; set; }
-        //圆心的x位置
-        public double cx { get; set; }
-        //圆心的y位置
-        public double cy { get; set; }
-    }
-    public class Ellipse : SvgShape
-    {
-        // 椭圆的x方位的半径
-        public double rx { get; set; }
-        // 椭圆的y方位的半径
-        public double ry { get; set; }
+    //public class Rect : SvgShape
+    //{ 
+    //    //矩形左上角的x位置
+    //    public double x { get; set; }
+    //    //矩形左上角的y位置
+    //    public double y { get; set; }
+    //    //矩形的宽度
+    //    public double width { get; set; }
+    //    //矩形的高度
+    //    public double height { get; set; }
+    //    // 圆角的x方位的半径
+    //    public double rx { get; set; }
+    //    // 圆角的y方位的半径
+    //    public double ry { get; set; }
+    //}
+    //public class Circle : SvgShape
+    //{
+    //    //圆的半径
+    //    public double r { get; set; }
+    //    //圆心的x位置
+    //    public double cx { get; set; }
+    //    //圆心的y位置
+    //    public double cy { get; set; }
+    //}
+    //public class Ellipse : SvgShape
+    //{
+    //    // 椭圆的x方位的半径
+    //    public double rx { get; set; }
+    //    // 椭圆的y方位的半径
+    //    public double ry { get; set; }
 
-        //椭圆的x位置
-        public double cx { get; set; }
-        //椭圆的y位置
-        public double cy { get; set; }
-    }
-    public class Line : SvgShape
-    {
-        //起点的x位置
-        public double x1 { get; set; }
-        //起点的Y位置
-        public double y1 { get; set; }
-        //终点的X位置
-        public double x2 { get; set; }
-        //终点的Y位置
-        public double y2 { get; set; }
-    }
-    public class Polyline : SvgShape
-    {
-        /// <summary>
-        /// 点集数列。每个数字用空白、逗号、终止命令符或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。
-        /// </summary>
-        public string points { get; set; }
-    }
-    public class Polygon : SvgShape
-    {
-        /// <summary>
-        /// 点集数列。每个数字用空白符、逗号、终止命令或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。
-        /// 所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。路径绘制完后闭合图形,所以最终的直线将从位置(2,2)连接到位置(0,0)。
-        /// </summary>
-        public string points { get; set; }
+    //    //椭圆的x位置
+    //    public double cx { get; set; }
+    //    //椭圆的y位置
+    //    public double cy { get; set; }
+    //}
+    //public class Line : SvgShape
+    //{
+    //    //起点的x位置
+    //    public double x1 { get; set; }
+    //    //起点的Y位置
+    //    public double y1 { get; set; }
+    //    //终点的X位置
+    //    public double x2 { get; set; }
+    //    //终点的Y位置
+    //    public double y2 { get; set; }
+    //}
+    //public class Polyline : SvgShape
+    //{
+    //    /// <summary>
+    //    /// 点集数列。每个数字用空白、逗号、终止命令符或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。
+    //    /// </summary>
+    //    public string points { get; set; }
+    //}
+    //public class Polygon : SvgShape
+    //{
+    //    /// <summary>
+    //    /// 点集数列。每个数字用空白符、逗号、终止命令或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。
+    //    /// 所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。路径绘制完后闭合图形,所以最终的直线将从位置(2,2)连接到位置(0,0)。
+    //    /// </summary>
+    //    public string points { get; set; }
 
-    }
-    public class SvgPath : SvgShape
-    {
-        public string d { get; set; }
+    //}
+    //public class SvgPath : Svg
+    //{
+      
     
-    }
+    //}
 }

+ 15 - 0
HTEXTest/HTEXTest.csproj

@@ -13,6 +13,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="DotNetZip" Version="1.15.0" />
     <PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
   </ItemGroup>
 
@@ -22,4 +23,18 @@
     <ProjectReference Include="..\HTEXLib\HTEXLib.csproj" />
   </ItemGroup>
 
+ 
+
+  <ItemGroup>
+    <Reference Include="HandWriteRecognizerCSharp">
+      <HintPath>dll\HandWriteRecognizerCSharp.dll</HintPath>
+    </Reference>
+    <Reference Include="HandWriteRecognizerLib">
+      <HintPath>dll\HandWriteRecognizerLib.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Ink">
+      <HintPath>dll\Microsoft.Ink.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+
 </Project>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 370 - 80
HTEXTest/Program.cs


BIN
HTEXTest/dll/HandWriteRecognizerCSharp.dll


BIN
HTEXTest/dll/HandWriteRecognizerLib.dll


BIN
HTEXTest/dll/Microsoft.Ink.dll


+ 39 - 0
HTEXWebTest/Controllers/WeatherForecastController.cs

@@ -0,0 +1,39 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace HTEXWebTest.Controllers
+{
+    [ApiController]
+    [Route("[controller]")]
+    public class WeatherForecastController : ControllerBase
+    {
+        private static readonly string[] Summaries = new[]
+        {
+            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
+        };
+
+        private readonly ILogger<WeatherForecastController> _logger;
+
+        public WeatherForecastController(ILogger<WeatherForecastController> logger)
+        {
+            _logger = logger;
+        }
+
+        [HttpGet]
+        public IEnumerable<WeatherForecast> Get()
+        {
+            var rng = new Random();
+            return Enumerable.Range(1, 5).Select(index => new WeatherForecast
+            {
+                Date = DateTime.Now.AddDays(index),
+                TemperatureC = rng.Next(-20, 55),
+                Summary = Summaries[rng.Next(Summaries.Length)]
+            })
+            .ToArray();
+        }
+    }
+}

+ 12 - 0
HTEXWebTest/HTEXWebTest.csproj

@@ -0,0 +1,12 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="TEAMModelOS.SDK" Version="3.0.1223" />
+  </ItemGroup>
+
+
+</Project>

+ 26 - 0
HTEXWebTest/Program.cs

@@ -0,0 +1,26 @@
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace HTEXWebTest
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+            CreateHostBuilder(args).Build().Run();
+        }
+
+        public static IHostBuilder CreateHostBuilder(string[] args) =>
+            Host.CreateDefaultBuilder(args)
+                .ConfigureWebHostDefaults(webBuilder =>
+                {
+                    webBuilder.UseStartup<Startup>();
+                });
+    }
+}

+ 30 - 0
HTEXWebTest/Properties/launchSettings.json

@@ -0,0 +1,30 @@
+{
+  "$schema": "http://json.schemastore.org/launchsettings.json",
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "http://localhost:59873",
+      "sslPort": 44366
+    }
+  },
+  "profiles": {
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "launchBrowser": true,
+      "launchUrl": "weatherforecast",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    },
+    "HTEXWebTest": {
+      "commandName": "Project",
+      "launchBrowser": true,
+      "launchUrl": "weatherforecast",
+      "applicationUrl": "https://localhost:5001;http://localhost:5000",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    }
+  }
+}

+ 59 - 0
HTEXWebTest/Startup.cs

@@ -0,0 +1,59 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.HttpsPolicy;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+
+namespace HTEXWebTest
+{
+    public class Startup
+    {
+        public Startup(IConfiguration configuration)
+        {
+            Configuration = configuration;
+        }
+
+        public IConfiguration Configuration { get; }
+
+        // This method gets called by the runtime. Use this method to add services to the container.
+        public void ConfigureServices(IServiceCollection services)
+        {
+            services.AddControllers();
+            services.AddAzureRedis("CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False");
+        }
+
+        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,AzureRedisFactory azureRedis)
+        {
+            if (env.IsDevelopment())
+            {
+                app.UseDeveloperExceptionPage();
+            }
+            
+            var  rs= azureRedis.GetRedisClient(8).HashValues($"Vote:Record:AAA");
+            Console.WriteLine(rs.ToString());
+            foreach (var r in rs) {
+                Console.WriteLine(r.ToString());
+            }
+            app.UseHttpsRedirection();
+
+            app.UseRouting();
+
+            app.UseAuthorization();
+
+            app.UseEndpoints(endpoints =>
+            {
+                endpoints.MapControllers();
+            });
+        }
+    }
+}

+ 15 - 0
HTEXWebTest/WeatherForecast.cs

@@ -0,0 +1,15 @@
+using System;
+
+namespace HTEXWebTest
+{
+    public class WeatherForecast
+    {
+        public DateTime Date { get; set; }
+
+        public int TemperatureC { get; set; }
+
+        public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+
+        public string Summary { get; set; }
+    }
+}

+ 9 - 0
HTEXWebTest/appsettings.Development.json

@@ -0,0 +1,9 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft": "Warning",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  }
+}

+ 10 - 0
HTEXWebTest/appsettings.json

@@ -0,0 +1,10 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft": "Warning",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  },
+  "AllowedHosts": "*"
+}

+ 12 - 0
TEAMModelHTEX.sln

@@ -15,6 +15,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HTEXKiller", "HTEXKiller\HT
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HTEXWeb", "HTEXWeb\HTEXWeb.csproj", "{6490E842-D915-47B7-B646-C9178470F572}"
 EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HTEXWebTest", "HTEXWebTest\HTEXWebTest.csproj", "{6AEE9FF4-6AB6-4DD2-A996-76DBB0D61451}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTEXInk", "HTEXInk\HTEXInk.csproj", "{08073D83-D799-4704-B008-7743E7D11815}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -45,6 +49,14 @@ Global
 		{6490E842-D915-47B7-B646-C9178470F572}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{6490E842-D915-47B7-B646-C9178470F572}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{6490E842-D915-47B7-B646-C9178470F572}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6AEE9FF4-6AB6-4DD2-A996-76DBB0D61451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6AEE9FF4-6AB6-4DD2-A996-76DBB0D61451}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6AEE9FF4-6AB6-4DD2-A996-76DBB0D61451}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6AEE9FF4-6AB6-4DD2-A996-76DBB0D61451}.Release|Any CPU.Build.0 = Release|Any CPU
+		{08073D83-D799-4704-B008-7743E7D11815}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{08073D83-D799-4704-B008-7743E7D11815}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{08073D83-D799-4704-B008-7743E7D11815}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{08073D83-D799-4704-B008-7743E7D11815}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE