Hi,
We are using Aspose version 13.5.0.0 to generate Word and PDF outputs.
When any of the cell has very long word, table does not fit to window and some of the columns may not be visible in the document.
Please see the standalone program below which will help in reproducing the issue. In this program the second cell has a very long word.
Issue can be seen for both word and pdf. Kindly let us know if there is any way to wrap the text and fit table in Window if very long words are present in output.
Thanks & Regards,
Shikha
public static void main(String[] args) throws Exception
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
License license = new License();
license.setLicense("Aspose.Words.lic");
System.out.println("Aspose product and version is = " + BuildVersionInfo.getProduct() + " : " + BuildVersionInfo.getVersion());
builder.insertCell();
builder.getCellFormat().setHorizontalMerge(CellMerge.FIRST);
builder.write("Heading one");
builder.insertCell();
// This cell is merged to the previous and should be empty.
builder.getCellFormat().setHorizontalMerge(CellMerge.NONE);
builder.write("Heading twommmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm");
builder.insertCell();
// This cell is merged to the previous and should be empty.
builder.getCellFormat().setHorizontalMerge(CellMerge.NONE);
builder.write("Heading three");
builder.insertCell();
// This cell is merged to the previous and should be empty.
builder.getCellFormat().setHorizontalMerge(CellMerge.NONE);
builder.write("Heading four");
builder.insertCell();
// This cell is merged to the previous and should be empty.
builder.getCellFormat().setHorizontalMerge(CellMerge.NONE);
builder.write("Heading five");
builder.endRow();
try
{
doc.save("C:\t1.doc");
}
catch (Exception e)
{
System.out.println("Word Save: " + e.getMessage());
}
try
{
doc.save("C:\t1.pdf");
}
catch (Exception e)
{
System.out.println("PDF Save: " + e.getMessage());
}
System.out.println("done");
}