Filling text document and Java5

35 views
Skip to first unread message

Alberto

unread,
Jun 8, 2009, 9:13:04 AM6/8/09
to jOpenDocument
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();
}
}

Guillaume Maillard

unread,
Jun 8, 2009, 9:59:39 AM6/8/09
to jopend...@googlegroups.com
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 <alberto....@gmail.com>

Alberto di Taranto

unread,
Jun 8, 2009, 11:29:24 AM6/8/09
to jopend...@googlegroups.com
Here it is my "special" test1.odt.
I provide out1.odt as well, because thumbnail.png saved in out1.odt shows the paragraph!


Thank you again
Alberto


2009/6/8 Guillaume Maillard <guillaume...@gmail.com>
test1.odt
out1.odt
Reply all
Reply to author
Forward
0 new messages