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

Free Support Forum - aspose.com

Remove border of row of existing pdf table


I am working on manipulating existing PDF table, and want to remove the border of the first row of each table.
For a newly created table we can alter table border using :
table.setBorder(new BorderInfo(BorderSide.All, 1F));

But for an AbsorbedTable/AbsorbedRow etc how can we remove border?
Below is my code snippet for getting table, rows and redacting select area.

public void identifyTables(@NonNull Document document, Map<String,String> tableKeyWords){

        TableAbsorber absorber = null;
        PdfAnnotationEditor editor = new PdfAnnotationEditor();

        for(int i = 1; i <= document.getPages().size(); i++) {// loop through pages
            System.out.println(" ******** Page : " +  i + " **********");
            absorber = new TableAbsorber();
            for(int j = 0; j < absorber.getTableList().size(); j++) { // loop through tables
                System.out.println(" ******* Table number : " + j + " *******");
                for (AbsorbedRow row : absorber.getTableList().get_Item(j).getRowList()) { // loop through rows
                    editor.redactArea(i, row.getRectangle(), Color.WHITE);


Thank you for contacting support.

If you want to remove the border line only then we are afraid AbsorbedTable or AbsorbedRow class may not detect the lines on the page. Only textual information can be manipulated from a table on existing PDF document. Moreover, your code snippet will be redacting the whole area returned by row.getRectangle() so this approach may neither work.

1 Like