123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191 |
- using DocumentFormat.OpenXml.Drawing;
- using DocumentFormat.OpenXml.Packaging;
- using HTEXLib.Helpers.ColorHelpers;
- using HTEXLib.Helpers.ShapeHelpers;
- using HTEXLib.Models.Inner;
- using OpenXmlPowerTools;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Globalization;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Xml;
- using System.Xml.Linq;
- using System.Xml.XPath;
- namespace HTEXLib.DOCX.OpenXmlTool
- {
- public static class WORDHelper
- {
- public static XmlNamespaceManager xmlnsManager;
- public static IEnumerable<XElement> GetWordNodeListByPath(this XElement xElement, string expression)
- {
- return xElement.XPathSelectElements(expression, xmlnsManager);
- }
- public static XElement GetWordNodeByPath(this XElement xElement, string expression)
- {
- return xElement.XPathSelectElement(expression, xmlnsManager);
- }
-
- static WORDHelper()
- {
- xmlnsManager = new XmlNamespaceManager(new NameTable());
- xmlnsManager.AddNamespace("activex", "http://schemas.microsoft.com/office/2006/activeX");
- xmlnsManager.AddNamespace("biblio", "http://schemas.microsoft.com/office/word/2004/10/bibliography");
- xmlnsManager.AddNamespace("ink", "http://schemas.microsoft.com/ink/2010/main");
- xmlnsManager.AddNamespace("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
- xmlnsManager.AddNamespace("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
- xmlnsManager.AddNamespace("a14", "http://schemas.microsoft.com/office/drawing/2010/main");
- xmlnsManager.AddNamespace("c", "http://schemas.openxmlformats.org/drawingml/2006/chart");
- xmlnsManager.AddNamespace("cdr", "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing");
- xmlnsManager.AddNamespace("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
- xmlnsManager.AddNamespace("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
- xmlnsManager.AddNamespace("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
- xmlnsManager.AddNamespace("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
- xmlnsManager.AddNamespace("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
- xmlnsManager.AddNamespace("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
- xmlnsManager.AddNamespace("cx", "http://schemas.microsoft.com/office/drawing/2014/chartex");
- xmlnsManager.AddNamespace("cx1", "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex");
- xmlnsManager.AddNamespace("cx2", "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex");
- xmlnsManager.AddNamespace("cx3", "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex");
- xmlnsManager.AddNamespace("cx4", "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex");
- xmlnsManager.AddNamespace("cx5", "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex");
- xmlnsManager.AddNamespace("cx6", "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex");
- xmlnsManager.AddNamespace("cx7", "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex");
- xmlnsManager.AddNamespace("cx8", "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex");
- xmlnsManager.AddNamespace("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
- xmlnsManager.AddNamespace("aink", "http://schemas.microsoft.com/office/drawing/2016/ink");
- xmlnsManager.AddNamespace("am3d", "http://schemas.microsoft.com/office/drawing/2017/model3d");
- xmlnsManager.AddNamespace("o", "urn:schemas-microsoft-com:office:office");
- xmlnsManager.AddNamespace("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
- xmlnsManager.AddNamespace("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
- xmlnsManager.AddNamespace("v", "urn:schemas-microsoft-com:vml");
- xmlnsManager.AddNamespace("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
- xmlnsManager.AddNamespace("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
- xmlnsManager.AddNamespace("w10", "urn:schemas-microsoft-com:office:word");
- xmlnsManager.AddNamespace("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
- xmlnsManager.AddNamespace("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
- xmlnsManager.AddNamespace("w15", "http://schemas.microsoft.com/office/word/2012/wordml");
- xmlnsManager.AddNamespace("w16cex", "http://schemas.microsoft.com/office/word/2018/wordml/cex");
- xmlnsManager.AddNamespace("w16cid", "http://schemas.microsoft.com/office/word/2016/wordml/cid");
- xmlnsManager.AddNamespace("w16", "http://schemas.microsoft.com/office/word/2018/wordml");
- xmlnsManager.AddNamespace("w16se", "http://schemas.microsoft.com/office/word/2015/wordml/symex");
- xmlnsManager.AddNamespace("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
- xmlnsManager.AddNamespace("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
- xmlnsManager.AddNamespace("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
- xmlnsManager.AddNamespace("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
- xmlnsManager.AddNamespace("pt14", "http://powertools.codeplex.com/2011");
- }
- /// <summary>
- /// 处理 LineReference 轮廓 a:lnRef
- /// 处理 FillReference 填充 a:fillRef
- /// 处理 EffectReference 效果 a:effectRef
- /// 处理 FontReference 字体 a:fontRef
- /// </summary>
- /// <param name="shapeStyle"></param>
- public static SlideColor DoShapeStyle(DocumentFormat.OpenXml.Office2010.Word.DrawingShape.ShapeStyle shapeStyle, WordprocessingDocument wordDoc)
- {
- if (shapeStyle == null)
- {
- return null;
- }
- string LineColor = DoMatrixReferenceColors(shapeStyle.LineReference, wordDoc);
- string FillColor = DoMatrixReferenceColors(shapeStyle.FillReference, wordDoc);
- string EffectColor = DoMatrixReferenceColors(shapeStyle.EffectReference, wordDoc);
- string FontColor = FontReferenceColors(shapeStyle.FontReference, wordDoc);
- return new SlideColor { LineColor = LineColor, FillColor = FillColor, EffectColor = EffectColor, FontColor = FontColor };
- }
- public static string DoMatrixReferenceColors(StyleMatrixReferenceType Color, WordprocessingDocument slide)
- {
- string FontColor = "";
- if (Color == null)
- {
- return FontColor;
- }
- if (Color.RgbColorModelHex != null)
- {
- FontColor = ReadColor(Color.RgbColorModelHex);
- }
- else if (Color.RgbColorModelPercentage != null)
- {
- FontColor = ReadColor(Color.RgbColorModelPercentage);
- }
- else if (Color.SystemColor != null)
- {
- FontColor = ReadColor(Color.SystemColor);
- }
- if (Color.SchemeColor != null)
- {
- FontColor = ReadColor(Color.SchemeColor, slide);
- }
- if (Color.HslColor != null)
- {
- FontColor = ReadColor(Color.HslColor);
- }
- if (Color.PresetColor != null)
- {
- FontColor = ReadColor(Color.PresetColor);
- }
- return FontColor;
- }
- public static string FontReferenceColors(FontReference Color, WordprocessingDocument slide)
- {
- string FontColor = "";
- if (Color.RgbColorModelHex != null)
- {
- FontColor = ReadColor(Color.RgbColorModelHex);
- }
- else if (Color.RgbColorModelPercentage != null)
- {
- FontColor = ReadColor(Color.RgbColorModelPercentage);
- }
- else if (Color.SystemColor != null)
- {
- FontColor = ReadColor(Color.SystemColor);
- }
- if (Color.SchemeColor != null)
- {
- FontColor = ReadColor(Color.SchemeColor, slide);
- }
- if (Color.HslColor != null)
- {
- FontColor = ReadColor(Color.HslColor);
- }
- if (Color.PresetColor != null)
- {
- FontColor = ReadColor(Color.PresetColor);
- }
- return FontColor;
- }
- public static HTEXLib.Models.HTEX.ShapeStyle DoShapeProperties(WordprocessingDocument wordDoc, DocumentFormat.OpenXml.Drawing.Charts.ShapeProperties shapeProperties, XElement element, Func<ImageInfo, XElement> ImageHandler, Position position)
- {
- if (shapeProperties == null)
- {
- return null;
- }
- //Outline
- var lnNode = shapeProperties.GetFirstChild<Outline>();
- Border border = null;
- if (lnNode != null)
- {
- border = DoOutline(lnNode, wordDoc);
- }
- Fill fill = new Fill() { type = -1 };
- var gradFill = shapeProperties.GetFirstChild<GradientFill>();
- if (gradFill != null)
- {
- fill.type = 2;
- fill.gradientFill = DoGradientFill(gradFill, wordDoc);
- }
- var noFill = shapeProperties.GetFirstChild<NoFill>();
- if (noFill != null)
- {
- fill.type = 0;
- }
- var pattFill = shapeProperties.GetFirstChild<PatternFill>();
- if (pattFill != null)
- {
- HtexPattFill htexPattFill = DoPattFill(pattFill, wordDoc);
- fill.type = 4;
- fill.pattFill = htexPattFill;
- }
- var solidFill = shapeProperties.GetFirstChild<SolidFill>();
- if (solidFill != null)
- {
- fill.type = 1;
- fill.solidFill = DoSolidFill(solidFill);
- }
- var groupFill = shapeProperties.GetFirstChild<GroupFill>();
- if (groupFill != null)
- {
- fill.type = 5;
- // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
- }
- var blipFill = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
- if (blipFill != null)
- {
- fill.type = 3;
- fill.blipFill = DoBlipFill(wordDoc, blipFill, ImageHandler, element, position);
- // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
- }
- var EffectList = shapeProperties.GetFirstChild<EffectList>();
- // var effect = doEffect(EffectList,partForm);
- var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
- var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
- var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
- var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
- return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border/*, effect = effect */};
- }
- public static HTEXLib.Models.HTEX.ShapeStyle DoShapeProperties(WordprocessingDocument wordDoc, DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties shapeProperties, XElement element, Func<ImageInfo, XElement> ImageHandler, Position position)
- {
- if (shapeProperties == null)
- {
- return null;
- }
- //Outline
- var lnNode = shapeProperties.GetFirstChild<Outline>();
- Border border = null;
- if (lnNode != null)
- {
- border = DoOutline(lnNode, wordDoc);
- }
- Fill fill = new Fill() { type = -1 };
- var gradFill = shapeProperties.GetFirstChild<GradientFill>();
- if (gradFill != null)
- {
- fill.type = 2;
- fill.gradientFill = DoGradientFill(gradFill, wordDoc);
- }
- var noFill = shapeProperties.GetFirstChild<NoFill>();
- if (noFill != null)
- {
- fill.type = 0;
- }
- var pattFill = shapeProperties.GetFirstChild<PatternFill>();
- if (pattFill != null)
- {
- HtexPattFill htexPattFill = DoPattFill(pattFill, wordDoc);
- fill.type = 4;
- fill.pattFill = htexPattFill;
- }
- var solidFill = shapeProperties.GetFirstChild<SolidFill>();
- if (solidFill != null)
- {
- fill.type = 1;
- fill.solidFill = DoSolidFill(solidFill);
- }
- var groupFill = shapeProperties.GetFirstChild<GroupFill>();
- if (groupFill != null)
- {
- fill.type = 5;
- // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
- }
- var blipFill = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
- if (blipFill != null)
- {
- fill.type = 3;
- fill.blipFill = DoBlipFill(wordDoc, blipFill, ImageHandler, element, position);
- // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
- }
- var EffectList = shapeProperties.GetFirstChild<EffectList>();
- // var effect = doEffect(EffectList,partForm);
- var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
- var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
- var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
- var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
- return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border/*, effect = effect */};
- }
- public static HTEXLib.Models.HTEX.ShapeStyle DoShapeProperties(WordprocessingDocument wordDoc, DocumentFormat.OpenXml.Office2010.Word.DrawingShape.ShapeProperties shapeProperties, XElement element, Func<ImageInfo, XElement> ImageHandler, Position position)
- {
- if (shapeProperties == null)
- {
- return null;
- }
- //Outline
- var lnNode = shapeProperties.GetFirstChild<Outline>();
- Border border = null;
- if (lnNode != null)
- {
- border = DoOutline(lnNode,wordDoc);
- }
- Fill fill = new Fill() { type = -1 };
- var gradFill = shapeProperties.GetFirstChild<GradientFill>();
- if (gradFill != null)
- {
- fill.type = 2;
- fill.gradientFill = DoGradientFill(gradFill,wordDoc);
- }
- var noFill = shapeProperties.GetFirstChild<NoFill>();
- if (noFill != null)
- {
- fill.type = 0;
- }
- var pattFill = shapeProperties.GetFirstChild<PatternFill>();
- if (pattFill != null)
- {
- HtexPattFill htexPattFill = DoPattFill(pattFill,wordDoc);
- fill.type = 4;
- fill.pattFill = htexPattFill;
- }
- var solidFill = shapeProperties.GetFirstChild<SolidFill>();
- if (solidFill != null)
- {
- fill.type = 1;
- fill.solidFill = DoSolidFill(solidFill);
- }
- var groupFill = shapeProperties.GetFirstChild<GroupFill>();
- if (groupFill != null)
- {
- fill.type = 5;
- // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
- }
- var blipFill = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
- if (blipFill != null)
- {
- fill.type = 3;
- fill.blipFill = DoBlipFill(wordDoc,blipFill, ImageHandler, element, position);
- // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
- }
- var EffectList = shapeProperties.GetFirstChild<EffectList>();
- // var effect = doEffect(EffectList,partForm);
- var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
- var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
- var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
- var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
- return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border/*, effect = effect */};
- }
- public static string DoSolidFill(SolidFill Color)
- {
- string FontColor = "#000000";
- if (Color.RgbColorModelHex != null)
- {
- FontColor = ReadColor(Color.RgbColorModelHex);
- }
- else if (Color.RgbColorModelPercentage != null)
- {
- FontColor = ReadColor(Color.RgbColorModelPercentage);
- }
- else if (Color.SystemColor != null)
- {
- FontColor = ReadColor(Color.SystemColor);
- }
-
- if (Color.HslColor != null)
- {
- FontColor = ReadColor(Color.HslColor);
- }
- if (Color.PresetColor != null)
- {
- FontColor = ReadColor(Color.PresetColor);
- }
- return FontColor;
- }
- public static HtexPattFill DoPattFill(DocumentFormat.OpenXml.Drawing.PatternFill patternFill, WordprocessingDocument wordDoc)
- {
- HtexPattFill htexPattFill = new HtexPattFill();
- Color FgClr = Color.Empty;
- Color BgClr = Color.Empty;
- if (patternFill.ForegroundColor != null)
- {
- var fgClr = ColorTypeColors(patternFill.ForegroundColor,wordDoc);
- htexPattFill.fgClr = fgClr;
- FgClr = ColorTranslator.FromHtml(fgClr);
- }
- if (patternFill.BackgroundColor != null)
- {
- var bgClr = ColorTypeColors(patternFill.BackgroundColor,wordDoc);
- htexPattFill.bgClr = bgClr;
- BgClr = ColorTranslator.FromHtml(bgClr);
- }
- htexPattFill.prst = patternFill.Preset.ToString();
- MemoryStream ms = new MemoryStream();
- System.Drawing.Bitmap bm = PatternFillHelper.GetVmlPatternFill(patternFill.Preset, FgClr, BgClr);
- Graphics graphics = Graphics.FromImage(bm);
- graphics.Save();
- graphics.Dispose();
- bm.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
- byte[] arr = new byte[ms.Length];
- ms.Position = 0;
- ms.Read(arr, 0, (int)ms.Length);
- ms.Close();
- bm.Dispose();
- string sImageData = "data:image/png;base64," + Convert.ToBase64String(arr);
- htexPattFill.base64 = sImageData;
- return htexPattFill;
- }
- public static HtexBlipFill DoBlipFill(WordprocessingDocument wordDoc, DocumentFormat.OpenXml.Drawing.BlipFill blipFill, Func<ImageInfo, XElement> imageHandler, XElement element, Position position)
- {
- HtexBlipFill htexBlipFill = new HtexBlipFill();
- SourceRectangle source = blipFill.SourceRectangle; ///源矩形 srcRect可能无用
- htexBlipFill.dip = blipFill.Dpi;
- if (blipFill.RotateWithShape != null)
- {
- htexBlipFill.rotWithShape = blipFill.RotateWithShape;
- }
- { htexBlipFill.rotWithShape = true; }
- var fillRect = blipFill.GetPPTXNodeByPath("a:stretch/a:fillRect");///拉伸
- if (fillRect != null)
- {
- htexBlipFill.fillRect = new Vector
- {
- t = fillRect.Attribute("t") != null ? int.Parse(fillRect.Attribute("t").Value) / 1000 : 0,
- l = fillRect.Attribute("l") != null ? int.Parse(fillRect.Attribute("l").Value) / 1000 : 0,
- r = fillRect.Attribute("r") != null ? int.Parse(fillRect.Attribute("r").Value) / 1000 : 0,
- b = fillRect.Attribute("b") != null ? int.Parse(fillRect.Attribute("b").Value) / 1000 : 0
- };
- }
- 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;
- }
- }
- Tile tile = blipFill.GetFirstChild<Tile>();
- if (tile != null)
- {
- ///algn (Alignment) flip (Tile Flipping) sx (Horizontal Ratio) sy (Vertical Ratio) tx (Horizontal Offset) ty (Vertical Offset)
- htexBlipFill.tile = new HtexTile { algn = tile.Alignment, flip = tile.Flip, sx = tile.HorizontalRatio, sy = tile.VerticalRatio, tx = tile.HorizontalOffset, ty = tile.VerticalOffset };
- }
- var Embed = blipFill.Blip.Embed;
- var Link = blipFill.Blip.Link;
- //slide.SlideLayoutPart
- IdPartPair part = null;
- if (blipFill == null) return null;
- // var imageRid = (string)blipFill.Elements(A.blip).Attributes(R.embed).FirstOrDefault();
- //if (imageRid == null) return null;
- var pp3 = wordDoc.MainDocumentPart.Parts.FirstOrDefault(pp => pp.RelationshipId == Embed);
- if (pp3 == null) return null;
- var imagePart = (ImagePart)pp3.OpenXmlPart;
- if (imagePart == null) return null;
- // If the image markup points to a NULL image, then following will throw an ArgumentOutOfRangeException
- try
- {
- imagePart = (ImagePart)wordDoc.MainDocumentPart.GetPartById(Embed);
- }
- catch (ArgumentOutOfRangeException)
- {
- return null;
- }
- var contentType = imagePart.ContentType;
- if (!WmlToHtmlConverter. ImageContentTypes.Contains(contentType))
- return null;
- using (var partStream = imagePart.GetStream()) {
- using (var bitmap = new Bitmap(partStream))
- {
- var imageInfo = new ImageInfo()
- {
- Bitmap = bitmap,
- ImgStyleAttribute = new XAttribute("style",
- string.Format(NumberFormatInfo.InvariantInfo,
- "width: {0}px; height: {1}in",
- position.cx,
- position.cy)),
- ContentType = contentType,
- // DrawingElement = element,
- //AltText = altText,
- };
- var imgElement2 = imageHandler(imageInfo);
- //imgElement2 = new XElement(XhtmlNoNamespace.a,
- // //new XAttribute(XhtmlNoNamespace.href, hyperlinkUri),
- // imgElement2);
- //return imgElement2;
- //var imageInfo2 = new ImageInfo()
- //{
- // Bitmap = bitmap,
- // ContentType = contentType,
- // //DrawingElement = element,
- // //AltText = altText,
- //};
- //var imgElement = imageHandler(imageInfo2);
- //imgElement= new XElement(XhtmlNoNamespace.a,
- // // new XAttribute(XhtmlNoNamespace.href, hyperlinkUri),
- // imgElement);
- htexBlipFill.url = imgElement2.ToString();
- // return imgElement;
- }
- }
- return htexBlipFill;
- //if (partForm == "slide")
- //{
- // part = slide.SlidePart.Parts.Where(x => x.RelationshipId == Embed).FirstOrDefault();
- //}
- //if (partForm == "layout")
- //{
- // part = slide.SlideLayoutPart.Parts.Where(x => x.RelationshipId == Embed).FirstOrDefault();
- //}
- //if (partForm == "master")
- //{
- // part = slide.slideMasterPart.Parts.Where(x => x.RelationshipId == Embed).FirstOrDefault();
- //}
- //if (partForm == "chartPart")
- //{
- // part = slide.chartPart.Parts.Where(x => x.RelationshipId == Embed).FirstOrDefault();
- //}
- //if (partForm == "drawing")
- //{
- // part = slide.diagramDataPart.Parts.Where(x => x.RelationshipId == Embed).FirstOrDefault();
- //}
- //if (part != null)
- //{
- // var url = part.OpenXmlPart.Uri.ToString().Replace("../", "/ppt/");
- // var name = url.Replace("/", "");
- // var thumbnail = slide.Media.Where(x => x.Attributes().Select(y => y.Value == url).FirstOrDefault()).FirstOrDefault();
- // if (thumbnail != null)
- // {
- // var contentType = thumbnail.Attribute("{http://schemas.microsoft.com/office/2006/xmlPackage}contentType").Value;
- // //var data = thumbnail.Value;
- // //url = "data:" + contentType + ";base64," + data;
- // //url = url.Replace("\r\n", "");
- // htexBlipFill.url = name;
- // // htexBlipFill.urlType = "base64";
- // // htexBlipFill.contentType = contentType;
- // }
- //}
- //TODO 图片元素的更多信息需要后期继续实现,如滤镜,裁剪,图片颜色,图片校正等
- return htexBlipFill;
- }
- /// <summary>
- /// 渐变颜色
- /// GradientStopList (渐变停止列表)(默认)
- /// LinearGradientFill(线性渐变填充)
- /// PathGradientFill (路径渐变)根据具体形状描边式
- /// TileRectangle (平铺矩形) 右下角是一个举行
- /// </summary>
- /// <param name="GradientFill"></param>
- /// <returns></returns>
- public static HtexGradientFill DoGradientFill(DocumentFormat.OpenXml.Drawing.GradientFill GradientFill, WordprocessingDocument wordDoc)
- {
- HtexGradientFill gradientFill = new HtexGradientFill();
- ///右下角弧形模式
- string type = "";
- ///平铺翻转模式
- ///Horizontal 水平
- ///HorizontalAndVertical 水平和垂直。
- ///Vertical 垂直
- ///None 无
- string name = "None";
- if (GradientFill.Flip != null)
- {
- name = GradientFill.Flip.Value.ToString();
- }
- gradientFill.flip = name;
- List<ColorPosition> colors = new List<ColorPosition>();
- bool RotateWithShape = true;
- if (GradientFill.RotateWithShape != null)
- {
- RotateWithShape = GradientFill.RotateWithShape;
- }
- gradientFill.RotateWithShape = RotateWithShape;
- foreach (GradientStop gradientStop in GradientFill.GradientStopList)
- {
- colors.Add(new ColorPosition
- {
- color = ColorTypeColors(gradientStop,wordDoc),
- position = gradientStop.Position * 1.0 / 1000 /// 位置,色带的位置 百分比0-100
- });
- }
- gradientFill.colors = colors;
- var lin = GradientFill.GetPPTXNodeByPath("//a:lin");
- double? rot = null;
- string scaled = "";
- //线性模式
- if (lin != null)
- {
- rot = 90;
- type = "line";
- var ang = lin.Attribute("ang");
- var scaledNode = lin.Attribute("scaled");
- if (ang != null)
- {
- rot = ShapeHelper.AngleToDegrees(ang.Value);
- }
- if (scaledNode != null)
- {
- scaled = scaledNode.Value;
- }
- gradientFill.line = new LineFill { rot = rot, scaled = scaled };
- }
- var path = GradientFill.GetPPTXNodeByPath("//a:path");
- if (path != null)
- {
- type = "path";
- ///circle
- ///rect
- ///shape
- var pathType = path.Attribute("path").Value;
- var fillToRect = path.GetPPTXNodeByPath("//a:fillToRect");
- if (fillToRect != null)
- {
- Vector vector = new Vector();
- var bnode = fillToRect.Attribute("b");
- var lnode = fillToRect.Attribute("l");
- var rnode = fillToRect.Attribute("r");
- var tnode = fillToRect.Attribute("t");
- if (bnode != null)
- {
- vector.b = int.Parse(bnode.Value) / 1000;
- }
- if (lnode != null)
- {
- vector.l = int.Parse(lnode.Value) / 1000;
- }
- if (rnode != null)
- {
- vector.r = int.Parse(rnode.Value) / 1000;
- }
- if (tnode != null)
- {
- vector.t = int.Parse(tnode.Value) / 1000;
- }
- gradientFill.path = new PathFill { fillToRect = vector, pathType = pathType };
- }
- }
- var tileRect = GradientFill.GetPPTXNodeByPath("//a:tileRect");
- if (tileRect != null)
- {
- ///四个方向的偏移量,矩形的下边缘。例如50000/1000= 50% ,辐射百分比
- Vector vector = new Vector();
- var bnode = tileRect.Attribute("b");
- var lnode = tileRect.Attribute("l");
- var rnode = tileRect.Attribute("r");
- var tnode = tileRect.Attribute("t");
- if (bnode != null)
- {
- vector.b = int.Parse(bnode.Value) / 1000;
- }
- if (lnode != null)
- {
- vector.l = int.Parse(lnode.Value) / 1000;
- }
- if (rnode != null)
- {
- vector.r = int.Parse(rnode.Value) / 1000;
- }
- if (tnode != null)
- {
- vector.t = int.Parse(tnode.Value) / 1000;
- }
- gradientFill.tileRect = vector;
- }
- gradientFill.type = type;
- return gradientFill;
- }
- public static string ColorTypeColors(GradientStop Color, WordprocessingDocument wordDoc)
- {
- string FontColor = "#000000";
- if (Color.RgbColorModelHex != null)
- {
- FontColor = ReadColor(Color.RgbColorModelHex);
- }
- else if (Color.RgbColorModelPercentage != null)
- {
- FontColor = ReadColor(Color.RgbColorModelPercentage);
- }
- else if (Color.SystemColor != null)
- {
- FontColor = ReadColor(Color.SystemColor);
- }
- if (Color.SchemeColor != null)
- {
- FontColor = ReadColor(Color.SchemeColor, wordDoc);
- }
- if (Color.HslColor != null)
- {
- FontColor = ReadColor(Color.HslColor);
- }
- if (Color.PresetColor != null)
- {
- FontColor = ReadColor(Color.PresetColor);
- }
- return FontColor;
- }
- public static string ColorTypeColors(ColorType Color, WordprocessingDocument wordDoc)
- {
- string FontColor = "#000000";
- if (Color.RgbColorModelHex != null)
- {
- FontColor = ReadColor(Color.RgbColorModelHex);
- }
- else if (Color.RgbColorModelPercentage != null)
- {
- FontColor = ReadColor(Color.RgbColorModelPercentage);
- }
- else if (Color.SystemColor != null)
- {
- FontColor = ReadColor(Color.SystemColor);
- }
- if (Color.SchemeColor != null)
- {
- FontColor = ReadColor(Color.SchemeColor, wordDoc);
- }
- if (Color.HslColor != null)
- {
- FontColor = ReadColor(Color.HslColor);
- }
- if (Color.PresetColor != null)
- {
- FontColor = ReadColor(Color.PresetColor);
- }
- return FontColor;
- }
- public static string ReadColor(DocumentFormat.OpenXml.Drawing.RgbColorModelHex RgbColorModelHex)
- {
- string FontColor = "#000000";
- FontColor = "#" + RgbColorModelHex.Val;
- FontColor = "#" + ShapeHelper.ColorToning(RgbColorModelHex.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
- return FontColor;
- }
- public static string ReadColor(DocumentFormat.OpenXml.Drawing.RgbColorModelPercentage RgbColorModelPercentage)
- {
- string FontColor = "#000000";
- int red = RgbColorModelPercentage.RedPortion.Value;
- int green = RgbColorModelPercentage.GreenPortion.Value;
- int blue = RgbColorModelPercentage.BluePortion.Value;
- var colorFromRGB = System.Drawing.Color.FromArgb(red, green, blue);
- string fontcolor = System.Drawing.ColorTranslator.ToHtml(colorFromRGB);
- FontColor = fontcolor;
- FontColor = "#" + ShapeHelper.ColorToning(RgbColorModelPercentage.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
- return FontColor;
- }
- public static string ReadColor(DocumentFormat.OpenXml.Drawing.SystemColor SystemColor)
- {
- string FontColor = "#000000";
- FontColor = "#" + SystemColor.LastColor.Value;
- FontColor = "#" + ShapeHelper.ColorToning(SystemColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
- return FontColor;
- }
- public static string ReadColor(DocumentFormat.OpenXml.Drawing.SchemeColor SchemeColor, WordprocessingDocument wordDoc)
- {
- string FontColor = "";
- FontColor = DoSchemeColor(SchemeColor,wordDoc);
- FontColor = "#" + ShapeHelper.ColorToning(SchemeColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
- return FontColor;
- }
- public static string ReadColor(DocumentFormat.OpenXml.Drawing.HslColor HslColor)
- {
- string FontColor = "#000000";
- var hue = HslColor.HueValue / 100000;
- var sat = HslColor.SatValue / 100;
- var lum = HslColor.LumValue / 100;
- var hsl2rgb = ShapeHelper.HslToRgb(hue, sat, lum);
- FontColor = "#" + ShapeHelper.ToHex(hsl2rgb.r) + ShapeHelper.ToHex(hsl2rgb.g) + ShapeHelper.ToHex(hsl2rgb.b);
- FontColor = "#" + ShapeHelper.ColorToning(HslColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
- return FontColor;
- }
- public static string ReadColor(PresetColor PresetColor)
- {
- string FontColor = "#000000";
- //https://m.fontke.com/tool/rgb/0000ff/
- //判断是否是拿到名字 还是值
- FontColor = ShapeHelper.GetColorName2Hex(PresetColor.Val);
- FontColor = "#" + ShapeHelper.ColorToning(PresetColor.OuterXml, FontColor.Replace("#", "")).Replace("#", "");
- //TODO
- return FontColor;
- }
- public static string DoSchemeColor(SchemeColor schemeColor, WordprocessingDocument wordDoc )
- {
- //var light1Color1= slide.SlideLayoutPart.SlideMasterPart.
- // ThemePart;
- string FontColor = "";
- if (schemeColor.Val == "bg1")
- {
- Light1Color light1Color = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Light1Color;
- if (light1Color.RgbColorModelHex != null)
- {
- FontColor = "#" + light1Color.RgbColorModelHex.Val.Value;
- }
- else if (light1Color.SystemColor != null)
- {
- FontColor = "#" + light1Color.SystemColor.LastColor.Value;
- }
- }
- else if (schemeColor.Val == "bg2")
- {
- Light2Color light2Color = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Light2Color;
- if (light2Color.RgbColorModelHex != null)
- {
- FontColor = "#" + light2Color.RgbColorModelHex.Val.Value;
- }
- else if (light2Color.SystemColor != null)
- {
- FontColor = "#" + light2Color.SystemColor.LastColor.Value;
- }
- }
- else if (schemeColor.Val == "tx1")
- {
- Dark1Color dark1Color = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Dark1Color;
- if (dark1Color.RgbColorModelHex != null)
- {
- FontColor = "#" + dark1Color.RgbColorModelHex.Val.Value;
- }
- else if (dark1Color.SystemColor != null)
- {
- FontColor = "#" + dark1Color.SystemColor.LastColor.Value;
- }
- }
- else if (schemeColor.Val == "tx2")
- {
- Dark2Color dark2Color = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Dark2Color;
- if (dark2Color.RgbColorModelHex != null)
- {
- FontColor = "#" + dark2Color.RgbColorModelHex.Val.Value;
- }
- else if (dark2Color.SystemColor != null)
- {
- FontColor = "#" + dark2Color.SystemColor.LastColor.Value;
- }
- }
- else if (schemeColor.Val == "hlink")
- {
- Hyperlink HyperLink = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Hyperlink;
- if (HyperLink.RgbColorModelHex != null)
- {
- FontColor = "#" + HyperLink.RgbColorModelHex.Val.Value;
- }
- }
- else if (schemeColor.Val == "folHlink")
- {
- FollowedHyperlinkColor folHyperLink = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.FollowedHyperlinkColor;
- if (folHyperLink.RgbColorModelHex != null)
- {
- FontColor = "#" + folHyperLink.RgbColorModelHex.Val.Value;
- }
- }
- if (string.IsNullOrEmpty(FontColor))
- {
- FontColor = ReadAccentSchemeColors(schemeColor, wordDoc);
- }
- if (FontColor.Replace("#", "") == "")
- {
- var chren = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.ChildElements;
- foreach (var cl in chren)
- {
- if (schemeColor.Val == cl.LocalName)
- {
- if (schemeColor.Val == "dk1" || schemeColor.Val == "lt1")
- {
- if (cl.GetFirstChild<SystemColor>() != null)
- {
- FontColor = "#" + cl.GetFirstChild<SystemColor>().LastColor;
- }
- else
- {
- FontColor = "#" + cl.GetFirstChild<RgbColorModelHex>().Val.Value; ;
- }
- }
- else
- {
- FontColor = "#" + cl.GetFirstChild<RgbColorModelHex>().Val.Value; ;
- }
- }
- }
- }
- return FontColor;
- }
- public static string ReadAccentSchemeColors(SchemeColor schemeColor, WordprocessingDocument wordDoc)
- {
- string FontColor = "";
- for (int i = 1; i <= 6; i++)
- {
- if (schemeColor.Val == "accent" + i)
- {
- switch (i)
- {
- case 1:
- {
- Accent1Color c = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Accent1Color;
- if (c.RgbColorModelHex != null)
- FontColor = "#" + c.RgbColorModelHex.Val.Value;
- }
- break;
- case 2:
- {
- Accent2Color c = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Accent2Color;
- if (c.RgbColorModelHex != null)
- FontColor = "#" + c.RgbColorModelHex.Val.Value;
- }
- break;
- case 3:
- {
- Accent3Color c = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Accent3Color;
- if (c.RgbColorModelHex != null)
- FontColor = "#" + c.RgbColorModelHex.Val.Value;
- }
- break;
- case 4:
- {
- Accent4Color c = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Accent4Color;
- if (c.RgbColorModelHex != null)
- FontColor = "#" + c.RgbColorModelHex.Val.Value;
- }
- break;
- case 5:
- {
- Accent5Color c = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Accent5Color;
- if (c.RgbColorModelHex != null)
- FontColor = "#" + c.RgbColorModelHex.Val.Value;
- }
- break;
- case 6:
- {
- Accent6Color c = wordDoc.MainDocumentPart.ThemePart.Theme.ThemeElements.ColorScheme.Accent6Color;
- if (c.RgbColorModelHex != null)
- FontColor = "#" + c.RgbColorModelHex.Val.Value;
- }
- break;
- default: { } break;
- }
- }
- }
- return FontColor;
- }
- /// <summary>
- /// a:ln 图形的外边
- /// </summary>
- /// <param name="shapeProperties"></param>
- /// <param name="slide"></param>
- public static Border DoOutline(DocumentFormat.OpenXml.Drawing.LinePropertiesType outline, WordprocessingDocument wordDoc)
- {
- Border border = new Border() { color = new Fill { type = -1 }, type = "none" };
- //20.1.10.35 EMUs. 1 pt = 12700 EMUs.
- double? Width = null;
- if (outline == null )
- {
- return new Border { outline = new HtexOutline { width = 0.75 }, type = "solid", stroke = "0" };
- }
- if (outline.Width != null)
- {
- Width = double.Parse(outline.Width) * 1.0 * Globals.px96 / Globals.px914400;
- }
- else
- {
- Width = 0.75;
- }
- // Center = 0,Insert = 1
- //
- //20.1.10.39
- string algn = null;
- if (outline.Alignment != null)
- {
- algn = outline.Alignment;
- }
- /* 20.1.10.15 复合类型
- Single = 0, 单线 默认
- Double = 1, 双细线
- ThickThin = 2, 粗到细
- ThinThick = 3, 细到粗
- Triple = 4 三线
- */
- string cmpd = null;
- if (outline.CompoundLineType != null)
- {
- cmpd = outline.CompoundLineType;
- }
- /* 20.1.10.31 线端类型
- Round = 0, 方
- Square = 1,圆
- Flat = 2 平
- */
- string cap = null;
- if (outline.CapType != null)
- {
- cap = outline.CapType;
- }
- border.outline = new HtexOutline { width = Width, algn = algn, cmpd = cmpd, cap = cap };
- var gradFill = outline.GetFirstChild<GradientFill>();
- if (gradFill != null)
- {
- border.color.type = 2;
- border.color.gradientFill = DoGradientFill(gradFill,wordDoc);
- }
- var noFill = outline.GetFirstChild<NoFill>();
- if (noFill != null)
- {
- border.color.type = 0;
- }
- var pattFill = outline.GetFirstChild<PatternFill>();
- if (pattFill != null)
- {
- HtexPattFill htexPattFill = DoPattFill(pattFill,wordDoc);
- border.color.type = 4;
- border.color.pattFill = htexPattFill;
- }
- var solidFill = outline.GetFirstChild<SolidFill>();
- if (solidFill != null)
- {
- border.color.type = 1;
- border.color.solidFill = DoSolidFill(solidFill);
- }
- if (Width != null && Width > 0)
- {
- border.type = "solid";
- border.stroke = "0";
- }
- var prstDash = outline.GetFirstChild<PresetDash>(); //预设连接符
- if (prstDash != null)
- {
- // PresetDash
- var (type, stroke) = DoPrstDash(prstDash);
- border.type = type;
- border.stroke = stroke;
- }
- if (outline.GetFirstChild<Bevel>() != null)
- {
- // 棱台切角
- border.corner = "bevel";
- }
- if (outline.GetFirstChild<Round>() != null)
- {
- //圆角
- border.corner = "round";
- }
- if (outline.GetFirstChild<Miter>() != null)
- {
- //斜角
- border.corner = "miter";
- }
- var headEndNodeAttrs = outline.GetFirstChild<HeadEnd>(); //连接符开始符号
- if (headEndNodeAttrs != null)
- {
- border.headEnd = headEndNodeAttrs.Type;
- }
- var tailEndNodeAttrs = outline.GetFirstChild<TailEnd>();//末端连接符
- if (tailEndNodeAttrs != null)
- {
- border.tailEnd = tailEndNodeAttrs.Type;
- }
- //TODO
- //outline.GetTextByPath("//a:extLst");
- var custDash = outline.GetFirstChild<CustomDash>();//自定义连接线
- if (custDash != null)
- {
- var (type, stroke) = DoCustDash(custDash);
- border.type = type;
- border.stroke = stroke;
- }
- if (border.color != null && (border.color.type != null || border.color.type != 1) && border.outline.width == null)
- {
- border.outline.width = 1;
- if (border.type == "none" || border.type == null)
- {
- border.type = "solid";
- border.stroke = "0";
- }
- }
- return border;
- }
- /// <summary>
- ///自定义连线符
- /// </summary>
- /// <param name="custDash"></param>
- /// <returns></returns>
- public static (string type, string stroke) DoCustDash(CustomDash custDash)
- {
- string type = "cust";
- string stroke = "0";
- IEnumerable<XElement> elements = custDash.GetPPTXNodeListByPath("ds");
- if (elements != null)
- {
- foreach (XElement element in elements)
- {
- var d = element.Attribute("d");//线段长度
- if (d != null)
- {
- stroke = stroke + d.Value + ",";
- }
- var sp = element.Attribute("sp");//空白间距长度
- if (sp != null)
- {
- stroke = stroke + sp.Value + ",";
- }
- }
- }
- if (string.IsNullOrEmpty(stroke))
- {
- stroke = "0";
- }
- if (stroke.EndsWith(","))
- {
- stroke.Substring(0, stroke.Length - 1);
- }
- return (type, stroke);
- }
- /// <summary>
- /// 预设连线符
- /// </summary>
- /// <param name="presetDash"></param>
- /// <returns></returns>
- public static (string type, string stroke) DoPrstDash(PresetDash presetDash)
- {
- Border border = new Border()
- {
- type = "solid",
- stroke = "0"
- };
- //PresetLineDashValues 枚举
- string val = presetDash.Val;
- switch (val)
- {
- case "solid":
- border.type = "solid";
- border.stroke = "0";
- break;
- case "dash":
- border.type += "dashed";
- border.stroke = "5";
- break;
- case "dashDot":
- border.type = "dashed";
- border.stroke = "5, 5, 1, 5";
- break;
- case "dot":
- border.type = "dotted";
- border.stroke = "1, 5";
- break;
- case "lgDash":
- border.type = "dashed";
- border.stroke = "10, 5";
- break;
- case "lgDashDotDot":
- border.type = "dashed";
- border.stroke = "10, 5, 1, 5, 1, 5";
- break;
- case "sysDash":
- border.type = "dashed";
- border.stroke = "5, 2";
- break;
- case "sysDashDot":
- border.type = "dashed";
- border.stroke = "5, 2, 1, 5";
- break;
- case "sysDashDotDot":
- border.type = "dashed";
- border.stroke = "5, 2, 1, 5, 1, 5";
- break;
- case "sysDot":
- border.type = "dotted";
- border.stroke = "2, 5";
- break;
- case null:
- //console.log(borderType);
- default:
- border.type = "solid";
- border.stroke = "0";
- break;
- }
- return (border.type, border.stroke);
- }
- }
- }
|