Questions tagged [docx4j]

Docx4j is an open source (ASLv2) Java library for manipulating Microsoft OpenXML files (Word docx, Powerpoint pptx, and Excel xlsx) via JAXB

Docx4j is a Java library for manipulating Microsoft OpenXML files (Word docx, Powerpoint pptx, and Excel xlsx). It uses JAXB to create the in-memory representation.

It is similar to Microsoft's OpenXML SDK, but for Java. docx4j uses JAXB to create the in-memory object representation.

It is available under the Apache License (v2).

docx4j was created by Plutext Pty Ltd in 2008 - using OpenXML4J for the OPC piece. Plutext still drives the project, but since then docx4j has benefited from contributions from many individuals. The contributors are listed in docx4j's pom.xml.

The docx4j online demo is available here.

911 questions
0
votes
1 answer

variableReplace showing a error

I have went onto the GitHub repository for the docx4j files and downloaded VariableReplace. When i copied this file into netbeans, I got an error on line 86 (Cannont find symbol). Here is the code: /* * Copyright 2007-2008, Plutext Pty Ltd. * …
0
votes
1 answer

Docx4j Set a value on Bookmark

I'm recently using the docx4j and i'm trying to set a bookmark on a Word document (it's my template file). I already see the manual but i don't find the answer :S I'm using version 2.8.1 and i'm getting a Bookmark based on the code available…
JMarques
  • 3,044
  • 4
  • 34
  • 55
0
votes
1 answer

docx4j convert docx in wrong html format

I have some problems with docx4j samples. I need to convert a file from docx in html format and back. I'm try to compile ConvertInXHTMLDocument.java sample. Html file it creates fine, but when trying to convert it back into docx, throws an exception…
0
votes
0 answers

Issues converting docx to PDF in java

I am trying to convert a word docx file to a pdf file, all using java, and without any user interaction. This is my code so far, I am using the docx4j library. /* * To change this template, choose Tools | Templates * and open the template in the…
user2065929
  • 1,065
  • 4
  • 21
  • 35
0
votes
1 answer

how to set linespacing using docx4j api?

Blockquote Hi, I am trying to convert doc to docx using docx4j api.I need to set line spacing as required. Blockquote
user2211381
  • 31
  • 1
  • 2
  • 3
0
votes
2 answers

docx Template Docx4j replacing text in Java

Im new to Docx4j and my task is to replace some Text of a docx Template. I read the getting Started Guide of docx4j but I don't think I fully understood the whole concept. Well Anyway... I already tried [the unmashalling Template of Docx4j][1],…
user2286154
  • 3
  • 1
  • 1
  • 3
0
votes
1 answer

How to add image rel to my pptx slides with docx4j

Does someone know how to one image reference to any count of slides. I know how to add image to one slide, e.g. it works: BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(presentationMLPackage, slidePart,…
Volodymyr Dvornyk
  • 1,332
  • 1
  • 12
  • 15
0
votes
0 answers

docx4j with weblogic Bad [Content_Types].xml Exception

how to solve this Exception when I use docx4j with weblogic to open docx file. follow is my code: WordprocessingMLPackage templatePackage = WordprocessingMLPackage .load(getDocxInputTream()); Exception is : 2013-04-03 18:10:29 ERROR…
wilson
  • 281
  • 6
  • 22
0
votes
1 answer

Docx4j Test - No File is Output

Attempting to write my first class with docx4j (http://www.docx4java.org). Basically the idea is to find a string of text in the .docx file and replace it with another string of text. Essentially a mail merge. While I'm not receiving any errors, the…
Jeff Walden
  • 311
  • 1
  • 4
  • 19
0
votes
0 answers

How to insert an ellipse (circle) in docX?

I'm trying to insert an ellipse in a docx without sucess. It is possible to add an ellipse to docx with docx4j? I also tried to insert the XML "....." with org.docx4j.XmlUtils.unmarshalString but I received some errors. Someone tried to do it?
phew
  • 55
  • 7
0
votes
1 answer

Custom solution in Docx4J for converting Docx to HTML

I have this requirement to convert multiple DOCX files into HTML format and if possible into RTF Docx4j seems to be a good java library for doing this. Using the HtmlExporterNG2.html method is not necessarily giving out the desired result for me. So…
Swift-Tuttle
  • 485
  • 3
  • 14
  • 25
0
votes
1 answer

DOCX4J - Copying inbetween two markers

I've done a simple replace with DOCX4J, thanks to this awesome guide. But now I'm trying to do something more complicated. What I'd like to do is find my marker text #1 within the document, find my marker text #2 within the document, and copy…
Doug
  • 6,446
  • 9
  • 74
  • 107
0
votes
1 answer

DOCX4J: Viewing HTML exported Document file in JEditorPane

I was trying to view an xHTML file generated by DOCX4J. I was able to successfully generate the mentioned file, all the formatting of text appears correctly in the browser. However, I was trying to view it on a JEditorPane, and it only displays the…
0
votes
1 answer

DOCX4J: Null Pointer Exception

I created a new Document file using the WordprocessingMLPackage.createPackage() method. Now I'm trying to manipulate the contents of the default style ("Heading 1", "Normal", etc.). When I'm trying to printout the values of the style's property, it…
0
votes
1 answer

How do I turn off debug log4j in docx4j

I have tried for several days to configure log4j in my EJB without luck. I have two properties files that are never picked up in the…
chugadie
  • 2,786
  • 1
  • 24
  • 33