An API for creating, accessing and manipulating Open Document Format (ODF) files. Use this tag for questions regarding the API.
Questions tagged [odfdom]
16 questions
9
votes
2 answers
Generate libreoffice text document programmatically from template
I'm trying to find a way to generate an .odt document from an .ott template programmatically. This should be done programmatically. Any ideas on how to achieve this?
I found some ways of generating .odt files in Java…

domachine
- 1,119
- 1
- 12
- 20
2
votes
1 answer
How can the Page Size, Page Orientation, and Page Margins of an ods Spreadsheet Be Set Using ODFDOM?
The Apache Incubation Project ODFDOM allows users to programmatically read and create various open document format files, including spreadsheets.
I am trying to set various print options for a spreadsheet I am creating, using their re-vamped "Simple…

romeara
- 1,426
- 1
- 17
- 26
1
vote
0 answers
Java Odftoolkit: Copy header (with its style, tables etc) from an OpenOffice writer doc to another with ODFDOM
I couldn't find a way to copy the header from an OpenOffice writer doc to another with ODFDOM.
I tried this:
TextDocument docIntestazione = TextDocument.loadDocument("intestazione.odt");//the file with only the header
TextDocument docBody =…

bale
- 11
- 2
1
vote
1 answer
Read XForm from odt file with java
I am trying to read data from a odt file (created with LibreOffice). The requirement is to get the xml that is binded to an XForm included in the document. I am currently using the odfdom-java library to read the file. So far I have managed to read…

dchar
- 1,665
- 2
- 19
- 28
1
vote
2 answers
Starting from a template to generate ODT document with JAVA
I have tried a few APIs : JopenDocument and ODFDOM and both of them don't offer what i'm looking for.
I want to be able to do the following :
Start from a template .
Process this template with JAVA to generate ODT/Docx reports.
I need those two…

azelix
- 1,257
- 4
- 26
- 50
1
vote
1 answer
How to put color to specific cells in ods file using java
Here I am able to merge/span the cell using 'setColumnSpannedNumber()' but could not set background color of the cell and alignment.I am using odfdom-java-0.8.6.jar currently..please suggest me a way to set the color for the cells. Thank you.
try…

BjRaj
- 11
- 3
1
vote
1 answer
Setting style on a paragraph using ODF toolkit
I'm trying to generate a well structured OpenDocument Text file with Apache's ODF tookit. I hope to achieve this by using styles for different portions of data. So I generated a template file that contains all of the styles I wish to use.
My next…

StanB123
- 477
- 5
- 14
1
vote
0 answers
ODFDOM Java Interface simple array to table example
I am looking for how to handle the different ODFDOM classes, I can not find out looking at the documentation online how to solve this:
I got an ArrayList , which I want to list in different tables. There should be at the end 3 different tables on…

user3476204
- 11
- 1
0
votes
1 answer
Module resolution exeption with odfdom and Gradle
I am modulirizing and existing non modular application. To make my life easier with the Java modules system, I decided to pick up a working example https://github.com/beryx-gist/badass-jlink-example-log4j2-javafx which is similar to my app and add…

CT95
- 107
- 1
- 11
0
votes
1 answer
ODFDOM Java PDF converter messed up encoding
I want to convert an .odt file to .pdf in my web java application. I have an .odt file in Bulgarian (cyrillic) and it converts successfully on my local machine. However, on the cloud server all the cyrillics are skipped and only the latin symbols…

Ivan Ivanov
- 243
- 4
- 15
0
votes
1 answer
ODFDom set Page Size, Page Orientation, and Page Margins of .odt Text document
Apparently these settings can be changed for ods spreadsheet documents, but with odt only certain parameters can be changed:
StyleMasterPageElement defaultPage = templateDocument.getOfficeMasterStyles().getMasterPage("Default");
String…

sarah.ferguson
- 3,167
- 2
- 23
- 31
0
votes
1 answer
VerifyError when Converting .odt to .pdf using xdocReport
I have to convert odt file to pdf file. for that I am using XdocReport.
My code is like this :
public static void convertOdtToPdf(String inputFilename , String outputFilename) throws Exception{
InputStream in= new FileInputStream(new…

iRunner
- 1,472
- 6
- 25
- 40
0
votes
1 answer
Getting java.lang.NoClassDefFoundError: org/apache/xerces/dom/ElementNSImpl with Apache ODF Toolkit
I am trying to read an ods file using Apache ODF Toolkit. I am getting java.lang.NoClassDefFoundError error while while trying to load the Spreadsheet using below code-
SpreadsheetDocument data = SpreadsheetDocument.loadDocument(file);
Below is the…

ravi
- 6,140
- 18
- 77
- 154
0
votes
1 answer
odftoolkit NoClassDefFoundError exception
I've read this topic, and I've used odfdom library as was described, but I ve got an excption
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xerces/dom/DocumentImpl
How can I deal with that? Thank you!
P.S.: Here is gist

Skeeve
- 1,205
- 3
- 16
- 31
0
votes
1 answer
JAVA ODFDOM: How to get integer values from ODF sheet
I am using this code to get maximum row count from a sheet in ODF
public int getRowCount(String sheetName) throws XPathExpressionException, Exception
{
//reset rowCount to zero
rowCount=0;
//xpath to reach Nodes of cell in first row
…

Abhinav Garg
- 1,642
- 3
- 22
- 41