public PPTContainerShape GetPPTContainerShape(SlidePart slidePart, PPTSlide slide) { var pptContainerShape = new PPTContainerShape(); pptContainerShape.Elements = new List <PPTShapeBase>(); foreach (object obj in slidePart.Slide.Descendants()) { if (typeof(Shape).Equals(obj.GetType())) { pptContainerShape.Elements.Add(new PPTShape(slidePart, (Shape)obj, slide)); } else if (typeof(Picture).Equals(obj.GetType())) { pptContainerShape.Elements.Add(new PPTImage(slidePart, (Picture)obj)); } else if (typeof(GraphicFrame).Equals(obj.GetType())) { pptContainerShape.Elements.Add(new PPTGraphicFrame(slidePart, (GraphicFrame)obj)); } else if (typeof(GroupShape).Equals(obj.GetType())) { pptContainerShape.Elements.Add(new PPTGroupShape(slidePart, (GroupShape)obj)); } else if (typeof(ConnectionShape).Equals(obj.GetType())) { pptContainerShape.Elements.Add(new PPTConnectionShape(slidePart, (ConnectionShape)obj)); } } return(pptContainerShape); }
public HtmlController(string filepath, string filename, PPTSlide aSlide, int slideCounter, int slidesNumber) { _baseFileName = filename; try { if (filename.Length != 0) { if (slidesNumber != 1) { this._fileName = filename + "_" + slideCounter.ToString(); } else { this._fileName = filename; } } this._mSlide = aSlide; _numberOfSlides = 1; _allSlidesCount = slidesNumber; _slideIndex = slideCounter; this._filePath = filepath; this._htmlPart = new StringBuilder(); } catch (ArgumentNullException ex) { Console.WriteLine("The passed value for filename:" + ex.Message); return; } }
public PPTRunProperties(PPTSlide slide) { //Default Fonts this.slide = slide; this.FontFamily = "Calibri"; this.FontSize = 32; this.Bold = false; this.Italic = false; this.FontColor = "#000000"; this.Top = 0; this.Left = 0; }
public PPTParagraph(PPTSlide slide, PlaceholderShape placeholder) { this.slide = slide; this.Align = ""; this.FontAlign = ""; this.Indent = 0; this.Level = 0; this.marginLeft = 0; this.marginRight = 0; this.placeholder = placeholder; this.defTabSize = 0; RunPropList = new List <PPTRunProperties>(); }
public PPTRunProperties(PPTRunProperties copy) { this.FontColor = copy.FontColor; this.FontFamily = copy.FontFamily; this.FontSize = copy.FontSize; this.Top = copy.Top; this.Left = copy.Left; this.Italic = copy.Italic; this.Bold = copy.Bold; this.Invisible = copy.Invisible; this.isBreak = copy.isBreak; this.Animatable = copy.Animatable; this.Spacing = copy.Spacing; this.Text = copy.Text; this.slide = copy.slide; }
private List <PPTSlide> GetPPTSlidesFromParts(IEnumerable <SlidePart> slideParts, DefaultTextStyle defaultTextStyle, string fileName) { var pptSlides = new List <PPTSlide>(); int slideIndex = 1; foreach (SlidePart slidePart in slideParts) { if (slideIndex > 1 && slidePart.Slide.Transition != null && slidePart.Slide.Transition.AdvanceAfterTime != null) { pptSlides[pptSlides.Count - 1].advanceAfterTime = int.Parse(slidePart.Slide.Transition.AdvanceAfterTime.Value); } var pptSlide = new PPTSlide(slidePart, slideIndex++, defaultTextStyle, fileName, SlideSizes); pptSlides.Add(pptSlide); } return(pptSlides); }
public void setRgbColor(CommonTimeNode commonTimeNode, PPTSlide Slide) { RGBColor = "[0,0,0]"; foreach (Object xmlEl in commonTimeNode.Descendants()) { if (xmlEl.GetType().Equals(typeof(RgbColorModelHex))) { RgbColorModelHex rgb = (RgbColorModelHex)xmlEl; RGBColor = convertHEXtoRGB(((RgbColorModelHex)rgb).Val); } else if (xmlEl.GetType().Equals(typeof(SchemeColor))) { string schemeCol = ((SchemeColor)xmlEl).Val; DocumentFormat.OpenXml.Drawing.ColorScheme allSchemeCols = Slide.SlideLayoutPart.SlideMasterPart.ThemePart.Theme.ThemeElements.ColorScheme; foreach (OpenXmlCompositeElement desc in allSchemeCols.Descendants()) { string currSchemeCol = desc.LocalName; if (schemeCol == currSchemeCol || (schemeCol == "bg1" && currSchemeCol == "lt1") || (schemeCol == "bg2" && currSchemeCol == "lt2") || (schemeCol == "tx1" && currSchemeCol == "dk1") || (schemeCol == "tx2" && currSchemeCol == "dk2")) { if (typeof(RgbColorModelHex) == desc.FirstChild.GetType()) { RGBColor = convertHEXtoRGB(((RgbColorModelHex)desc.FirstChild).Val); } else if (typeof(SystemColor) == desc.FirstChild.GetType()) { RGBColor = convertHEXtoRGB(((SystemColor)desc.FirstChild).LastColor); } } } break; } } }
internal List <PPTShape> GetShapes(SlidePart slidePart, PPTSlide slide) { return(slidePart.Slide.Descendants <Shape>().Select(shape => new PPTShape(slidePart, shape, slide)).ToList()); }
public JSONGenerator(List <PPTSlide> slides) { this.Slide = slides.ElementAt(0); //TODO: add support for more than one slide }
public JSONGenerator(PPTSlide slide) { this.Slide = slide; }