We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF cell padding not effected

Hi,

I set the Margin as below,

margin.setTop(0f);

table.setDefaultCellPadding(margin);

But the cell padding in PDF is also not effected.



And another question, the method cell.setRowSpan is not work property.



Thanks.

rayychoi:
Hi,
I set the Margin as below,
margin.setTop(0f);
table.setDefaultCellPadding(margin);
But the cell padding in PDF is also not effected.
Hi Rayy,

Thanks for contacting support and sorry for the delayed response.

I have tested the scenario using Aspose.Pdf for Java 4.1.0 while using following code snippet over Windows 7 (X64) where I have JDK 1.7_09 installed over my machine and I am unable to notice any issue. The Cell padding information is properly being applied. For your reference, I have also attached the resultant PDF which is generated over my end.

[Java]

Pdf pdf1 = new Pdf();<o:p></o:p>

Section sec1 = pdf1.getSections().add();

aspose.pdf.Table table1 = new aspose.pdf.Table();

sec1.getParagraphs().add(table1);

table1.setColumnWidths("70 2cm");

aspose.pdf.MarginInfo margin = new aspose.pdf.MarginInfo();

margin.setTop(15);

table1.setDefaultCellPadding(margin);

aspose.pdf.Row row1 = table1.getRows().add();

aspose.pdf.Cell cell1Row1 = row1.getCells().add("ColumnsSpan = 2");

cell1Row1.setColumnsSpan(2);

cell1Row1.setBorder(new aspose.pdf.BorderInfo(aspose.pdf.BorderSide.All.getValue(), 0.5F));

aspose.pdf.Row row2 = table1.getRows().add();

aspose.pdf.Cell cell1Row2 = row2.getCells().add("cell1");

cell1Row2.setBorder(new aspose.pdf.BorderInfo(aspose.pdf.BorderSide.All.getValue(), 0.5F));

aspose.pdf.Cell cell2Row2 = row2.getCells().add("cell2");

cell2Row2.setBorder(new aspose.pdf.BorderInfo(aspose.pdf.BorderSide.All.getValue(), 0.5F, new aspose.pdf.Color("Red")));

pdf1.save(“c:/pdftest/setDefaultCellPadding_Test.pdf”);


rayychoi:
the method cell.setRowSpan is not work property.
The setRowSpan(…) method is properly working. Can you please share the code snippet which you are using so that we can test the scenario at our end. We are sorry for this inconvenience.