tianchiing / xdocreport

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

Not correct pages count after generating report #376

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

1.I use docx template and TemplateEngineKind.Velocity to generate document. 
2.I read generated file with XWPFDocument.
3.I try to get number of pages using 
document.getProperties().getExtendedProperties().getUnderlyingProperties().getPa
ges()

I expect to see the real page size of generated document, but I see page size 
of template. (In my example template file has 20 pages, but generated has 50) 

I use XDocReport version 1.0.2, Apache POi version 3.9

Original issue reported on code.google.com by o...@mail.ru on 27 Feb 2014 at 12:11

GoogleCodeExporter commented 8 years ago
I'm afraid that I cannot fix this problem. How can we know the page number of 
docx?

Original comment by angelo.z...@gmail.com on 27 Feb 2014 at 1:16

GoogleCodeExporter commented 8 years ago
It's very bad.. Something strange happens with generated document. After I 
open, manually change something and save document, I can get the real page 
number. It looks like some information is not refreshed after generation.

Original comment by o...@mail.ru on 27 Feb 2014 at 6:05

GoogleCodeExporter commented 8 years ago
When you use MS Word and you save your docx, the page number is updated, 
because MS Word knows the page number. If you generate a report with XDocReport 
or other generator (I think with POI there is the same problem if you create a 
docx from scratch with POI API), it's impossible to know the page number.

If you find a solution, tell me and I will do something.

Original comment by angelo.z...@gmail.com on 27 Feb 2014 at 7:43