I have a table, but the default internal margin for a textbox (left, right, top, bottom) is too large. How can I set it to all to 0 or smaller. Thanks.
Dear John,
Thanks for considering Aspose.
TextFrame has the properties for margins like
TextFrame.set/getMarginLeft()
TextFrame.set/getMarginRight()
TextFrame.set/getMarginTop()
TextFrame.set/getMarginBottom()
Use them to set the internal margin. Please see code example below in JAVA and also see its source and output presentation.
JAVA
//Read the source presentation
FileInputStream fin = new FileInputStream("c:/source.ppt");
Presentation srcPres = new Presentation(fin);
//Get the first slide
Slide sld = srcPres.getSlideByPosition(1);
//Get the table
Table tbl = (Table) sld.getShapes().get(0);
//Iterate all the cells and set the left margin to 0
for (int i = 0; i < tbl.getColumnsNumber(); i++) {
for (int j = 0; j < tbl.getRowsNumber(); j++) {
Cell cell = tbl.getCell(i, j);
TextFrame tf = cell.getTextFrame();
tf.setMarginLeft(0);
}
}
//Write the presentation on disk
FileOutputStream fout = new FileOutputStream("C:/output.ppt");
srcPres.write(fout);