Hi,
I am trying to include 2 empty lines before the text in a table cell, but they are not rendered.
If I have the 2 empty lines interlaced in the text, they are rendered correctly.
Please also see the attached screenshots of the PPTX output. (in the 2nd file the 2 empty lines were placed in the same cells, but they weren’t visible after the output.)
Can you please advise why the 2 empty lines from the cell are not rendered if they are placed in front of the text?
Thanks!
Hi Oana,
I have worked over the requirements shared by you. Please use the following code snippet on your end. Moreover, I have also shared the generated PPTX and thumbnail for your kind reference as well.
String path = @"…";PresentationEx pres = new PresentationEx();//Access first slideSlideEx sld = pres.Slides[0];//Define columns with widths and rows with heightsdouble[] dblCols = { 100, 100};double[] dblRows = { 100, 100 };//Add table shape to slideint idx = sld.Shapes.AddTable(100, 50, dblCols, dblRows);TableEx tbl = (TableEx)sld.Shapes[idx];//Add text to the merged celltbl[0, 0].TextFrame.Text = " ";TextFrameEx tf = tbl[0, 0].TextFrame;tf.Paragraphs[0].Text = “\n\n” + “Test Cell1”;//Add text to the merged celltbl[1, 0].TextFrame.Text = " ";TextFrameEx tf2 = tbl[1, 0].TextFrame;tf2.Paragraphs[0].Text = “\n\n” + “Test Cell2”;Bitmap bmp = sld.GetThumbnail(1f, 1f);bmp.Save(path+“Table.jpg”, System.Drawing.Imaging.ImageFormat.Jpeg);//Write PPTX to Diskpres.Write(path+“table.pptx”);
Many Thanks,
Thank you!
Oana