Wed Jan 02, 2019 1:13 pm
Below is the Html :-
<div><div><div><div><div><div><div><div><div><span style="text-decoration: underline;">The One Thing:-</span></div><div><br></div><div><br></div><div><span style="text-decoration: underline;">Hero Experiences:-</span></div><div><br></div><div><br></div><div><span style="text-decoration: underline;">Feature Specs:-</span></div><div><div><div><div><div><div><div><div><div>test cxvdsvdvdfvdfv</div><table style="width: 100%;"><tbody><tr><td style="width: 33.3333%;">ttt</td><td style="width: 33.3333%;">tttt</td><td style="width: 33.3333%;">ttttt</td></tr><tr><td style="width: 33.3333%;">tttt</td><td style="width: 33.3333%;">tttt</td><td style="width: 33.3333%;">tttt</td></tr><tr><td>errgegb</td><td>bfdbfbffg fg fg n g</td><td>bbbbbb</td></tr></tbody></table><p><br></p><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
Sample Code:-
Presentation ppt = new Presentation();
IMasterSlide master = ppt.Masters[0];
ppt.SlideSize.Type = SlideSizeType.Screen16x9;
//ppt.SlideSize.Size = new SizeF(1200, 800);
ISlide slide = ppt.Slides[0];
SizeF pptSize = ppt.SlideSize.Size;
#region Program Name and desc in Header
IAutoShape shapeProgCodeName = master.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(2, 8, 500, 21));
shapeProgCodeName.AppendTextFrame("test");
shapeProgCodeName.ShapeStyle.LineColor.Color = Color.White;
shapeProgCodeName.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.None;
shapeProgCodeName.Fill.SolidColor.Color = Color.White;
TextRange textRangeProgCode = shapeProgCodeName.TextFrame.TextRange; textRangeProgCode.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
textRangeProgCode.Fill.SolidColor.Color = Color.FromArgb(12, 126, 217);
textRangeProgCode.FontHeight = 24;
textRangeProgCode.LatinFont = new TextFont("Segoe UI Light");
textRangeProgCode.Paragraph.Alignment = TextAlignmentType.Left;
IAutoShape shapeProgDesc = master.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(2, 40, 500, 18));
shapeProgDesc.AppendTextFrame("testData1");
shapeProgDesc.ShapeStyle.LineColor.Color = Color.White;
shapeProgDesc.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.None;
shapeProgDesc.Fill.SolidColor.Color = Color.White;
TextRange textRangeProgDesc = shapeProgDesc.TextFrame.TextRange;
textRangeProgDesc.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
textRangeProgDesc.Fill.SolidColor.Color = Color.FromArgb(12, 126, 217);
textRangeProgDesc.FontHeight = 12;
textRangeProgDesc.IsItalic = TriState.True;
textRangeProgDesc.LatinFont = new TextFont("Segoe UI Light");
textRangeProgDesc.Paragraph.Alignment = TextAlignmentType.Left;
#endregion
float intKeyHeight = pptSize.Height - 80;
float[] widths = { pptSize.Width / 2 };
float[] heights = { intKeyHeight - 50 };
string objHtml = "<div>cxvdsvdvdfvdfv</div><div><br></div><div><br></div><table><tbody><tr><td>ttt</td><td>tttt</td><td>ttttt</td></tr><tr><td>tttt</td><td>tttt</td><td>tttt</td></tr><tr><td>errgegb</td><td>bfdbfbffg fg fg n g</td><td>bbbbbb</td></tr></tbody></table>";
ShapeList shapes = ppt.Slides[0].Shapes;
shapes.AddFromHtml(objHtml);
foreach (IShape objshape in shapes)
{
if (objshape.Name == "New Table")
{
ITable objShape1 = (ITable)objshape;
objShape1.StylePreset = TableStylePreset.None;
}
objshape.Width = widths[0];
objshape.Fill.Pattern.BackgroundColor.Color = Color.Blue;
}