Open Laxse opened 4 years ago
Do we have any fix for above issue? I am also facing this same issue for PDF conversion.
Hi friend, Do you have any fix for above issue?, I'm also facing this issue
Thanks in advance
Hi friend, Do you have any fix for above issue?, I'm also facing this issue
Thanks in advance
Sorry, Im also waiting for developer to solve this problem. 😂
I am also waiting for a solution. Problem can be reproduced easily by creating an empty word file and insert a table with content. It works with odt file but not with docx.
Hi friends,
I have the same problem as you
Is there any solution?
Hi friends,
I have the same problem as you
Is there any solution?
too hard to wait I had change to use Spire.office to make Docx to PDF.
Hi,
I have solved my problems:
RowRenderData row; row = Rows.of(new String[]{"Text1", "Text2"}).create(); CellStyle cs = new CellStyle(); cs.setVertAlign(XWPFVertAlign.CENTER); row.getCells().get(0).setCellStyle(cs);
This code vertically aligns Text1
My problem was that the cell I was trying to align fell on a "page break" and in that case it is not able to align vertically.
I use \<dependency> \<groupId>com.deepoove\</groupId> \<artifactId>poi-tl\</artifactId> \<version>1.10.4\</version> \</dependency>
To prevent the texts from being written on top of the lines in general in the tables (as in the images), I have implemented:
private static void setTableSpacingAfter(TableRenderData table){
ParagraphStyle ps = new ParagraphStyle();
ps.setSpacingAfter(5.0);
for(RowRenderData iRow:table.getRows()){
for(CellRenderData iCell:iRow.getCells()){
for(ParagraphRenderData iParagraph:iCell.getParagraphs()){
if(!Util.esVacio(iParagraph.getParagraphStyle())) {
iParagraph.getParagraphStyle().setSpacingAfter(ps.getSpacingAfter());
}else{
iParagraph.setParagraphStyle(ps);
}
}
}
}
}
Executed with the following code, the results are not satisfactory expect graph1 graph get graph2 graph
version: fr.opensagres.poi.xwpf.converter.core-2.0.2.jar fr.opensagres.poi.xwpf.converter.pdf-2.0.2.jar fr.opensagres.xdocreport.itext.extension-2.0.2.jar