Hi,
I am using Aspose.Words for Java, when I wanted to set CellSpacing for Table, MS Word looks fine, but PDF doesn’t support CellSpacing. Is it a defect of Aspose?
My testing codes:
import java.awt.Color;
import com.aspose.words.Cell;
import com.aspose.words.DocumentBuilder;
import com.aspose.words.LineStyle;
import com.aspose.words.Table;
public class TestAsposeCellSpacing {
public static void main( String []argv ) throws Exception{
DocumentBuilder docBuilder = new DocumentBuilder();
docBuilder.clearRunAttrs();
//begin table
Table table = docBuilder.startTable();
docBuilder.getCellFormat().clearFormatting();
docBuilder.getRowFormat().clearFormatting();
docBuilder.insertCell();
docBuilder.write( "A" );
docBuilder.getCellFormat().getBorders().setColor( Color.BLACK );
docBuilder.getCellFormat().getBorders().setLineWidth( 1 );
docBuilder.getCellFormat().getBorders().setLineStyle( LineStyle.SINGLE );
docBuilder.getRowFormat().setCellSpacing( 10.0 );
//End - 1st Row
docBuilder.endRow();
docBuilder.insertCell();
docBuilder.write( "B" );
docBuilder.getCellFormat().getBorders().setColor( Color.BLACK );
docBuilder.getCellFormat().getBorders().setLineWidth( 1 );
docBuilder.getCellFormat().getBorders().setLineStyle( LineStyle.SINGLE );
docBuilder.getRowFormat().setCellSpacing( 10.0 );
//End - 1st Row
docBuilder.endRow();
// End Table
docBuilder.endTable();
docBuilder.getDocument().save( "C:\testCellSpacing.doc" );
// docBuilder.getDocument().updateTableLayout();
docBuilder.getDocument().save( "C:\testCellSpacing.pdf" );
}
}
Thanks,
Feng