CrazyIter vor 4 Jahren
Ursprung
Commit
2ee31b8a43

+ 0 - 18
HiTeachCC.Model/PowerPoint/Border.cs

@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public  class Border
-    {
-
-        public int Width { get; set; }
-        public string Color { get; set; }
-        public string Type { get; set; }
-        /// <summary>
-        /// 描边
-        /// </summary>
-        public string Stroke{ get; set; }
-    }
-}

+ 0 - 11
HiTeachCC.Model/PowerPoint/Chart.cs

@@ -1,11 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Chart : Item
-    {
-        
-    }
-}

+ 0 - 19
HiTeachCC.Model/PowerPoint/Connector.cs

@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-
-    public class Connector : Item
-    {
-        
-        /// <summary>
-        ///连接线 p:cxnSp
-        /// </summary>
-        public string CxnType { get; set; }
-        public string HeadEnd { get; set; }
-        public string TailEnd { get; set; }
-        public Border Border { get; set; }
-    }
-}

+ 0 - 10
HiTeachCC.Model/PowerPoint/Diagram.cs

@@ -1,10 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Diagram :Item
-    {
-    }
-}

+ 0 - 26
HiTeachCC.Model/PowerPoint/Fill.cs

@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Fill
-    {
-        /// <summary>
-        /// [a:noFill, solidFill, gradFill, blipFill, pattFill, grpFill]
-        ///0,无填充 1.纯色填充 2.渐变填充 3.图片或纹理填充 4.图案填充
-        /// </summary>
-        public int Type { get; set; }
-        public string Color { get; set; }
-        public string Image { get; set; }
-        public FillStyle FillStyle { get; set; }
-
-    }
-    public class FillStyle {
-        public int Left { get; set; } = 0;
-        public int Top { get; set; } = 0;
-        public int Right { get; set; } = 0;
-        public int Bottom { get; set; } = 0;
-    }
-
-}

+ 0 - 17
HiTeachCC.Model/PowerPoint/FontStyle.cs

@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public  class FontStyle
-    {
-        public string Color { get; set; }
-        public int Size { get; set; }
-        public string Type { get; set; }
-        public string Bold { get; set; }
-        public string Italic { get; set; }
-        public string Decoration { get; set; }
-        public string VertAlign { get; set; }
-    }
-}

+ 0 - 11
HiTeachCC.Model/PowerPoint/Group.cs

@@ -1,11 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public  class Group : Item
-    {
-        public List<Item> Shapes { get; set; }
-    }
-}

+ 0 - 19
HiTeachCC.Model/PowerPoint/Item.cs

@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public abstract class Item
-    {
-        public string Type { get; set; }
-        public Position Position { get; set; }
-        public string Xml { get; set; }
-        public int Index { get; set; }
-        //public Picture Picture { get; set; }
-        //public Shape Shape { get; set; }
-        //public Math Math { get; set; }
-        //public Table Table { get; set; }
-        //public Chart Chart { get; set; }
-    }
-}

+ 0 - 14
HiTeachCC.Model/PowerPoint/Math.cs

@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Math : Item
-    {
-    
-        public string Content { get; set; }
-        public Fill Fill { get; set; }
-        public Border Border { get; set; }
-    }
-}

+ 0 - 39
HiTeachCC.Model/PowerPoint/Paragraph.cs

@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Paragraph
-    {
-
-        public ParagraphStyle ParagraphStyle { get; set; }
-        public Paragraph() {
-            Texts = new List<Text>();
-        }
-        public BuChar BuChar { get; set; }
-        public List<Text> Texts { get; set; }
-    }
-    public class Text
-    {
-        public string Content { get; set; }
-        public string Href { get; set; }
-      
-        public FontStyle FontStyle { get; set; }
-    }
-
-    public class BuChar{
-        public int MarginLeft { get; set; }
-        public int MarginRiht { get; set; }
-        public string Buchar { get; set; }
-        public string Typeface { get; set; }
-        public int  FontSize { get; set; }
-    }
-
-    public class ParagraphStyle
-    {
-        public string VertAlign { get; set; }
-        // public string LeftMargin { get; set; }
-        public string HoriAlign { get; set; }
-    }
-}

+ 0 - 77
HiTeachCC.Model/PowerPoint/Path.cs

@@ -1,77 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public abstract class Path
-    {
-        public string Type { get; set; }
-    }
-    public   class ClosePath :Path
-    {
-        public bool Close { get; set; } = false;
-    }
-
-    /// <summary>
-    /// 起点 <a:moveTo>
-    /// </summary>
-    public class MoveToPath : Path
-    {
-        public MoveToPath()
-        {
-            Pts = new List<Point> { };
-        }
-        public List<Point> Pts { get; set; }
-    }
-    /// <summary>
-    /// 弧形 <a:arcTo>
-    /// </summary>
-    public class ArcToPath : Path
-    {
-        public string WidthRadius { get; set; }
-        public string HeightRadius { get; set; }
-        public string StartAngle { get; set; }
-        public string SwingAngle { get; set; }
-    }
-
-
-    /// <summary>
-    /// 画线 <a:lnTo>
-    /// </summary>
-    public class LineToPath : Path
-    {
-        public LineToPath()
-        {
-            Pts = new List<Point> { };
-        }
-        public List<Point> Pts { get; set; }
-    }
-    /// <summary>
-    /// 三次贝塞尔曲线<a:cubicBezTo>
-    /// </summary>
-    public class CubicBezPath : Path
-    {
-        public CubicBezPath()
-        {
-            Pts = new List<Point> { };
-        }
-        public List<Point> Pts { get; set; }
-    }/// <summary>
-     /// 二次贝塞尔曲线  <a:quadBezTo>
-     /// </summary>
-    public class QuadBezPath : Path
-    {
-        public QuadBezPath()
-        {
-            Pts = new List<Point> { };
-        }
-        public List<Point> Pts { get; set; }
-    }
-
-    public class Point
-    {
-        public double X { get; set; }
-        public double Y { get; set; }
-    }
-}

+ 0 - 15
HiTeachCC.Model/PowerPoint/Picture.cs

@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public   class Picture : Item
-    {
-        
-        //图片连接
-        public string Image { get; set; }
-        public Fill Fill { get; set; }
-        public Border Border { get; set; }
-    }
-}

+ 0 - 34
HiTeachCC.Model/PowerPoint/Position.cs

@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Position
-    {
-        //旋转角度
-        public Int64 Rot { get; set; } = 0;
-        //水平翻转
-        public int FlipH { get; set; } = 0;
-        //垂直翻转
-        public int FlipV { get; set; } = 0;
-        //x轴
-        public Int64 X { get; set; } = 0;
-        //y轴
-        public Int64 Y { get; set; } = 0;
-        //宽度
-        public Int64 Cx { get; set; } = 0;
-        //高度
-        public Int64 Cy { get; set; } = 0;
-        ////初始坐标x
-        //public Int64 ChX { get; set; } = 0;
-        ////初始坐标Y
-        //public Int64 ChY { get; set; } = 0;
-        ////拉伸宽度
-        //public Int64 ChCX { get; set; } = 0;
-        ////拉伸高度
-        //public Int64 ChCY { get; set; } = 0;
-        //层级
-      
-    }
-}

+ 0 - 22
HiTeachCC.Model/PowerPoint/Pptx.cs

@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Pptx
-    {   
-        //宽度
-        public double Width { get; set; }
-        //高度
-        public double Height { get; set; }
-        //缩略图
-        public string Thumbnail { get; set; }
-        //PPT幻灯片集合
-        public List<string> HiXmls { get; set; }
-        public string PptUrl { get; set; }
-        public string Sha1Code { get; set; }
-        //页数
-        public int PageSize { get; set; }
-    }
-}

+ 0 - 24
HiTeachCC.Model/PowerPoint/Shape.cs

@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-     public class Shape : Item
-    { 
-        public string ShapeType;
-        public List<Paragraph> Paragraph { get; set; }
-        public Fill Fill { get; set; }
-        public Border Border { get; set; }
-       
-        public List<ShapeGuide> ShapeGuides { get; set; }
-        public List<Path> Paths { get; set; }
-
-    }
-    public class ShapeGuide
-    {
-        public string Name { get; set; }
-        public string Fmla { get; set; }
-
-    }
-}

+ 0 - 22
HiTeachCC.Model/PowerPoint/Slide.cs

@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Slide
-    {
-        public Slide()
-        {
-            Item = new List<Item>();
-        }
-        public List<Item> Item { get; set; }
-        public Fill Fill { get; set; }
-      //  public string Xml { get; set; }
-        public int Index { get; set; }
-        //宽度
-        public double Width { get; set; }
-        //高度
-        public double Height { get; set; }
-    }
-}

+ 0 - 14
HiTeachCC.Model/PowerPoint/Style.cs

@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Style
-    {
-        public XmlDocument IdTable { get; set; }
-        public XmlDocument IdxTable { get; set; }
-        public XmlDocument TypeTable { get; set; }
-    }
-}

+ 0 - 24
HiTeachCC.Model/PowerPoint/Table.cs

@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace HiTeachCC.Model.PowerPoint
-{
-    public class Table :Item
-    {
-        public Border Border { get; set; }
-        public Fill Fill { get; set; }
-        public List<Tr> Tr { get; set; }
-    }
-
-    public class Tr {
-        public List<Td> Td { get; set; }
-
-    }
-    public class Td
-    {
-        public int Rowspan { get; set; }
-        public int Colspan { get; set; }
-        public Paragraph Paragraph { get; set; }
-    }
-}

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1759
HiTeachCC.Service/PowerPoint/Implement/PowerPointHelper.cs


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1246
HiTeachCC.Service/PowerPoint/Implement/PowerPointService.cs


+ 0 - 107
HiTeachCC.Service/PowerPoint/Implement/ShapeGenerator.cs

@@ -1,107 +0,0 @@
-using DocumentFormat.OpenXml.Drawing;
-using DocumentFormat.OpenXml.Packaging;
-using DocumentFormat.OpenXml.Presentation;
-using HiTeachCC.Model.PowerPoint;
-using HiTeachCC.Service.Core.Implement;
-using HiTeachCC.Service.Core.Interface;
-using HiTeachCC.Service.PowerPoint.Interface;
-using Microsoft.AspNetCore.Http;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml;
-using System.Xml.Linq;
-using System.Xml.XPath;
-using TEAMModelOS.SDK.Context.Constant;
-using TEAMModelOS.SDK.Context.Constant.Common;
-using TEAMModelOS.SDK.Context.Exception;
-using TEAMModelOS.SDK.Helper.Common.JsonHelper;
-using TEAMModelOS.SDK.Helper.Common.StringHelper;
-using TEAMModelOS.SDK.Helper.Security.ShaHash;
-using TEAMModelOS.SDK.Module.AzureBlob.Container;
-using TEAMModelOS.SDK.Module.AzureBlob.Interfaces;
-using ColorMap = DocumentFormat.OpenXml.Presentation.ColorMap;
-
-namespace HiTeachCC.Service.PowerPoint.Implement
-{
-    public class ShapeGenerator :BaseService, IShapeGenerator
-    {
-        bool isDone = false;
-        List<object> MsgQueue = new List<object>();
-
-        //   dynamic slideLayoutClrOvride;
-        XmlDocument themeContent;
-
-        int chartID = 0;
-        int _order = 1;
-        int titleFontSize = 42;
-        int bodyFontSize = 20;
-        int otherFontSize = 16;
-        bool isSlideMode = false;
-        Dictionary<string, object> styleTable = new Dictionary<string, object>();
-        const double inchpixel = 96.00, inchpt = 72.00, pxBase = 914400.00, ptBase = 12700;
-        const double rotBase = 60000.00;
-        private readonly IAzureBlobDBRepository azureBlobDBRepository;
-
-        public ShapeGenerator(IAzureBlobDBRepository _azureBlobDBRepository)
-        {
-            azureBlobDBRepository = _azureBlobDBRepository;
-        }
-
-        public async Task<Dictionary<string, object>> LoadPresentation(IFormFile file)
-        {
-            Dictionary<string, object> resdict = new Dictionary<string, object>();
-
-            if (FileType.GetExtention(file.FileName).ToLower().Equals("pptx"))
-            {
-                 ConvertPPTX(file, resdict);
-                return resdict;
-            }
-            else if (FileType.GetExtention(file.FileName).ToLower().Equals("pdf"))
-            {
-                // await ProcessPDF(file, resdict);
-                return resdict;
-            }
-            else
-            {
-                throw new BizException(500, "file type does not support!");
-            }
-        }
-
-        public  Dictionary<string, object> ConvertPPTX(IFormFile file, Dictionary<string, object> resdict) {
-            string shaCode = ShaHashHelper.GetSHA1(file.OpenReadStream());
-            using (PresentationDocument presentationDocument = PresentationDocument.Open(file.OpenReadStream(), false))
-            {
-                if (presentationDocument == null)
-                {
-                    throw new ArgumentNullException("presentationDocument");
-                }
-
-                XDocument xdoc = presentationDocument.ToFlatOpcDocument();
-                var rslt_ary = ProcessPPTX(xdoc);
-                return null;
-            }
-        }
-
-        /// <summary>
-        /// 加载PPTX文件
-        /// </summary>
-        /// <param name="presentationFile"></param>
-        /// <returns></returns>
-        public async Task<Dictionary<string, object>> ProcessPPTX(XDocument xdoc)
-        {
-            Dictionary<string, object> post_ary = new Dictionary<string, object>();
-            try {
-                var thumbnail = xdoc.GetTextByPath("//pkg:part[@pkg:name='/docProps/thumbnail.jpeg']");
-                if (thumbnail != null) { 
-                
-                }
-            } catch (Exception e ) {
-                throw new BizException(e.Message);
-            }
-            return null;
-        }
-    }
-}

+ 0 - 16
HiTeachCC.Service/PowerPoint/Interface/IPowerPointService.cs

@@ -1,16 +0,0 @@
-using HiTeachCC.Model.PowerPoint;
-using HiTeachCC.Service.Core.Interface;
-using Microsoft.AspNetCore.Http;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HiTeachCC.Service.PowerPoint.Interface
-{
-    public interface IPowerPointService : IBusinessService, IBaseService
-    {
-        Task<Dictionary<string, object>> LoadPresentation(IFormFile file); 
-    }
-}

+ 0 - 14
HiTeachCC.Service/PowerPoint/Interface/IShapeGenerator.cs

@@ -1,14 +0,0 @@
-using HiTeachCC.Service.Core.Interface;
-using Microsoft.AspNetCore.Http;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HiTeachCC.Service.PowerPoint.Interface
-{
-    public interface IShapeGenerator : IBusinessService, IBaseService
-    {
-        Task<Dictionary<string, object>> LoadPresentation(IFormFile file);
-    }
-}