Hi, I think you did something "special" in your document. Could you provide us your "test1.odt" file?
Thanks, Regards, Guillaume 2009/6/8 Alberto <[email protected]> > > Hi all, > I'm not able to fill a document properly, following the example, using > Java5: > > Field Filling works fine > Paragraph showing or hiding does not work, that is, paragraph 'p1' is > never displayed. > No compile nor runtime errors. > I am using jOpenDocument-1.1-jdk5.jar, JDK 1.5.0_15, OO 2.4.1, Linux > Fedora 9. > I can't understand... > something wrong in my template? I'll post it if needed. > > Can someone help me? > > Ciao > Alberto > > public static void main(String[] args) { > // TODO Auto-generated method stub > File templateFile = new File("/home/adt/test1.odt"); > File outFile = new File("/home/adt/out1.odt"); > // Load the template. > // Java 5 users will have to use RhinoFileTemplate instead > try { > RhinoFileTemplate template = new > RhinoFileTemplate(templateFile); > > // Fill with sample values. > template.setField("n1", "Field one"); > template.showParagraph("p1"); > // filed n1 is before p1 paragraph, and it is > showed correctly > // Save to file. > template.saveAs(outFile); > > // Open the document with OpenOffice.org ! > OOUtils.open(outFile); > } > catch (Exception e) { > e.printStackTrace(); > } > } >
