Issue : We are using Aspose.pdf library for generating pdf reports, we are seeing thick/uneven cell borders at random places on pdf.
Library Details : aspose.pdf-19.2.jar
Sample Code:
import com.aspose.pdf.BorderInfo;
import com.aspose.pdf.BorderSide;
import com.aspose.pdf.Color;
import com.aspose.pdf.Document;
import com.aspose.pdf.MarginInfo;
import com.aspose.pdf.Row;
import com.aspose.pdf.Table;
public class ThickBorderIssue {
public static void main(String[] args) {
Document doc = new Document();
doc.getPages().add();
doc.getPages().get_Item(1).getPageInfo().setLandscape(true);
Table table = new Table();
doc.getPages().get_Item(1).getParagraphs().add(table);
table.setColumnWidths("50 50 50");
table.setDefaultCellBorder(new BorderInfo(BorderSide.All, 0.05F));
table.setBorder(new BorderInfo(BorderSide.All, 0.05F));
MarginInfo margin = new MarginInfo();
margin.setLeft(5f);
margin.setRight(5f);
margin.setTop(5f);
margin.setBottom(5f);
table.setDefaultCellPadding(margin);
table.setRepeatingRowsCount(1);
Row row1 = table.getRows().add();
row1.setBackgroundColor(Color.getGreen());
row1.getCells().add("col1");
row1.getCells().add("col2");
row1.getCells().add("col3");
row1.getCells().add("col1");
row1.getCells().add("col2");
row1.getCells().add("col3");
for (int i = 0; i < 100; i++) {
Row row = table.getRows().add();
row.getCells().add("item " + i);
row.getCells().add("item " + i);
row.getCells().add("item " + i);
row.getCells().add("item " + i);
row.getCells().add("item " + i);
row.getCells().add("item " + i);
}
// Save the PDF document
doc.save("ThickBorderIssue.pdf");
}
}