MohamedSaeed / xdocreport

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

PDF conversion with headers #433

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

What steps will reproduce the problem?
1. Create a docx file with headers : the header size of the first page should 
be different from the size of the headers of the following page (smaller in my 
example)
2. Convert the docx in a PDF file using XDocReport converter

What is the expected output? What do you see instead?
The resulting PDF displays correctly all the headers, but with the same size on 
each page : if the size is smaller on the first page, then the text will be 
overlayed on the following pages (it is easier to understand by looking at the 
examples)

What version of the product are you using? On what operating system?
1.0.4

I attached the docx file and the generated output. I guess it also appears with 
footers, but I didn't try.

I found that the margins are extended in ExtendedHeaderFooter.setMasterPage 
according to the first header size. I could no continue the analysis, because I 
am not sure how apache.poi handle the margins of a document with several pages.

A fix would be perfect, otherwise an hint on how to fix that ?

Thanks,

Julie

Original issue reported on code.google.com by julie.no...@gmail.com on 15 Aug 2014 at 2:19

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Julie,

At first I have added your docx in our 
JUnithttps://code.google.com/p/xdocreport/source/browse/thirdparties-extension/o
rg.apache.poi.xwpf.converter.pdf/src/test/java/org/apache/poi/xwpf/converter/cor
e/AbstractXWPFPOIConverterTest.java (see Issue433 JUnit test method).

But I have no time to fix it. I suspect that problem is about the image used in 
your header. I think if you remove your image and you set a text it should work.

Problem comes from with 
https://code.google.com/p/xdocreport/source/browse/thirdparties-extension/org.ap
ache.poi.xwpf.converter.pdf/src/main/java/org/apache/poi/xwpf/converter/pdf/inte
rnal/elements/StylableDocument.java#396 which returns the height of the header. 

If I remember with your docx, the iText header contains a PdfTable which 
contains a PdfRow which contains a PdfCell which contains text and image. It's 
the problem I suppose but no time to find a fix today.

Any contribution are welcome!

Original comment by angelo.z...@gmail.com on 18 Aug 2014 at 1:24