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
0 answers

Android DOCX4J convert docx to PDF

please has anybody experience / sample code to get this running on Android? I have all the JAR s installed and I am able to create a…
user1616685
  • 1,310
  • 1
  • 15
  • 36
0
votes
1 answer

How to get Line No,Page No of a strings in Word 2010 document using Docx4J

I am processing a word 2010 Document using Docx4J. I want to print the page number and line number of String which i am searching for. For Example: My Document is having String called hello at Page 2, Page 6. My o/p should be like this. Hello found…
0
votes
0 answers

Docx4j difference between two Word docs

I need check the difference between 2 Word docx Files. Iam using docx4j. At first I had to change the SmartXMLFormatter: public SmartXMLFormatter(Writer w) throws IOException { this.xml = new XMLWriterNSImpl(w, false); if…
Tim Schwalbe
  • 1,588
  • 4
  • 19
  • 37
0
votes
1 answer

VariableReplace - No Errors with No Result

I'm currently using Docx4Java 3.1.0. I have all the dependencies included in my netbeans project. When I run this piece of code: package pse; /** * * @author Hrach */ import java.util.HashMap; import org.docx4j.XmlUtils; import…
0
votes
0 answers

How to insert images to xlsx by docx4j

I am try to insert images in an xlsx file using docx4j, but the images are the size of a single cell. My code so far: BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(pkg, drawing, data.bytes); String imageRelID =…
0
votes
1 answer

Corrupted file when creating Word document

I'm quite new to docx4j. After installing everything, I tried creating an empty .docx file, and then write text in it. Here's the code : WordprocessingMLPackage wordMLPackage =…
ArcDexx
  • 453
  • 5
  • 15
0
votes
1 answer

Passing an Enum to a method as a parameter in Java?

I am trying to call a docx4j method "setAlgn" in the interface CTTextParagraphProperties, which, per the docx4j jar I am using and the compiler takes an Enum type as a parameter. I am passing the actual argument STTextAlignType.CTR which I believe…
Tyler Wood
  • 35
  • 8
0
votes
1 answer

docx4j: How to calculate the maximum numbers of characters of a text box in a PPTX file ?

i'm creating a PPTX file (Download here) using docx4j. This presentation has 1 slide and there are text boxes in it. Now when i replace the variables with the text i need somehow to calculate the maximum numbers of characters which would fit in and…
Asad Khan
  • 61
  • 6
0
votes
1 answer

Parse VML Path attribute value using java libraries

docx files using docx4j, I am able to parse ovals and rectangles from the CTRect and CTOval object from docx4j. But when I get to the custom shapes docx4j give me objects in CTShape or CTShapetype. I have already read the VML Specification link.…
frey
  • 431
  • 1
  • 5
  • 21
0
votes
1 answer

How to enable support for m:oMathPara in docx4j

I'm trying to convert a docx file, which contains an equation in it, to html, but when doing so, while it renders everything else correctly, for the equation it prints: NOT IMPLEMENTED: support for m:oMath - Is there any way to get docx4j to provide…
firexion
  • 99
  • 2
  • 10
0
votes
0 answers

Table position issue while convert to PDF (xdocreport)

I am using xdocreport for templating and converting docx to PDF. In my docx template I have an image, text paragraph and table (they are placed in this order). When I try to convert this file to PDF the result file have another structure - table,…
Filosssof
  • 1,288
  • 3
  • 17
  • 37
0
votes
1 answer

Exception: No such property: level for class: org.slf4j.impl.Slf4jLogger

After updating docx4j from 2.8.0 to 3.1.0, I have a problem with the following codes: WordprocessingMLPackage wml = WordprocessingMLPackage.load(new File(preferenceService.getLocalTemplateDir(), profileVO.templateFile + ".docx")); /** some codes for…
Manuela
  • 1,379
  • 3
  • 16
  • 25
0
votes
1 answer

Migrate from docx4j Version 2.X to 3.X

I updated my docx4j from version 2.8 to version 3.1.0, but i have a probnlem with the type CustomXmlDataStoragePart and CustomXmlPart. The following codes are the original ones from my application with version 2.8.0: HashMap
Manuela
  • 1,379
  • 3
  • 16
  • 25
0
votes
2 answers

Setting the font and style of jeditorpane

I am currently developing an application for this company as my last year of studies project, and in this application there's this function that allows you to print a paper, so i used the jeditorpane obviously, with the Charles Bell HTMLEditorKit…
user3610008
  • 79
  • 2
  • 11
0
votes
1 answer

Docx4j with grails. Convert HTML to word document

I'm using Docx4j 3.1.0 with Xalan 2.7.1 in grails 2.3.7. Here I've done the integration of docx4j with grails and I'm able to generate word document. But I want pass a gsp or html template to the Docx4j and generate word document. Is it possible ?…
jdev1
  • 141
  • 2
  • 14