private void AddTableCommonProperty(GraphicFrame graphicFrame1, uint ObjectID) { NonVisualGraphicFrameProperties nonVisualGraphicFrameProperties1 = new NonVisualGraphicFrameProperties(); NonVisualDrawingProperties nonVisualDrawingProperties2 = new NonVisualDrawingProperties() { Id = ObjectID, Name = $"Table{ObjectID}" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList1 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension1 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement1 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{7AB8EDC7-F9EF-4752-9A46-413B9437344B}\" />"); nonVisualDrawingPropertiesExtension1.Append(openXmlUnknownElement1); nonVisualDrawingPropertiesExtensionList1.Append(nonVisualDrawingPropertiesExtension1); nonVisualDrawingProperties2.Append(nonVisualDrawingPropertiesExtensionList1); NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties1 = new NonVisualGraphicFrameDrawingProperties(); A.GraphicFrameLocks graphicFrameLocks1 = new A.GraphicFrameLocks() { NoGrouping = true }; nonVisualGraphicFrameDrawingProperties1.Append(graphicFrameLocks1); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties2 = new ApplicationNonVisualDrawingProperties(); ApplicationNonVisualDrawingPropertiesExtensionList applicationNonVisualDrawingPropertiesExtensionList1 = new ApplicationNonVisualDrawingPropertiesExtensionList(); ApplicationNonVisualDrawingPropertiesExtension applicationNonVisualDrawingPropertiesExtension1 = new ApplicationNonVisualDrawingPropertiesExtension() { Uri = "{D42A27DB-BD31-4B8C-83A1-F6EECF244321}" }; P14.ModificationId modificationId1 = new P14.ModificationId() { Val = (UInt32Value)833561296U }; modificationId1.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main"); applicationNonVisualDrawingPropertiesExtension1.Append(modificationId1); applicationNonVisualDrawingPropertiesExtensionList1.Append(applicationNonVisualDrawingPropertiesExtension1); applicationNonVisualDrawingProperties2.Append(applicationNonVisualDrawingPropertiesExtensionList1); nonVisualGraphicFrameProperties1.Append(nonVisualDrawingProperties2); nonVisualGraphicFrameProperties1.Append(nonVisualGraphicFrameDrawingProperties1); nonVisualGraphicFrameProperties1.Append(applicationNonVisualDrawingProperties2); graphicFrame1.Append(nonVisualGraphicFrameProperties1); }
// Generates content of drawingsPart1. //private void GenerateDrawingsPartContent(DrawingsPart drawingsPart, Chart chart) //{ // var worksheetDrawing = new Xdr.WorksheetDrawing(); // worksheetDrawing.AddNamespaceDeclaration("xdr", "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); // worksheetDrawing.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main"); // var twoCellAnchor = new Xdr.TwoCellAnchor(); // var fromMarker = new Xdr.FromMarker(); // var columnIdFrom = new Xdr.ColumnId(); // columnIdFrom.Text = chart.ColumnFrom.ToString(); // Xdr.ColumnOffset columnOffsetFrom = new Xdr.ColumnOffset(); // columnOffsetFrom.Text = "11908"; // var rowIdFrom = new Xdr.RowId(); // rowIdFrom.Text = chart.RowFrom.ToString(); // Xdr.RowOffset rowOffsetFrom = new Xdr.RowOffset(); // rowOffsetFrom.Text = "9523"; // fromMarker.Append(columnIdFrom); // fromMarker.Append(columnOffsetFrom); // fromMarker.Append(rowIdFrom); // fromMarker.Append(rowOffsetFrom); // var toMarker = new Xdr.ToMarker(); // var columnIdTo = new Xdr.ColumnId(); // columnIdTo.Text = chart.ColumnTo.ToString(); // Xdr.ColumnOffset columnOffsetTo = new Xdr.ColumnOffset(); // columnOffsetTo.Text = "250032"; // var rowIdTo = new Xdr.RowId(); // rowIdTo.Text = chart.RowTo.ToString(); // Xdr.RowOffset rowOffsetTo = new Xdr.RowOffset(); // rowOffsetTo.Text = "29764"; // toMarker.Append(columnIdTo); // toMarker.Append(columnOffsetTo); // toMarker.Append(rowIdTo); // toMarker.Append(rowOffsetTo); // var graphicFrame = new Xdr.GraphicFrame() { Macro = "" }; // var nonVisualGraphicFrameProperties = new Xdr.NonVisualGraphicFrameProperties(); // var nonVisualDrawingProperties = new Xdr.NonVisualDrawingProperties() { Id = (UInt32Value)2U, Name = chart.TableKey }; // var nonVisualGraphicFrameDrawingProperties = new Xdr.NonVisualGraphicFrameDrawingProperties(); // var graphicFrameLocks = new A.GraphicFrameLocks(); // nonVisualGraphicFrameDrawingProperties.Append(graphicFrameLocks); // nonVisualGraphicFrameProperties.Append(nonVisualDrawingProperties); // nonVisualGraphicFrameProperties.Append(nonVisualGraphicFrameDrawingProperties); // var transform = new Xdr.Transform(); // var offset = new A.Offset() { X = 0L, Y = 0L }; // var extents = new A.Extents() { Cx = 0L, Cy = 0L }; // transform.Append(offset); // transform.Append(extents); // var graphic = new A.Graphic(); // var graphicData = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/chart" }; // var chartReference = new C.ChartReference() { Id = "rId1" }; // chartReference.AddNamespaceDeclaration("c", "http://schemas.openxmlformats.org/drawingml/2006/chart"); // chartReference.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); // graphicData.Append(chartReference); // graphic.Append(graphicData); // graphicFrame.Append(nonVisualGraphicFrameProperties); // graphicFrame.Append(transform); // graphicFrame.Append(graphic); // var clientData = new Xdr.ClientData(); // twoCellAnchor.Append(fromMarker); // twoCellAnchor.Append(toMarker); // twoCellAnchor.Append(graphicFrame); // twoCellAnchor.Append(clientData); // worksheetDrawing.Append(twoCellAnchor); // drawingsPart.WorksheetDrawing = worksheetDrawing; //} //// Generates content of chartPart1. //private void GenerateChartPartContent(ChartPart chartPart, Chart chart) //{ // var chartSpace = new C.ChartSpace(); // chartSpace.AddNamespaceDeclaration("c", "http://schemas.openxmlformats.org/drawingml/2006/chart"); // chartSpace.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main"); // chartSpace.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); // var editingLanguage = new C.EditingLanguage() { Val = "en-US" }; // var style = new C.Style() { Val = 10 }; // var _chart = new C.Chart(); // var title = new C.Title(); // var chartText = new C.ChartText(); // var richText = new C.RichText(); // var bodyProperties = new A.BodyProperties(); // var listStyle = new A.ListStyle(); // var paragraph = new A.Paragraph(); // var paragraphProperties = new A.ParagraphProperties(); // var defaultRunProperties = new A.DefaultRunProperties(); // paragraphProperties.Append(defaultRunProperties); // var run = new A.Run(); // var runProperties = new A.RunProperties() { Language = "en-US", FontSize = 800 }; // var text = new A.Text(); // text.Text = chart.Title; // run.Append(runProperties); // run.Append(text); // //A.Run run2 = new A.Run(); // //A.RunProperties runProperties2 = new A.RunProperties() { Language = "en-US", FontSize = 800, Baseline = 0 }; // //A.Text text2 = new A.Text(); // //text2.Text = title; // //run2.Append(runProperties2); // //run2.Append(text2); // var endParagraphRunProperties = new A.EndParagraphRunProperties() { Language = "en-US", FontSize = 800 }; // paragraph.Append(paragraphProperties); // paragraph.Append(run); // //paragraph1.Append(run2); // paragraph.Append(endParagraphRunProperties); // richText.Append(bodyProperties); // richText.Append(listStyle); // richText.Append(paragraph); // chartText.Append(richText); // var layout1 = new C.Layout(); // var manualLayout1 = new C.ManualLayout(); // var leftMode1 = new C.LeftMode() { Val = C.LayoutModeValues.Edge }; // var topMode1 = new C.TopMode() { Val = C.LayoutModeValues.Edge }; // var left1 = new C.Left() { Val = 0.14936699324798144D }; // var top1 = new C.Top() { Val = 7.5867300613079197E-2D }; // manualLayout1.Append(leftMode1); // manualLayout1.Append(topMode1); // manualLayout1.Append(left1); // manualLayout1.Append(top1); // layout1.Append(manualLayout1); // title.Append(chartText); // title.Append(layout1); // var plotArea = new C.PlotArea(); // var layout2 = new C.Layout(); // var manualLayout2 = new C.ManualLayout(); // var layoutTarget2 = new C.LayoutTarget() { Val = C.LayoutTargetValues.Inner }; // var leftMode2 = new C.LeftMode() { Val = C.LayoutModeValues.Edge }; // var topMode2 = new C.TopMode() { Val = C.LayoutModeValues.Edge }; // var left2 = new C.Left() { Val = 0.10245464404093282D }; // var top2 = new C.Top() { Val = 4.7416814491091287E-2D }; // var width2 = new C.Width() { Val = 0.88919609910728359D }; // // chart height inside word drawing part // //C.Height height1 = new C.Height() { Val = 0.81899924741893582D }; // original generated value // var height2 = new C.Height() { Val = 0.86 }; // manualLayout2.Append(layoutTarget2); // manualLayout2.Append(leftMode2); // manualLayout2.Append(topMode2); // manualLayout2.Append(left2); // manualLayout2.Append(top2); // manualLayout2.Append(width2); // manualLayout2.Append(height2); // layout2.Append(manualLayout2); // var areaChart = new C.AreaChart(); // var grouping = new C.Grouping() { Val = C.GroupingValues.Standard }; // var areaChartSeries = new C.AreaChartSeries(); // var index = new C.Index() { Val = (UInt32Value)0U }; // var order = new C.Order() { Val = (UInt32Value)0U }; // var seriesText = new C.SeriesText(); // var stringReference = new C.StringReference(); // var formula1 = new C.Formula(); // formula1.Text = chart.AxisX; // var stringCache = new C.StringCache(); // var pointCount1 = new C.PointCount() { Val = (UInt32Value)1U }; // var stringPoint = new C.StringPoint() { Index = (UInt32Value)0U }; // var numericValue = new C.NumericValue(); // numericValue.Text = chart.LegendTitle; // stringPoint.Append(numericValue); // stringCache.Append(pointCount1); // stringCache.Append(stringPoint); // stringReference.Append(formula1); // stringReference.Append(stringCache); // seriesText.Append(stringReference); // var values = new C.Values(); // var numberReference = new C.NumberReference(); // var formula2 = new C.Formula(); // formula2.Text = chart.AxisY; // C.NumberingCache numberingCache = new C.NumberingCache(); // C.FormatCode formatCode = new C.FormatCode(); // formatCode.Text = "0.00%"; // /* years */ // C.PointCount pointCount2 = new C.PointCount() { Val = UInt32Value.FromUInt32((uint)chart.Labels.Count) }; // numberingCache.Append(formatCode); // numberingCache.Append(pointCount2); // for (int i = 0; i < chart.Labels.Count; i++) // { // C.NumericPoint numericPoint = new C.NumericPoint() { Index = UInt32Value.FromUInt32((uint)i) }; // C.NumericValue _numericValue = new C.NumericValue(); // numericValue.Text = string.Format("{0}E-2", chart.Labels[i]); // numericPoint.Append(_numericValue); // numberingCache.Append(numericPoint); // } // numberReference.Append(formula2); // numberReference.Append(numberingCache); // values.Append(numberReference); // areaChartSeries.Append(index); // areaChartSeries.Append(order); // areaChartSeries.Append(seriesText); // areaChartSeries.Append(values); // var axisId1 = new C.AxisId() { Val = (UInt32Value)78173696U }; // var axisId2 = new C.AxisId() { Val = (UInt32Value)78175232U }; // areaChart.Append(grouping); // areaChart.Append(areaChartSeries); // areaChart.Append(axisId1); // areaChart.Append(axisId2); // var categoryAxis1 = new C.CategoryAxis(); // var axisId3 = new C.AxisId() { Val = (UInt32Value)78173696U }; // var scaling1 = new C.Scaling(); // var orientation1 = new C.Orientation() { Val = C.OrientationValues.MinMax }; // scaling1.Append(orientation1); // var axisPosition1 = new C.AxisPosition() { Val = C.AxisPositionValues.Bottom }; // var majorTickMark1 = new C.MajorTickMark() { Val = C.TickMarkValues.None }; // var tickLabelPosition1 = new C.TickLabelPosition() { Val = C.TickLabelPositionValues.NextTo }; // var crossingAxis1 = new C.CrossingAxis() { Val = (UInt32Value)78175232U }; // var crosses1 = new C.Crosses() { Val = C.CrossesValues.AutoZero }; // var autoLabeled1 = new C.AutoLabeled() { Val = true }; // var labelAlignment1 = new C.LabelAlignment() { Val = C.LabelAlignmentValues.Center }; // var labelOffset1 = new C.LabelOffset() { Val = (UInt16Value)100U }; // categoryAxis1.Append(axisId3); // categoryAxis1.Append(scaling1); // categoryAxis1.Append(axisPosition1); // categoryAxis1.Append(majorTickMark1); // categoryAxis1.Append(tickLabelPosition1); // categoryAxis1.Append(crossingAxis1); // categoryAxis1.Append(crosses1); // categoryAxis1.Append(autoLabeled1); // categoryAxis1.Append(labelAlignment1); // categoryAxis1.Append(labelOffset1); // var valueAxis1 = new C.ValueAxis(); // var axisId4 = new C.AxisId() { Val = (UInt32Value)78175232U }; // var scaling2 = new C.Scaling(); // var orientation2 = new C.Orientation() { Val = C.OrientationValues.MinMax }; // scaling2.Append(orientation2); // var axisPosition2 = new C.AxisPosition() { Val = C.AxisPositionValues.Left }; // var majorGridlines1 = new C.MajorGridlines(); // var numberingFormat1 = new C.NumberingFormat() { FormatCode = "0.00%", SourceLinked = true }; // var majorTickMark2 = new C.MajorTickMark() { Val = C.TickMarkValues.None }; // var tickLabelPosition2 = new C.TickLabelPosition() { Val = C.TickLabelPositionValues.NextTo }; // var crossingAxis2 = new C.CrossingAxis() { Val = (UInt32Value)78173696U }; // var crosses2 = new C.Crosses() { Val = C.CrossesValues.AutoZero }; // var crossBetween1 = new C.CrossBetween() { Val = C.CrossBetweenValues.MidpointCategory }; // valueAxis1.Append(axisId4); // valueAxis1.Append(scaling2); // valueAxis1.Append(axisPosition2); // valueAxis1.Append(majorGridlines1); // valueAxis1.Append(numberingFormat1); // valueAxis1.Append(majorTickMark2); // valueAxis1.Append(tickLabelPosition2); // valueAxis1.Append(crossingAxis2); // valueAxis1.Append(crosses2); // valueAxis1.Append(crossBetween1); // var dataTable1 = new C.DataTable(); // var showHorizontalBorder1 = new C.ShowHorizontalBorder() { Val = true }; // var showVerticalBorder1 = new C.ShowVerticalBorder() { Val = true }; // var showOutlineBorder1 = new C.ShowOutlineBorder() { Val = true }; // var showKeys1 = new C.ShowKeys() { Val = true }; // dataTable1.Append(showHorizontalBorder1); // dataTable1.Append(showVerticalBorder1); // dataTable1.Append(showOutlineBorder1); // dataTable1.Append(showKeys1); // C.ShapeProperties shapeProperties1 = new C.ShapeProperties(); // A.Outline outline1 = new A.Outline(); // A.NoFill noFill1 = new A.NoFill(); // outline1.Append(noFill1); // shapeProperties1.Append(outline1); // plotArea.Append(layout2); // plotArea.Append(areaChart); // plotArea.Append(categoryAxis1); // plotArea.Append(valueAxis1); // plotArea.Append(dataTable1); // plotArea.Append(shapeProperties1); // var plotVisibleOnly1 = new C.PlotVisibleOnly() { Val = true }; // var displayBlanksAs1 = new C.DisplayBlanksAs() { Val = C.DisplayBlanksAsValues.Zero }; // _chart.Append(title); // _chart.Append(plotArea); // _chart.Append(plotVisibleOnly1); // _chart.Append(displayBlanksAs1); // var textProperties1 = new C.TextProperties(); // var bodyProperties2 = new A.BodyProperties(); // var listStyle2 = new A.ListStyle(); // var paragraph2 = new A.Paragraph(); // var paragraphProperties2 = new A.ParagraphProperties(); // var defaultRunProperties2 = new A.DefaultRunProperties() { FontSize = 700 }; // paragraphProperties2.Append(defaultRunProperties2); // var endParagraphRunProperties2 = new A.EndParagraphRunProperties() { Language = "en-US" }; // paragraph2.Append(paragraphProperties2); // paragraph2.Append(endParagraphRunProperties2); // textProperties1.Append(bodyProperties2); // textProperties1.Append(listStyle2); // textProperties1.Append(paragraph2); // var printSettings1 = new C.PrintSettings(); // var headerFooter1 = new C.HeaderFooter(); // var pageMargins1 = new C.PageMargins() { Left = 0.70000000000000018D, Right = 0.70000000000000018D, Top = 0.75000000000000022D, Bottom = 0.75000000000000022D, Header = 0.3000000000000001D, Footer = 0.3000000000000001D }; // var pageSetup1 = new C.PageSetup() { Orientation = C.PageSetupOrientationValues.Landscape }; // printSettings1.Append(headerFooter1); // printSettings1.Append(pageMargins1); // printSettings1.Append(pageSetup1); // chartSpace.Append(editingLanguage); // chartSpace.Append(style); // chartSpace.Append(_chart); // chartSpace.Append(textProperties1); // chartSpace.Append(printSettings1); // var chartShapeProperties2 = new ChartShapeProperties(); // var outline2 = new DocumentFormat.OpenXml.Drawing.Outline(); // var noFill2 = new NoFill(); // outline2.Append(noFill2); // chartShapeProperties2.Append(outline2); // //chartSpace.Append(chartShapeProperties2); // chartPart.ChartSpace = chartSpace; //} // Generates content of drawingsPart1. private void GenerateDrawingsPart1Content(DrawingsPart drawingsPart1, Chart chart) { Xdr.WorksheetDrawing worksheetDrawing1 = new Xdr.WorksheetDrawing(); worksheetDrawing1.AddNamespaceDeclaration("xdr", "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); worksheetDrawing1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main"); Xdr.TwoCellAnchor twoCellAnchor1 = new Xdr.TwoCellAnchor(); Xdr.FromMarker fromMarker1 = new Xdr.FromMarker(); Xdr.ColumnId columnId1 = new Xdr.ColumnId(); columnId1.Text = chart.ColumnFrom.ToString(); Xdr.ColumnOffset columnOffset1 = new Xdr.ColumnOffset(); columnOffset1.Text = "0"; Xdr.RowId rowId1 = new Xdr.RowId(); rowId1.Text = chart.RowFrom.ToString(); Xdr.RowOffset rowOffset1 = new Xdr.RowOffset(); rowOffset1.Text = "0"; fromMarker1.Append(columnId1); fromMarker1.Append(columnOffset1); fromMarker1.Append(rowId1); fromMarker1.Append(rowOffset1); Xdr.ToMarker toMarker1 = new Xdr.ToMarker(); Xdr.ColumnId columnId2 = new Xdr.ColumnId(); columnId2.Text = chart.ColumnTo.ToString(); Xdr.ColumnOffset columnOffset2 = new Xdr.ColumnOffset(); columnOffset2.Text = "238124"; Xdr.RowId rowId2 = new Xdr.RowId(); rowId2.Text = chart.RowTo.ToString(); Xdr.RowOffset rowOffset2 = new Xdr.RowOffset(); rowOffset2.Text = "20241"; toMarker1.Append(columnId2); toMarker1.Append(columnOffset2); toMarker1.Append(rowId2); toMarker1.Append(rowOffset2); Xdr.GraphicFrame graphicFrame1 = new Xdr.GraphicFrame() { Macro = "" }; Xdr.NonVisualGraphicFrameProperties nonVisualGraphicFrameProperties1 = new Xdr.NonVisualGraphicFrameProperties(); Xdr.NonVisualDrawingProperties nonVisualDrawingProperties1 = new Xdr.NonVisualDrawingProperties() { Id = (UInt32Value)2U, Name = chart.TableKey }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList1 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension1 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement1 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{D4EA194D-E283-4B88-B3BE-83B3557FCE42}\" />"); nonVisualDrawingPropertiesExtension1.Append(openXmlUnknownElement1); nonVisualDrawingPropertiesExtensionList1.Append(nonVisualDrawingPropertiesExtension1); nonVisualDrawingProperties1.Append(nonVisualDrawingPropertiesExtensionList1); Xdr.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties1 = new Xdr.NonVisualGraphicFrameDrawingProperties(); A.GraphicFrameLocks graphicFrameLocks1 = new A.GraphicFrameLocks(); nonVisualGraphicFrameDrawingProperties1.Append(graphicFrameLocks1); nonVisualGraphicFrameProperties1.Append(nonVisualDrawingProperties1); nonVisualGraphicFrameProperties1.Append(nonVisualGraphicFrameDrawingProperties1); Xdr.Transform transform1 = new Xdr.Transform(); A.Offset offset1 = new A.Offset() { X = 0L, Y = 0L }; A.Extents extents1 = new A.Extents() { Cx = 0L, Cy = 0L }; transform1.Append(offset1); transform1.Append(extents1); A.Graphic graphic1 = new A.Graphic(); A.GraphicData graphicData1 = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/chart" }; C.ChartReference chartReference1 = new C.ChartReference() { Id = "rId1" }; chartReference1.AddNamespaceDeclaration("c", "http://schemas.openxmlformats.org/drawingml/2006/chart"); chartReference1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); graphicData1.Append(chartReference1); graphic1.Append(graphicData1); graphicFrame1.Append(nonVisualGraphicFrameProperties1); graphicFrame1.Append(transform1); graphicFrame1.Append(graphic1); Xdr.ClientData clientData1 = new Xdr.ClientData(); twoCellAnchor1.Append(fromMarker1); twoCellAnchor1.Append(toMarker1); twoCellAnchor1.Append(graphicFrame1); twoCellAnchor1.Append(clientData1); worksheetDrawing1.Append(twoCellAnchor1); drawingsPart1.WorksheetDrawing = worksheetDrawing1; }
public static void GenerateHandoutMasterPart1Content(HandoutMasterPart handoutMasterPart1) { HandoutMaster handoutMaster1 = new HandoutMaster(); handoutMaster1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main"); handoutMaster1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); handoutMaster1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main"); CommonSlideData commonSlideData1 = new CommonSlideData(); Background background1 = new Background(); BackgroundStyleReference backgroundStyleReference1 = new BackgroundStyleReference() { Index = (UInt32Value)1001U }; A.SchemeColor schemeColor10 = new A.SchemeColor() { Val = A.SchemeColorValues.Background1 }; backgroundStyleReference1.Append(schemeColor10); background1.Append(backgroundStyleReference1); ShapeTree shapeTree1 = new ShapeTree(); NonVisualGroupShapeProperties nonVisualGroupShapeProperties1 = new NonVisualGroupShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties1 = new NonVisualDrawingProperties() { Id = (UInt32Value)1U, Name = "" }; NonVisualGroupShapeDrawingProperties nonVisualGroupShapeDrawingProperties1 = new NonVisualGroupShapeDrawingProperties(); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties1 = new ApplicationNonVisualDrawingProperties(); nonVisualGroupShapeProperties1.Append(nonVisualDrawingProperties1); nonVisualGroupShapeProperties1.Append(nonVisualGroupShapeDrawingProperties1); nonVisualGroupShapeProperties1.Append(applicationNonVisualDrawingProperties1); GroupShapeProperties groupShapeProperties1 = new GroupShapeProperties(); A.TransformGroup transformGroup1 = new A.TransformGroup(); A.Offset offset1 = new A.Offset() { X = 0L, Y = 0L }; A.Extents extents1 = new A.Extents() { Cx = 0L, Cy = 0L }; A.ChildOffset childOffset1 = new A.ChildOffset() { X = 0L, Y = 0L }; A.ChildExtents childExtents1 = new A.ChildExtents() { Cx = 0L, Cy = 0L }; transformGroup1.Append(offset1); transformGroup1.Append(extents1); transformGroup1.Append(childOffset1); transformGroup1.Append(childExtents1); groupShapeProperties1.Append(transformGroup1); Shape shape1 = new Shape(); NonVisualShapeProperties nonVisualShapeProperties1 = new NonVisualShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties2 = new NonVisualDrawingProperties() { Id = (UInt32Value)2U, Name = "Header Placeholder 1" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList1 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension1 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement1 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{6F844995-19E8-4464-BD76-40D129E09750}\" />"); nonVisualDrawingPropertiesExtension1.Append(openXmlUnknownElement1); nonVisualDrawingPropertiesExtensionList1.Append(nonVisualDrawingPropertiesExtension1); nonVisualDrawingProperties2.Append(nonVisualDrawingPropertiesExtensionList1); NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties1 = new NonVisualShapeDrawingProperties(); A.ShapeLocks shapeLocks1 = new A.ShapeLocks() { NoGrouping = true }; nonVisualShapeDrawingProperties1.Append(shapeLocks1); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties2 = new ApplicationNonVisualDrawingProperties(); PlaceholderShape placeholderShape1 = new PlaceholderShape() { Type = PlaceholderValues.Header, Size = PlaceholderSizeValues.Quarter }; applicationNonVisualDrawingProperties2.Append(placeholderShape1); nonVisualShapeProperties1.Append(nonVisualDrawingProperties2); nonVisualShapeProperties1.Append(nonVisualShapeDrawingProperties1); nonVisualShapeProperties1.Append(applicationNonVisualDrawingProperties2); ShapeProperties shapeProperties1 = new ShapeProperties(); A.Transform2D transform2D1 = new A.Transform2D(); A.Offset offset2 = new A.Offset() { X = 0L, Y = 1L }; A.Extents extents2 = new A.Extents() { Cx = 2946400L, Cy = 495300L }; transform2D1.Append(offset2); transform2D1.Append(extents2); A.PresetGeometry presetGeometry1 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle }; A.AdjustValueList adjustValueList1 = new A.AdjustValueList(); presetGeometry1.Append(adjustValueList1); shapeProperties1.Append(transform2D1); shapeProperties1.Append(presetGeometry1); TextBody textBody1 = new TextBody(); A.BodyProperties bodyProperties1 = new A.BodyProperties() { Vertical = A.TextVerticalValues.Horizontal, LeftInset = 91440, TopInset = 45720, RightInset = 91440, BottomInset = 45720, RightToLeftColumns = false }; A.ListStyle listStyle1 = new A.ListStyle(); A.Level1ParagraphProperties level1ParagraphProperties2 = new A.Level1ParagraphProperties() { Alignment = A.TextAlignmentTypeValues.Left }; A.DefaultRunProperties defaultRunProperties11 = new A.DefaultRunProperties() { FontSize = 1200 }; level1ParagraphProperties2.Append(defaultRunProperties11); listStyle1.Append(level1ParagraphProperties2); A.Paragraph paragraph1 = new A.Paragraph(); A.EndParagraphRunProperties endParagraphRunProperties1 = new A.EndParagraphRunProperties() { Language = "en-GB" }; paragraph1.Append(endParagraphRunProperties1); textBody1.Append(bodyProperties1); textBody1.Append(listStyle1); textBody1.Append(paragraph1); shape1.Append(nonVisualShapeProperties1); shape1.Append(shapeProperties1); shape1.Append(textBody1); Shape shape2 = new Shape(); NonVisualShapeProperties nonVisualShapeProperties2 = new NonVisualShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties3 = new NonVisualDrawingProperties() { Id = (UInt32Value)3U, Name = "Date Placeholder 2" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList2 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension2 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement2 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{DAB3772C-5103-431C-B581-8408B3A89922}\" />"); nonVisualDrawingPropertiesExtension2.Append(openXmlUnknownElement2); nonVisualDrawingPropertiesExtensionList2.Append(nonVisualDrawingPropertiesExtension2); nonVisualDrawingProperties3.Append(nonVisualDrawingPropertiesExtensionList2); NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties2 = new NonVisualShapeDrawingProperties(); A.ShapeLocks shapeLocks2 = new A.ShapeLocks() { NoGrouping = true }; nonVisualShapeDrawingProperties2.Append(shapeLocks2); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties3 = new ApplicationNonVisualDrawingProperties(); PlaceholderShape placeholderShape2 = new PlaceholderShape() { Type = PlaceholderValues.DateAndTime, Size = PlaceholderSizeValues.Quarter, Index = (UInt32Value)1U }; applicationNonVisualDrawingProperties3.Append(placeholderShape2); nonVisualShapeProperties2.Append(nonVisualDrawingProperties3); nonVisualShapeProperties2.Append(nonVisualShapeDrawingProperties2); nonVisualShapeProperties2.Append(applicationNonVisualDrawingProperties3); ShapeProperties shapeProperties2 = new ShapeProperties(); A.Transform2D transform2D2 = new A.Transform2D(); A.Offset offset3 = new A.Offset() { X = 3849688L, Y = 1L }; A.Extents extents3 = new A.Extents() { Cx = 2946400L, Cy = 495300L }; transform2D2.Append(offset3); transform2D2.Append(extents3); A.PresetGeometry presetGeometry2 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle }; A.AdjustValueList adjustValueList2 = new A.AdjustValueList(); presetGeometry2.Append(adjustValueList2); shapeProperties2.Append(transform2D2); shapeProperties2.Append(presetGeometry2); TextBody textBody2 = new TextBody(); A.BodyProperties bodyProperties2 = new A.BodyProperties() { Vertical = A.TextVerticalValues.Horizontal, LeftInset = 91440, TopInset = 45720, RightInset = 91440, BottomInset = 45720, RightToLeftColumns = false }; A.ListStyle listStyle2 = new A.ListStyle(); A.Level1ParagraphProperties level1ParagraphProperties3 = new A.Level1ParagraphProperties() { Alignment = A.TextAlignmentTypeValues.Right }; A.DefaultRunProperties defaultRunProperties12 = new A.DefaultRunProperties() { FontSize = 1200 }; level1ParagraphProperties3.Append(defaultRunProperties12); listStyle2.Append(level1ParagraphProperties3); A.Paragraph paragraph2 = new A.Paragraph(); A.Field field1 = new A.Field() { Id = "{2193C790-BB76-448B-9064-927E80682452}", Type = "datetimeFigureOut" }; A.RunProperties runProperties1 = new A.RunProperties() { Language = "en-GB" }; runProperties1.SetAttribute(new OpenXmlAttribute("", "smtClean", "", "0")); A.Text text1 = new A.Text(); text1.Text = $"{DateTime.Now.Day}.{DateTime.Now.Month}.{DateTime.Now.Year}"; field1.Append(runProperties1); field1.Append(text1); A.EndParagraphRunProperties endParagraphRunProperties2 = new A.EndParagraphRunProperties() { Language = "en-GB" }; paragraph2.Append(field1); paragraph2.Append(endParagraphRunProperties2); textBody2.Append(bodyProperties2); textBody2.Append(listStyle2); textBody2.Append(paragraph2); shape2.Append(nonVisualShapeProperties2); shape2.Append(shapeProperties2); shape2.Append(textBody2); Shape shape3 = new Shape(); NonVisualShapeProperties nonVisualShapeProperties3 = new NonVisualShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties4 = new NonVisualDrawingProperties() { Id = (UInt32Value)4U, Name = "Footer Placeholder 3" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList3 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension3 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement3 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{8F527AE1-483F-4AAE-B350-632A657A43A5}\" />"); nonVisualDrawingPropertiesExtension3.Append(openXmlUnknownElement3); nonVisualDrawingPropertiesExtensionList3.Append(nonVisualDrawingPropertiesExtension3); nonVisualDrawingProperties4.Append(nonVisualDrawingPropertiesExtensionList3); NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties3 = new NonVisualShapeDrawingProperties(); A.ShapeLocks shapeLocks3 = new A.ShapeLocks() { NoGrouping = true }; nonVisualShapeDrawingProperties3.Append(shapeLocks3); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties4 = new ApplicationNonVisualDrawingProperties(); PlaceholderShape placeholderShape3 = new PlaceholderShape() { Type = PlaceholderValues.Footer, Size = PlaceholderSizeValues.Quarter, Index = (UInt32Value)2U }; applicationNonVisualDrawingProperties4.Append(placeholderShape3); nonVisualShapeProperties3.Append(nonVisualDrawingProperties4); nonVisualShapeProperties3.Append(nonVisualShapeDrawingProperties3); nonVisualShapeProperties3.Append(applicationNonVisualDrawingProperties4); ShapeProperties shapeProperties3 = new ShapeProperties(); A.Transform2D transform2D3 = new A.Transform2D(); A.Offset offset4 = new A.Offset() { X = 0L, Y = 9378950L }; A.Extents extents4 = new A.Extents() { Cx = 2946400L, Cy = 495300L }; transform2D3.Append(offset4); transform2D3.Append(extents4); A.PresetGeometry presetGeometry3 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle }; A.AdjustValueList adjustValueList3 = new A.AdjustValueList(); presetGeometry3.Append(adjustValueList3); shapeProperties3.Append(transform2D3); shapeProperties3.Append(presetGeometry3); TextBody textBody3 = new TextBody(); A.BodyProperties bodyProperties3 = new A.BodyProperties() { Vertical = A.TextVerticalValues.Horizontal, LeftInset = 91440, TopInset = 45720, RightInset = 91440, BottomInset = 45720, RightToLeftColumns = false, Anchor = A.TextAnchoringTypeValues.Bottom }; A.ListStyle listStyle3 = new A.ListStyle(); A.Level1ParagraphProperties level1ParagraphProperties4 = new A.Level1ParagraphProperties() { Alignment = A.TextAlignmentTypeValues.Left }; A.DefaultRunProperties defaultRunProperties13 = new A.DefaultRunProperties() { FontSize = 1200 }; level1ParagraphProperties4.Append(defaultRunProperties13); listStyle3.Append(level1ParagraphProperties4); A.Paragraph paragraph3 = new A.Paragraph(); A.EndParagraphRunProperties endParagraphRunProperties3 = new A.EndParagraphRunProperties() { Language = "en-GB" }; paragraph3.Append(endParagraphRunProperties3); textBody3.Append(bodyProperties3); textBody3.Append(listStyle3); textBody3.Append(paragraph3); shape3.Append(nonVisualShapeProperties3); shape3.Append(shapeProperties3); shape3.Append(textBody3); Shape shape4 = new Shape(); NonVisualShapeProperties nonVisualShapeProperties4 = new NonVisualShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties5 = new NonVisualDrawingProperties() { Id = (UInt32Value)5U, Name = "Slide Number Placeholder 4" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList4 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension4 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement4 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{B30BB125-185A-4706-BD59-793EEE2C8B8C}\" />"); nonVisualDrawingPropertiesExtension4.Append(openXmlUnknownElement4); nonVisualDrawingPropertiesExtensionList4.Append(nonVisualDrawingPropertiesExtension4); nonVisualDrawingProperties5.Append(nonVisualDrawingPropertiesExtensionList4); NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties4 = new NonVisualShapeDrawingProperties(); A.ShapeLocks shapeLocks4 = new A.ShapeLocks() { NoGrouping = true }; nonVisualShapeDrawingProperties4.Append(shapeLocks4); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties5 = new ApplicationNonVisualDrawingProperties(); PlaceholderShape placeholderShape4 = new PlaceholderShape() { Type = PlaceholderValues.SlideNumber, Size = PlaceholderSizeValues.Quarter, Index = (UInt32Value)3U }; applicationNonVisualDrawingProperties5.Append(placeholderShape4); nonVisualShapeProperties4.Append(nonVisualDrawingProperties5); nonVisualShapeProperties4.Append(nonVisualShapeDrawingProperties4); nonVisualShapeProperties4.Append(applicationNonVisualDrawingProperties5); ShapeProperties shapeProperties4 = new ShapeProperties(); A.Transform2D transform2D4 = new A.Transform2D(); A.Offset offset5 = new A.Offset() { X = 3849688L, Y = 9378950L }; A.Extents extents5 = new A.Extents() { Cx = 2946400L, Cy = 495300L }; transform2D4.Append(offset5); transform2D4.Append(extents5); A.PresetGeometry presetGeometry4 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle }; A.AdjustValueList adjustValueList4 = new A.AdjustValueList(); presetGeometry4.Append(adjustValueList4); shapeProperties4.Append(transform2D4); shapeProperties4.Append(presetGeometry4); TextBody textBody4 = new TextBody(); A.BodyProperties bodyProperties4 = new A.BodyProperties() { Vertical = A.TextVerticalValues.Horizontal, LeftInset = 91440, TopInset = 45720, RightInset = 91440, BottomInset = 45720, RightToLeftColumns = false, Anchor = A.TextAnchoringTypeValues.Bottom }; A.ListStyle listStyle4 = new A.ListStyle(); A.Level1ParagraphProperties level1ParagraphProperties5 = new A.Level1ParagraphProperties() { Alignment = A.TextAlignmentTypeValues.Right }; A.DefaultRunProperties defaultRunProperties14 = new A.DefaultRunProperties() { FontSize = 1200 }; level1ParagraphProperties5.Append(defaultRunProperties14); listStyle4.Append(level1ParagraphProperties5); A.Paragraph paragraph4 = new A.Paragraph(); A.Field field2 = new A.Field() { Id = "{409988AC-3923-45CB-9D2C-0BEBFEE96CD9}", Type = "slidenum" }; A.RunProperties runProperties2 = new A.RunProperties() { Language = "en-GB" }; runProperties2.SetAttribute(new OpenXmlAttribute("", "smtClean", "", "0")); A.Text text2 = new A.Text(); text2.Text = "‹#›"; field2.Append(runProperties2); field2.Append(text2); A.EndParagraphRunProperties endParagraphRunProperties4 = new A.EndParagraphRunProperties() { Language = "en-GB" }; paragraph4.Append(field2); paragraph4.Append(endParagraphRunProperties4); textBody4.Append(bodyProperties4); textBody4.Append(listStyle4); textBody4.Append(paragraph4); shape4.Append(nonVisualShapeProperties4); shape4.Append(shapeProperties4); shape4.Append(textBody4); shapeTree1.Append(nonVisualGroupShapeProperties1); shapeTree1.Append(groupShapeProperties1); shapeTree1.Append(shape1); shapeTree1.Append(shape2); shapeTree1.Append(shape3); shapeTree1.Append(shape4); CommonSlideDataExtensionList commonSlideDataExtensionList1 = new CommonSlideDataExtensionList(); CommonSlideDataExtension commonSlideDataExtension1 = new CommonSlideDataExtension() { Uri = "{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}" }; P14.CreationId creationId1 = new P14.CreationId() { Val = (UInt32Value)1485009629U }; creationId1.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main"); commonSlideDataExtension1.Append(creationId1); commonSlideDataExtensionList1.Append(commonSlideDataExtension1); commonSlideData1.Append(background1); commonSlideData1.Append(shapeTree1); commonSlideData1.Append(commonSlideDataExtensionList1); ColorMap colorMap1 = new ColorMap() { Background1 = A.ColorSchemeIndexValues.Light1, Text1 = A.ColorSchemeIndexValues.Dark1, Background2 = A.ColorSchemeIndexValues.Light2, Text2 = A.ColorSchemeIndexValues.Dark2, Accent1 = A.ColorSchemeIndexValues.Accent1, Accent2 = A.ColorSchemeIndexValues.Accent2, Accent3 = A.ColorSchemeIndexValues.Accent3, Accent4 = A.ColorSchemeIndexValues.Accent4, Accent5 = A.ColorSchemeIndexValues.Accent5, Accent6 = A.ColorSchemeIndexValues.Accent6, Hyperlink = A.ColorSchemeIndexValues.Hyperlink, FollowedHyperlink = A.ColorSchemeIndexValues.FollowedHyperlink }; handoutMaster1.Append(commonSlideData1); handoutMaster1.Append(colorMap1); handoutMasterPart1.HandoutMaster = handoutMaster1; }
private static void GenerateSlidePart1Content(SlidePart slidePart1, string Title, string SubTitle) { Slide slide1 = new Slide(); slide1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main"); slide1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); slide1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main"); CommonSlideData commonSlideData1 = new CommonSlideData(); ShapeTree shapeTree1 = new ShapeTree(); NonVisualGroupShapeProperties nonVisualGroupShapeProperties1 = new NonVisualGroupShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties1 = new NonVisualDrawingProperties() { Id = (UInt32Value)1U, Name = "" }; NonVisualGroupShapeDrawingProperties nonVisualGroupShapeDrawingProperties1 = new NonVisualGroupShapeDrawingProperties(); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties1 = new ApplicationNonVisualDrawingProperties(); nonVisualGroupShapeProperties1.Append(nonVisualDrawingProperties1); nonVisualGroupShapeProperties1.Append(nonVisualGroupShapeDrawingProperties1); nonVisualGroupShapeProperties1.Append(applicationNonVisualDrawingProperties1); GroupShapeProperties groupShapeProperties1 = new GroupShapeProperties(); A.TransformGroup transformGroup1 = new A.TransformGroup(); A.Offset offset1 = new A.Offset() { X = 0L, Y = 0L }; A.Extents extents1 = new A.Extents() { Cx = 0L, Cy = 0L }; A.ChildOffset childOffset1 = new A.ChildOffset() { X = 0L, Y = 0L }; A.ChildExtents childExtents1 = new A.ChildExtents() { Cx = 0L, Cy = 0L }; transformGroup1.Append(offset1); transformGroup1.Append(extents1); transformGroup1.Append(childOffset1); transformGroup1.Append(childExtents1); groupShapeProperties1.Append(transformGroup1); Shape shape1 = new Shape(); NonVisualShapeProperties nonVisualShapeProperties1 = new NonVisualShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties2 = new NonVisualDrawingProperties() { Id = (UInt32Value)4U, Name = "タイトル 3" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList1 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension1 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement1 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{D363C360-A613-482D-ABFE-96D29918ABD2}\" />"); nonVisualDrawingPropertiesExtension1.Append(openXmlUnknownElement1); nonVisualDrawingPropertiesExtensionList1.Append(nonVisualDrawingPropertiesExtension1); nonVisualDrawingProperties2.Append(nonVisualDrawingPropertiesExtensionList1); NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties1 = new NonVisualShapeDrawingProperties(); A.ShapeLocks shapeLocks1 = new A.ShapeLocks() { NoGrouping = true }; nonVisualShapeDrawingProperties1.Append(shapeLocks1); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties2 = new ApplicationNonVisualDrawingProperties(); PlaceholderShape placeholderShape1 = new PlaceholderShape() { Type = PlaceholderValues.CenteredTitle }; applicationNonVisualDrawingProperties2.Append(placeholderShape1); nonVisualShapeProperties1.Append(nonVisualDrawingProperties2); nonVisualShapeProperties1.Append(nonVisualShapeDrawingProperties1); nonVisualShapeProperties1.Append(applicationNonVisualDrawingProperties2); ShapeProperties shapeProperties1 = new ShapeProperties(); TextBody textBody1 = new TextBody(); A.BodyProperties bodyProperties1 = new A.BodyProperties(); A.ListStyle listStyle1 = new A.ListStyle(); A.Paragraph paragraph1 = new A.Paragraph(); A.Run run1 = new A.Run(); A.RunProperties runProperties1 = new A.RunProperties() { Kumimoji = true, Language = "ja-JP", AlternativeLanguage = "en-US", Dirty = false }; A.Text text1 = new A.Text(); text1.Text = Title; run1.Append(runProperties1); run1.Append(text1); paragraph1.Append(run1); textBody1.Append(bodyProperties1); textBody1.Append(listStyle1); textBody1.Append(paragraph1); shape1.Append(nonVisualShapeProperties1); shape1.Append(shapeProperties1); shape1.Append(textBody1); Shape shape2 = new Shape(); NonVisualShapeProperties nonVisualShapeProperties2 = new NonVisualShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties3 = new NonVisualDrawingProperties() { Id = (UInt32Value)5U, Name = "字幕 4" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList2 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension2 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement2 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{6CE3DF81-72AF-4DA1-B4EE-02B2D45D0AF8}\" />"); nonVisualDrawingPropertiesExtension2.Append(openXmlUnknownElement2); nonVisualDrawingPropertiesExtensionList2.Append(nonVisualDrawingPropertiesExtension2); nonVisualDrawingProperties3.Append(nonVisualDrawingPropertiesExtensionList2); NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties2 = new NonVisualShapeDrawingProperties(); A.ShapeLocks shapeLocks2 = new A.ShapeLocks() { NoGrouping = true }; nonVisualShapeDrawingProperties2.Append(shapeLocks2); ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties3 = new ApplicationNonVisualDrawingProperties(); PlaceholderShape placeholderShape2 = new PlaceholderShape() { Type = PlaceholderValues.SubTitle, Index = (UInt32Value)1U }; applicationNonVisualDrawingProperties3.Append(placeholderShape2); nonVisualShapeProperties2.Append(nonVisualDrawingProperties3); nonVisualShapeProperties2.Append(nonVisualShapeDrawingProperties2); nonVisualShapeProperties2.Append(applicationNonVisualDrawingProperties3); ShapeProperties shapeProperties2 = new ShapeProperties(); TextBody textBody2 = new TextBody(); A.BodyProperties bodyProperties2 = new A.BodyProperties(); A.ListStyle listStyle2 = new A.ListStyle(); A.Paragraph paragraph2 = new A.Paragraph(); A.Run run2 = new A.Run(); A.RunProperties runProperties2 = new A.RunProperties() { Kumimoji = true, Language = "ja-JP", AlternativeLanguage = "en-US" }; A.Text text2 = new A.Text(); text2.Text = SubTitle; run2.Append(runProperties2); run2.Append(text2); paragraph2.Append(run2); textBody2.Append(bodyProperties2); textBody2.Append(listStyle2); textBody2.Append(paragraph2); shape2.Append(nonVisualShapeProperties2); shape2.Append(shapeProperties2); shape2.Append(textBody2); shapeTree1.Append(nonVisualGroupShapeProperties1); shapeTree1.Append(groupShapeProperties1); shapeTree1.Append(shape1); shapeTree1.Append(shape2); CommonSlideDataExtensionList commonSlideDataExtensionList1 = new CommonSlideDataExtensionList(); CommonSlideDataExtension commonSlideDataExtension1 = new CommonSlideDataExtension() { Uri = "{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}" }; P14.CreationId creationId1 = new P14.CreationId() { Val = (UInt32Value)958156500U }; creationId1.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main"); commonSlideDataExtension1.Append(creationId1); commonSlideDataExtensionList1.Append(commonSlideDataExtension1); commonSlideData1.Append(shapeTree1); commonSlideData1.Append(commonSlideDataExtensionList1); ColorMapOverride colorMapOverride1 = new ColorMapOverride(); A.MasterColorMapping masterColorMapping1 = new A.MasterColorMapping(); colorMapOverride1.Append(masterColorMapping1); slide1.Append(commonSlideData1); slide1.Append(colorMapOverride1); slidePart1.Slide = slide1; }
//private void AddContent(ShapeTree shapeTree1, uint ObjectID, PPTXTextArea Content, PlaceholderValues PlaceHolderType, uint PlaceHolderIndex = uint.MaxValue) //{ // Shape shape1 = new Shape(); // NonVisualShapeProperties nonVisualShapeProperties1 = new NonVisualShapeProperties(); // NonVisualDrawingProperties nonVisualDrawingProperties2 = new NonVisualDrawingProperties() { Id = ObjectID, Name = $"Content{ObjectID}" }; // NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties1 = new NonVisualShapeDrawingProperties() { TextBox = true}; // A.ShapeLocks shapeLocks1 = new A.ShapeLocks() { NoGrouping = true }; // nonVisualShapeDrawingProperties1.Append(shapeLocks1); // ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties2 = new ApplicationNonVisualDrawingProperties(); // PlaceholderShape placeholderShape1 = new PlaceholderShape();// { Type = PlaceHolderType }; // if (PlaceHolderIndex != uint.MaxValue) // { // placeholderShape1.Index = PlaceHolderIndex; // } // applicationNonVisualDrawingProperties2.Append(placeholderShape1); // nonVisualShapeProperties1.Append(nonVisualDrawingProperties2); // nonVisualShapeProperties1.Append(nonVisualShapeDrawingProperties1); // nonVisualShapeProperties1.Append(applicationNonVisualDrawingProperties2); // ShapeProperties shapeProperties1 = new ShapeProperties(); // A.SolidFill solidFill1 = new A.SolidFill(); // A.SchemeColor schemeColor1 = new A.SchemeColor() { Val = A.SchemeColorValues.Accent1 }; // A.LuminanceModulation luminanceModulation1 = new A.LuminanceModulation() { Val = 20000 }; // A.LuminanceOffset luminanceOffset1 = new A.LuminanceOffset() { Val = 80000 }; // schemeColor1.Append(luminanceModulation1); // schemeColor1.Append(luminanceOffset1); // solidFill1.Append(schemeColor1); // shapeProperties1.Append(solidFill1); // TextBody textBody1 = new TextBody(); // A.BodyProperties bodyProperties1 = new A.BodyProperties(); // A.ListStyle listStyle1 = new A.ListStyle(); // textBody1.Append(bodyProperties1); // textBody1.Append(listStyle1); // A.Transform2D transform2D25 = SlideWriterHelper.CreateTransform2D(Content.Transform); // if (transform2D25 != null) // { // shapeProperties1.Append(transform2D25); // } // shape1.Append(nonVisualShapeProperties1); // shape1.Append(shapeProperties1); // shape1.Append(textBody1); // foreach (var _textLine in Content.Texts) // { // var paragraph = new A.Paragraph(SlideWriterHelper.CrateParagraphProperties(_textLine)); // foreach(var _textRun in _textLine.Texts) // { // paragraph.Append(new A.Run() // { // RunProperties = SlideWriterHelper.CreateRunProperties(_textRun, HyperLinkIDMap), // Text = new A.Text(_textRun.Text) // }); // } // shape1.TextBody.Append(paragraph); // } // shapeTree1.Append(shape1); //} private void AddTextBox(ShapeTree shapeTree1, uint ObjectID, PPTXTextArea Content) { Shape shape1 = new Shape(); NonVisualShapeProperties nonVisualShapeProperties1 = new NonVisualShapeProperties(); NonVisualDrawingProperties nonVisualDrawingProperties2 = new NonVisualDrawingProperties() { Id = ObjectID, Name = $"Content{ObjectID}" }; A.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList1 = new A.NonVisualDrawingPropertiesExtensionList(); A.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension1 = new A.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }; OpenXmlUnknownElement openXmlUnknownElement1 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{5FE2CA47-E73A-450F-9AE0-DF438874E2FB}\" />"); nonVisualDrawingPropertiesExtension1.Append(openXmlUnknownElement1); nonVisualDrawingPropertiesExtensionList1.Append(nonVisualDrawingPropertiesExtension1); nonVisualDrawingProperties2.Append(nonVisualDrawingPropertiesExtensionList1); NonVisualShapeDrawingProperties nonVisualShapeDrawingProperties1 = new NonVisualShapeDrawingProperties() { TextBox = true }; ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties2 = new ApplicationNonVisualDrawingProperties(); nonVisualShapeProperties1.Append(nonVisualDrawingProperties2); nonVisualShapeProperties1.Append(nonVisualShapeDrawingProperties1); nonVisualShapeProperties1.Append(applicationNonVisualDrawingProperties2); ShapeProperties shapeProperties1 = new ShapeProperties(); A.PresetGeometry presetGeometry1 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle }; A.AdjustValueList adjustValueList1 = new A.AdjustValueList(); presetGeometry1.Append(adjustValueList1); TextBody textBody1 = new TextBody(); A.BodyProperties bodyProperties1 = new A.BodyProperties(); A.ListStyle listStyle1 = new A.ListStyle(); textBody1.Append(bodyProperties1); textBody1.Append(listStyle1); A.Transform2D transform2D25 = SlideWriterHelper.CreateTransform2D(Content.Transform); if (transform2D25 != null) { shapeProperties1.Append(transform2D25); } shapeProperties1.Append(presetGeometry1); if (Content.BackgroundColor.IsTransparent == false) { A.SolidFill solidFill1 = new A.SolidFill(); solidFill1.Append(SlideWriterHelper.CreateRGBColorModeHex(Content.BackgroundColor)); shapeProperties1.Append(solidFill1); } shape1.Append(nonVisualShapeProperties1); shape1.Append(shapeProperties1); shape1.Append(textBody1); foreach (var _textLine in Content.Texts) { var paragraph = new A.Paragraph(SlideWriterHelper.CrateParagraphProperties(_textLine)); foreach (var _textRun in _textLine.Texts) { paragraph.Append(new A.Run() { RunProperties = SlideWriterHelper.CreateRunProperties(_textRun, HyperLinkIDMap), Text = new A.Text(_textRun.Text) }); } shape1.TextBody.Append(paragraph); } shapeTree1.Append(shape1); }