Either open the OPCPackage as read only or buffer the file to an input stream. OPCPackage.close does the modifying. On Jun 1, 2016 13:47, "Javen O'Neal" <javenon...@gmail.com> wrote:
> Here: https://bz.apache.org/bugzilla/show_bug.cgi?id=58779 > On Jun 1, 2016 13:07, "Murphy, Mark" <murphym...@metalexmfg.com> wrote: > >> If I open a document template: >> >> XWPFDocument document = new >> XWPFDocument(POIXMLDocument.openPackage("Normal.dotm")); >> >> Add some text: >> >> XWPFParagraph paragraph = document.createParagraph(); >> XWPFRun run = paragraph.createRun(); >> run.setText("At tutorialspoint.com, we strive hard to " >> + "provide quality tutorials for self-learning " >> + "purpose in the domains of Academics, Information " >> + "Technology, Management and Computer Programming >> Languages."); >> >> Then write to a different file: >> >> FileOutputStream out = new FileOutputStream(new File( >> "createdocument.docx")); >> document.write(out); >> out.close(); >> document.close(); >> System.out.println("createdocument.docx written successully"); >> >> >> The new file is created, but the template is updated as well!! >> >> Any ideas of where to look? >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org >> For additional commands, e-mail: dev-h...@poi.apache.org >> >>