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

using docx4j, how do I determine which content controls are bound in the document

if my custom xml part has 10 entries and the document only is bound to 7 of them, is there a "standard" way in docx4j to get that list of 7? I'm creating a simple system to let users download a blank document that has a custom xml part already…
Jason
  • 2,451
  • 2
  • 23
  • 31
0
votes
1 answer

set case of content bound via content controls in docx

I have a docx file that contains a custom part and a web page that collects input from the user to populate that custom part. One of my "variables" is used multiple times in the document. In some cases, I need it to appear in ALL CAPS. In most…
Jason
  • 2,451
  • 2
  • 23
  • 31
0
votes
1 answer

Using RTF Templates with mergefields as input for generating reports

I have a requirement to generate word documents from j2EE/java where the input would be a RTF template (.rtf document) having merge fields. I have looked at docx4j which accepts only docx as input. RTFTemplate which requires a template engine(not…
Anton
  • 141
  • 1
  • 3
  • 4
0
votes
1 answer

How to add a xlsx-file to a powerpoint presentation?

I want to add an existing excel-table to a slide. The excel-file is succefully added to the presentation, using an OleObjectBinaryPart. Now I want to add it to the slide with the following xml code ...
spilymp
  • 190
  • 2
  • 11
0
votes
1 answer

Warnings while using Docx4j with Spring-MVC

I wanted to create xlsx files using docx4j. I have a spring-mvc (4.x) application where i wrote the service. And it works as desired. However, i see the following warning in the logs which i want to get rid of. org.xlsx4j.jaxb.Context -…
Chinmay
  • 4,726
  • 6
  • 29
  • 36
0
votes
2 answers

Docx4j - chaging language settings for docDefaultStyle/proper applying custom(or changed) stock styles to any text in docx

I'm trying to use mine defined(changed) styles in Styles styles = mp.getStyleDefinitionsPart ().getJaxbElement (); to change styling for my entire table/individual table cells. I managed to make it by setting the properties in RPr runProperties like…
0
votes
2 answers

How to get name of slideLayout in pptx4j?

I use pptx4j to load an existing presentation and I need the names of each layout. With the following code, it should work in my opinion: // loading layout SlideLayoutPart layoutPart = null; try { PartName partName = new…
spilymp
  • 190
  • 2
  • 11
0
votes
0 answers

Docx4j: Out of memory on concurrent PPT creation

I am using docx4j to read and modify ppt template from a web application. There are multiple request at a time. So concurrent read and modify PPT file operations are performed. But after some request server throws out of memory error. So that many…
Sagar J
  • 1
  • 1
0
votes
0 answers

Docx4j in Android throws Verify Error

In my android application , I would like to create a word document with an Image file. For that , I have downloaded the docx4j.jar and copied into libs folder . When I tried to get the Image from the path (also Bitmap from the ImageView) and save in…
Rakesh L
  • 1,136
  • 4
  • 18
  • 44
0
votes
1 answer

How to replace text in Powerpoint file with Java

I have a requirement where I need to replace some text in a Powerpoint File at runtime. (Powerpoint file is being used as a template with some placeholders/tokes e.g. {{USER_NAME}}) I have tried using POI but with no luck. I referred to the other…
Vini
  • 8,299
  • 11
  • 37
  • 49
0
votes
1 answer

Java report generation

I am using docx4j for report generation in my java program. I can add text to the report but i cannot add images to the report. I'm trying to add an image for the report using the following code WordprocessingMLPackage wordprocessingMLPackage =…
madu
  • 344
  • 3
  • 14
0
votes
1 answer

Fetch data inside (docx4j)

This is a typical structure of a which contains shape(s).
0
votes
0 answers

Image is missing while converting docx to pdf using docx4j in Oracle ADF 12.1.2.0

I am trying to covert docx file to pdf in java using docx4j library v3.2.1, I've been following the example given here . I am able to convert the document successsfully but it's missing the image which I've put in header of my word file. I tried the…
IT ppl
  • 2,626
  • 1
  • 39
  • 56
0
votes
1 answer

Need suggestions regarding the .doc file reading in android

I'll be working on a new app that reads the .doc and .docx files and get the number of words, no of lines, no of pages, no of images, no of formula's so so from the particular word document. So, i used the Java Scanner class to get the word and…
King of Masses
  • 18,405
  • 4
  • 60
  • 77
0
votes
2 answers

Cannot count number of characters in a docx file generated from a not empty XHTML

I implemented a XHTML converter to DocX using DocX4J. It creates the DocX file without problems. To finish my task I decided to implement a simple test. The test consists in counting the number os chars in the DocX created and then comparing it with…
Cláudio
  • 484
  • 1
  • 4
  • 18