Can we choose to draw the cell borders inside or outside of cell

Can we select to draw the borders inside or outside? With current implementation it seems they are drawn on outside of the cell. (these are drawn the outside of given column width).

Also is there any API to collapse borders of two consecutive cells?

@BALKRUSHNA015478

Can you please explain a bit more by sharing some screenshots, code snippet and sample PDF? Please explain what type of issue you are facing actually which you think can be resolved by merging the borders of the cells? Furthermore, Table.IsBordersIncluded Property can be used to include Border Width into column width of the table.

@asad.ali Thanks, Table.IsBordersIncluded solved my first problem of drawing the borders inside column width.

For second problem, collapse the cell borders - please find attached PDFs showing the collapsing and non-collapsing cell borders.boarder_collapse.pdf (1.0 KB)
boarder_no_collapse.pdf (1.1 KB)

I want the configurable behavior like above attached pdfs.(collapse/no collapse).

Below is the aspose trial code snippet, which I am trying, and here is the generated pdf - aspose_borders_test.pdf (2.1 KB)

private static void borderCollapseTest() {
	Page page =document.getPages().add();
	PageInfo pageInfo = page.getPageInfo();	
	MarginInfo marginInfo = new MarginInfo();
	marginInfo.setBottom( 15 );
	marginInfo.setTop( 15 );
	marginInfo.setLeft( 15 );
	marginInfo.setRight( 15 );
	pageInfo.setMargin( marginInfo );
	
	Table table = new Table();
	table.setHorizontalAlignment(1);
	//table.setColumnAdjustment(ColumnAdjustment.AutoFitToContent);
	table.setColumnWidths( "50% 50%" );
	
	BorderInfo info;		
	TextFragment textFragment;
	
	//Row1
	Row pdfRow = table.getRows().add();
	pdfRow.setMinRowHeight(50);
	
	Cell cell00 = new Cell();
	info = new BorderInfo( BorderSide.All, 3f, Color.getRed() );
	cell00.setBorder( info );
	textFragment = new TextFragment("Cell00");
	cell00.getParagraphs().add(textFragment);
	cell00.setAlignment(HorizontalAlignment.Center);
	pdfRow.getCells().add(cell00);
	
	Cell cell01 = new Cell();
	info = new BorderInfo( BorderSide.All, 3f, Color.getGreen() );
	cell01.setBorder( info );
	textFragment = new TextFragment("cell01");
	cell01.getParagraphs().add(textFragment);
	cell01.setAlignment(HorizontalAlignment.Center);
	pdfRow.getCells().add(cell01);
	
	//Row2
	pdfRow = table.getRows().add();
	pdfRow.setMinRowHeight(50);
	Cell cell10 = new Cell();
	info = new BorderInfo( BorderSide.All, 3f, Color.getCyan() );
	cell10.setBorder( info );
	textFragment = new TextFragment("cell02");
	cell10.getParagraphs().add(textFragment);
	cell10.setAlignment(HorizontalAlignment.Center);
	pdfRow.getCells().add(cell10);
	
	Cell cell11 = new Cell();
	info = new BorderInfo( BorderSide.All, 3f, Color.getMagenta() );
	cell11.setBorder( info );
	textFragment = new TextFragment("cell03");
	cell11.getParagraphs().add(textFragment);
	cell11.setAlignment(HorizontalAlignment.Center);
	pdfRow.getCells().add(cell11);
	
	page.getParagraphs().add( table );
	document.save( "E:\\pdfs\\AsposeTests\\aspose_borders_test.pdf" );
	document.close();
	
}

@BALKRUSHNA015478

We need to further investigate whether your requirements of border collapsing can be achieved or not. For the purpose, we have logged an investigation ticket as PDFJAVA-40565 in our issue tracking system. We will further look into its details and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.