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

Free Support Forum - aspose.com

Pdf api


Can you please help me to find out API to wrap the content in PDF cell? I have created table in PDF, but the content is getting displayed out of the cell. Also I need to wrap the text into the cell when it exceeds.

I am using 2.5.0 version, in which wrapping not happening automatically.

Hello Balamohan,

I have tested the scenario using following code snippet and as per my observations, the text inside table cell is automatically wrapped to next lines. Can you please take a look over the following code snippet. I have also attached the resultant PDF document for your reference.


//Instantiate a Pdf object by calling its empty constructor
Pdf pdf1 = new Pdf();
//Create a section in the Pdf object
Section sec1 = pdf1.getSections().add();

aspose.pdf.Table table1 = new aspose.pdf.Table();
table1.setColumnWidths("70 2cm");
Row row1 = table1.getRows().add();
Cell cell1Row1 = row1.getCells().add("Text in this cell is spanning");
cell1Row1.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F));

// save the PDF file

PS, I have tested with Aspose.Pdf for Java 2.5.0