dbarra / xdocreport

Automatically exported from code.google.com/p/xdocreport
1 stars 0 forks source link

table alignment for odf->pdf converter #156

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
odf->pdf converter does not manage table alignment and margin
Table in converted pdf is always centered.

Original issue reported on code.google.com by abe...@gmail.com on 28 Sep 2012 at 10:18

GoogleCodeExporter commented 8 years ago
Hi Leszek, 

Many thank's to develop this issue.

Please not you must develop this feature in the new project 
http://code.google.com/p/xdocreport/source/browse/#git%2Fthirdparties-extension%
2Forg.odftoolkit.odfdom.converter.pdf

As soon as you will fix this problem, could you just explain your fix in order 
to I do the same thing with docx converter. 

Many Thank's!

Regards Angelo

Original comment by angelo.z...@gmail.com on 28 Sep 2012 at 11:25

GoogleCodeExporter commented 8 years ago
Hi Leszek, 

Somebody needed table alignment with iText and bruno has given some ideas to 
manage that at 
http://itext-general.2136553.n4.nabble.com/How-to-indent-a-PdfPTable-td2145933.h
tml

Perhapps we should try those different solution (paragraph, columntext, etc) 
I'm waiting for you develop this feature to manage that for docx (for the 
moment I have doen table.setHorizontalAlignmenet(Element.ALIGN_LEFT)

Regards Angelo

Original comment by angelo.z...@gmail.com on 2 Oct 2012 at 3:48

GoogleCodeExporter commented 8 years ago
@Angelo
I've fixed the problem in ODT.

First you have to read table alignment and margins in StyleEngineForIText.

In StylableTable use function PdfPTable#setHorizontalAligment for setting 
alignment. If table has margins it is wrapped into another invisible table. The 
same mechanism may be used in docx->pdf converter.

Original comment by abe...@gmail.com on 8 Oct 2012 at 2:25

GoogleCodeExporter commented 8 years ago
Hi Leszek, 

I tried to implement your idea for docx but I have a big bug with StackOverFlow 
(pageBreak is everytime called). I have found the same problem with ODT. The 
case is when your array is splitted in two pages. I have commited this case in 
the TestTableWithSpace.odt (Junit crashes for this ODT). 

It seems that the problem comes from with your algorythm pageBreak etc. As I 
have done the same thing for docx, I have the same problem. I'm waiting for you 
fix the problem for ODT to implement it for docx.

Thank's for your help.

Regards Angelo

Original comment by angelo.z...@gmail.com on 8 Oct 2012 at 10:30

GoogleCodeExporter commented 8 years ago
fixed, wrapper table was not splitted causing stack overflow.

Original comment by abe...@gmail.com on 9 Oct 2012 at 6:43

GoogleCodeExporter commented 8 years ago
Hi Leszek,

Thanks a lot to have fixed this problem. I have implemented the same thing for 
docx ->pdf converter. I have mlodified your code for 2 things : 

1) At first I have moved your code to the 
http://code.google.com/p/xdocreport/source/browse/thirdparties-extension/fr.open
sagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/e
xtension/ExtendedPdfPTable.java to share the same code for docx and odt -> pdf 
converter.
2) I have fixed a bug when you create teh wrapped table PdfPTable with 
createTable, I set the width with 100 percent and not use the width of the 
table. See that in the 
http://code.google.com/p/xdocreport/source/browse/thirdparties-extension/fr.open
sagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/e
xtension/ExtendedPdfPTable.java

Regards Angelo

Original comment by angelo.z...@gmail.com on 9 Oct 2012 at 8:44

GoogleCodeExporter commented 8 years ago
It's ok for me.

Original comment by abe...@gmail.com on 9 Oct 2012 at 12:26

GoogleCodeExporter commented 8 years ago
@Angelo
I've made a fix to ExtendedPdfPTable. Tha wrapper table must have the same 
alignment as inner table. Also it is better to set absolute width as inner 
table may be smaller than 100% page width.
Regards
Leszek

Original comment by abe...@gmail.com on 15 Oct 2012 at 12:42