Wrap Html Text in cell

Hi,


Aspose.Pdf no wraps html text within table’s cell.

Aspose.Pdf Version: 11.5 and 11.6

Java code:

Table tablaPC = new Table();
tablaPC.setColumnWidths(“100%”);
tablaPC.setBorder(conBorde);
seccion.getParagraphs().add(tablaPC);
Row filaPC = tablaPC.getRows().add();
celdaPC = filaPC.getCells().add();
celdaPC.setAlignment(AlignmentType.Left);
celdaPC.setVerticalAlignment(VerticalAlignmentType.Top);
celdaPC.setBorder(conBorde);
celdaPC.setPadding(margen);
celdaPC.setBackgroundColor(colorBlanco);
celdaPC.setVerticalTextRotationAngle(0);
texto = new Text(politicaCancelacion);
texto.isHtmlTagSupported(true);
celdaPC.getParagraphs().add(texto);


Joined:

- pdf file generated (with Aspose.Pdf Version: 11.5)
- html text inserted into cell


Please could you fix this issue quickly? Thanks!

Hi Jerome,

Thanks for your inquriy. Please note it is recommended to use new generator (com.aspose.pdf) instead old generator(aspose.pdf), as it is more improved and efficient. It can not only generates a PDF document from scratch but manipulates existing PDF document as well. Please note old generator will be obsolete in near future, so we are not fixing issues in old generator. Please use following code snippet to add html text in table, it will help you to accomplish the task.

Furthermore, please check documentation for working with new generator(com.aspose.pdf),

com.aspose.pdf.Document doc = new com.aspose.pdf.Document();
com.aspose.pdf.Page page = doc.getPages().add();
com.aspose.pdf.Table table = new com.aspose.pdf.Table();

table.setColumnWidths("100%");

// Set default cell border using BorderInfo object
table.setDefaultCellBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, 0.1F));

// Set table border using another customized BorderInfo object
table.setBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, 1F));

com.aspose.pdf.Row row = table.getRows().add();
com.aspose.pdf.Cell cell = new com.aspose.pdf.Cell();
com.aspose.pdf.HtmlFragment fgmt = new com.aspose.pdf.HtmlFragment(html);

cell.getParagraphs().add(fgmt);
row.getCells().add(cell);

page.getParagraphs().add(table);

doc.save(myDir + "Table_HtmlFragment.pdf");

Please feel free to contact us for any further assistance.

Best Regards,

Thank you very much.

t’s ok now!

Hi Jerome,


Thanks for your feedback. It is good to know that you have managed to resolve the issue with new generator(com.aspose.pdf).

Please keep using our API and feel free to contact us for any further assistance.

Best Regards,

Hi,

Unfortunately, using new PDF generator (from aspose.pdf to com.aspose.pdf), after 4 days and
approximately 1100 pdfs generated, each generation is increasingly slower.

Going back to old generator, it
stands up very well.

Obviously It’s is performance problem and not a problem of memory because ours servers got huge configuration ( -XX:MaxPermSize=2048m -Xms12G -Xmx12G -XX:PermSize=2048m -XX:ReservedCodeCacheSize=72m) and after monitoring, we diagnosed that servers are still remaining with "comfortable free heap & stack memory.

Please investigate what is going wrong.

Thx,

Hi Jerome,


Thanks for your feedback. We will appreciate it if you please share your both sample codes of old generator and new generator along with source documents. It will help us to investigate and address exactly the performance issue you are facing.

We are sorry for the inconvenience caused.

Best Regards,

Hi,

join both new and old classes in ZIP file.

Thx

Hi Jerome,


Thanks for sharing the sample code. But I am afraid I am unable to test shared code due to missing references. I will appreciate it if you please share some sample code with static values, it will help us to test and replicate the issue at our end.

I am sorry for the inconvenience.

Best Regards,