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

Free Support Forum - aspose.com

Table border graphical artefacts

Hi,


is there a way how to force the border of the table to be rendered correctly? On some of the rows the border is different than on other rows in the same table. The same behaviour can be seen in your SDK samples:

<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”;”>public static void addTableInExistingPDFDocument(String dataDir) {
// Load source PDF document
Document doc = new Document(“input.pdf”);
// Initializes a new instance of the Table
Table table = new Table();
// Set the table border color as LightGray
table.setBorder(new BorderInfo(BorderSide.All, .5f, Color.getLightGray()));
// set the border for table cells
table.setDefaultCellBorder(new BorderInfo(BorderSide.All, .5f, Color.getLightGray()));
// create a loop to add 10 rows
for (int row_count = 1; row_count < 10; row_count++) {
// add row to table
Row row = table.getRows().add();
// add table cells
row.getCells().add(“Column (” + row_count + “, 1)”);
row.getCells().add(“Column (” + row_count + “, 2)”);
row.getCells().add(“Column (” + row_count + “, 3)”);
}
// Add table object to first page of input document
doc.getPages().get_Item(1).getParagraphs().add(table);
// Save updated document containing table object
doc.save(“document_with_table.pdf”);
}



Hi,

Thanks for contacting support.

Adding more to Imran's comments, I have also tested the scenario using Aspose.Pdf for Java 17.4 in Eclipse Juno project running over Windows 10 (x64) and I am unable to notice any issue. As per my observations, the border of table rows/cells is properly appearing. For your reference, I have also attached the output generated over my end. Can you please share some details regarding the version of API which you are using and some details regarding your working environment i.e. Operating System, JDK version etc. This information will help us in further investigating the issue.

Please note that for testing purposes, I have created a PDF document from scratch. Can you please test this scenario and in case you are facing issue related to specific document, please share the input file. We are sorry for this inconvenience.

[Java]

// Load source PDF document

Document doc = new Document();

doc.getPages().add();

// Initializes a new instance of the Table

com.aspose.pdf.Table table = new com.aspose.pdf.Table();

// Set the table border color as LightGray

table.setBorder(new BorderInfo(BorderSide.All, .5f, Color.getLightGray()));

// set the border for table cells

table.setDefaultCellBorder(new BorderInfo(BorderSide.All, .5f, Color.getLightGray()));

// create a loop to add 10 rows

for (int row_count = 1; row_count < 10; row_count++) {

// add row to table

com.aspose.pdf.Row row = table.getRows().add();

// add table cells

row.getCells().add("Column (" + row_count + ", 1)");

row.getCells().add("Column (" + row_count + ", 2)");

row.getCells().add("Column (" + row_count + ", 3)");

}

// Add table object to first page of input document

doc.getPages().get_Item(1).getParagraphs().add(table);

// Save updated document containing table object

doc.save("c:/pdftest/document_with_table.pdf");

Hi,


the pdf you attached has the same problem. It is probably dependant on viewer used. I am using Adobe ACrobat Reader DC 2017.009.20044. When I use chrome or foxit reader the table in your document (as well as mine) has same border.

I have attached picture of your document in said acrobat reader.

Hi,


Thanks for sharing the details.

I have again tried viewing the PDF file in Adobe Acrobat Reader DC 2017.009.20044 and did not notice any issue related to border. Can you please share some further details i.e. Zoom factor at which you are viewing the file, specific operating system etc, which can help us in reproducing the issue in our environment.

For your reference, I have also attached the image showing PDF display behavior. We are sorry for this inconvenience.

Zoom factor is e.g. 175% (as can be seen from the picture I sent last time). OS is Windows 10 EN. So far we have tried the pdf on 4 computers and all have problems with borders in most possible zoom levels. Do you have some idea what I can try?

Hi,

Thanks for sharing the details.

I have also managed to notice that when viewing the file at 175% zoom factor, the border for some rows is rendering different as compared to other rows. However it appears to be a PDF viewer related issue. But for the sake of further investigation, I have logged it as PDFJAVA-36747 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan