Summary: | cannot retain format for word document[.doc] [HWPFDocument] | ||
---|---|---|---|
Product: | POI | Reporter: | sanmoy <sanmoy> |
Component: | HWPF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 3.8-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
test input file for hwpf
test output file for hwpf |
Created attachment 27307 [details]
test output file for hwpf
Unable to reproduce using latest code from trunk. Sanmoy, could you try to use latests JARs from http://encore.torchbox.com/poi-cvs-build/ ? I had tested with poi 3.8-beta3-20110606 which has the problem. This release is available from http://poi.apache.org/download.html. Now, i have tested with poi-3.8-beta4-20110722, and the code is working fine. Thank you all for your great effort. |
Created attachment 27306 [details] test input file for hwpf I had written a simple code FileInputStream fileInputStream = new FileInputStream(new File("C:\\in.doc")); FileOutputStream fileOutputStream = new FileOutputStream(new File("C:\\out.doc")); HWPFDocument hwpfDocument = new HWPFDocument(fileInputStream); hwpfDocument.write(fileOutputStream); After executing the code, output file doesn't retain the original format. All lines have the same font, size, color of the first line. Again, The below code executes perfectly ( for .docx ) FileInputStream fileInputStream = new FileInputStream(new File("C:\\in.docx")); FileOutputStream fileOutputStream = new FileOutputStream(new File("C:\\out.docx")); XWPFDocument docx = new XWPFDocument(fileInputStream); docx.write(fileOutputStream); xwpf and hwpf behavior should be consistent