java - Add Image with jOpenDocument in odt document (writer) -
i'm trying jopendocument api , want add/insert image. can api? i'm interested in jopendocument because enables me create template , process document afterwards java (which don't think it's possible odfdom apache).
the thing found can this:
final file outfile = new file("output.odt"); final string bcfile = "image.png"; final javascriptfiletemplate template = new javascriptfiletemplate("template.odt"); final odsinglexmldocument ddoc = template.createdocument(); ddoc.getdescendantbyname("draw:frame","pc_lsbarcode").setattribute("href", "file:///" + bcfile,namespace.getnamespace("xlink", "http://www.w3.org/1999/xlink")); ddoc.saveas(outfile);
as can see href
, result odt file won't portable depends on path of image.
are there native methods in jopendocument api can insert images in odt document?
Comments
Post a Comment