Hi Support Team,
Hi Ankit,
Hi
Ankit777: This is happening when I set
table.setColumnAdjustment(ColumnAdjustmentType.AutofitToContent);
if I do it
table.setColumnAdjustment(ColumnAdjustmentType.Customized);
Hi Ankit,
Thanks for sharing the details.
I have tested the scenario using Aspose.Pdf for Java 3.3.0 and I am unable to notice any issue while generating the PDF file. I have tested the scenario over Windows 7 (X64) where I have used JDK 1.7. I have used the following code snippet to test the scenario. Can you please try using the latest release version and in case the problem still persists, please feel free to contact.
[Java]
Pdf pdf1 = new Pdf();
Section sec1 = pdf1.getSections().add();
aspose.pdf.Table table1 = new aspose.pdf.Table();
sec1.getParagraphs().add(table1);
table1.setColumnWidths("70 2cm");
table1.setColumnAdjustment(ColumnAdjustmentType.Customized);
Row row1 = table1.getRows().add();
Cell cell1Row1 = row1.getCells().add("ColumnsSpan = 2");
cell1Row1.setColumnsSpan(2);
cell1Row1.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F));
Row row2 = table1.getRows().add();
Cell cell1Row2 = row2.getCells().add("cell1");
cell1Row2.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F));
Cell cell2Row2 = row2.getCells().add("cell2");
cell2Row2.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F, new aspose.pdf.Color("Red")));
Section sec2 = pdf1.getSections().add();
aspose.pdf.Table table2 = new aspose.pdf.Table();
sec2.getParagraphs().add(table2);
table2.setColumnWidths("70 2cm");
table2.setColumnAdjustment(ColumnAdjustmentType.Customized);
Row row12 = table2.getRows().add();
Cell cell1Row12 = row12.getCells().add("ColumnsSpan = 2");
cell1Row12.setColumnsSpan(2);
cell1Row12.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F));
Row row22 = table2.getRows().add();
Cell cell1Row22 = row22.getCells().add("cell1");
cell1Row22.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F));
Cell cell2Row23 = row22.getCells().add("cell2");
cell2Row23.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F, new aspose.pdf.Color("Red")));
pdf1.save("c:/pdftest/Exception_Reproduce.pdf");