Whenever I use the above code, even when I declare the height as 21 or 2. I am getting the same height for each cell. Also I am not able to reduce the Table Height appearing in the PPTX(Manually).
I have tried to observe the sample code shared by you and there are some syntax issues in shared code. Also, when I execute the code I am not able to find any relevance with two sample code sections shared. I have modified the sample code and have generated the presentation.
public static void PlaceText(CellEx pptCell)
{
PresentationEx pres = new PresentationEx();
SlideEx sampleSlide = pres.Slides[0];
int index = sampleSlide.Shapes.AddAutoShape(ShapeTypeEx.Rectangle, 1, 1, 100, 100);
In your sample code where you have called PlaceText(pptCell). In the definition of PlaceText(pptCell) there is no usage of CellEx. Can you please share the complete scenario and your requirements. Please also share the generated presentation on your end.
I have observed the requirement shared by you and like to share that the minimum row height is dependent upon the font height set for the text in table row cell. You cannot set the row less than minimum row height. However, if you reduce the font height of cell the minimum row height will also get reduced. For your convenience, I have attached the modified sample code that will help you in understanding the concept.
I have tried to understand the requirement shared by you. I have used the code snippet shared above and set the font height 9 in PlaceText() method. I have been able to generate the presentation with minimum cell height that will be sufficient to accommodate text with height 9. For your reference, I have shared the generated presentation.
Thanks for your feedback. I will investigate in the mentioned area. However, I would request you to please share the sample presentation highlighting the issue along with the sample code that you have used to verify on your end. I will investigate it further to help you out.
The Issue can be identified in the TestCellIssue.pptx you have shared. I am attaching the required files for your understanding. TestCellIssueModifiedInternalMargins.pptx is the presentation for which the internal margins of the cells have been modified(Set to 0). Kindly using the same code which you have provided and let us know how to handle the Internal Margins.
Please use the following sample code to set the margin values. I have also shared the generated presentation for your kind reference. Please share, if I may help you further in this regard.