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

How to read/print the contents for excel file using docx4j?

I've been googling and I've not found one example for this. I am able to extract the contents for a DOCX file but so far no clue how to get the contents of an EXCEL file. I know you use SpreadsheetMLPackage spreadsheetMLPackage =…
iCodeLikeImDrunk
  • 17,085
  • 35
  • 108
  • 169
0
votes
1 answer

Content control toolkit creates extra custom xml parts on reopen docx

I am creating a docx with 2 rich text controls and 1 picture control. I open content control toolkit, create 1 custom xml part, type in the xml and bind xml tags to the content controls. I save the mapping and close it. When I reopen the docx, I see…
Artin
  • 745
  • 1
  • 7
  • 14
0
votes
1 answer

converting docx to pdf

I am converting docx to pdf which works fine. But the problem is it misses the formatting the document. How to ensure the formatting such as [bold, tablets etc]] are not lost while converting. I am using docx4j for conversion. Below is the exception…
Shane
  • 5,517
  • 15
  • 49
  • 79
0
votes
1 answer

Can I use BindingHandler.applyBindings and Docx4j.bind together?

I know using both to apply the bindings is unconventional. But in my case, some values come from the database and I will set them in the code, use BindingHandler to bind them. Some other values will mostly be static and will be available in an xml…
Artin
  • 745
  • 1
  • 7
  • 14
0
votes
1 answer

Java docx4j modify template for header footer with SQL data

What I am wanting to do is take in a word doc/docx template which already has pre-designed headers and footers and replace certain words with words applicable with that document generated from what a user has input and has been saved through MySQL.…
0
votes
2 answers

NoClassDefFoundError while using docx4j in IBM message broker v8

I have a requirement to create a word document. So I am trying to use docx4j. I get a runtime error. java.lang.NoClassDefFoundError: org.docx4j.openpackaging.packages.WordprocessingMLPackage I am sure I have docx4j3.0.1 and all the dependencies…
Artin
  • 745
  • 1
  • 7
  • 14
0
votes
2 answers

Using docx4j with ColdFusion

I am attempting to create Word documents with ColdFusion, but it does not seem there is any way to do it with only ColdFusion. The best solution seems to be docx4j. However, I can't seem to find any in-depth docx4j and ColdFusion examples (Aside…
RHPT
  • 2,560
  • 5
  • 31
  • 43
0
votes
1 answer

Docx4J ConvertOutPDF sample Xalan OutputProperties NullPointerException

While trying to convert to PDF multiple times using the ConvertOutPDF sample : try { ConvertOutPDF.process(filelink, target_flavour_filelink); } catch (Exception e) { e.printStackTrace(); } where process looks essentially exactly like Jason's…
Radagast
  • 141
  • 1
  • 9
0
votes
1 answer

Docx4j v3 Docx to HTML with Images

I'm working to convert a docx to html using Docx4j version 3. The document contains white space consisting of tabs, spaces and newlines. The resulting HTML either has unrecognized characters or does not preserve whitespace at all. The java code I'm…
TooSerious
  • 409
  • 4
  • 13
0
votes
0 answers

Conversion exceptions while using docx4j (From Docx to PDF)

I would like to know why this code: String inputfilepath = "D:\\DFADFADSF"; WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath + ".docx")); MainDocumentPart documentPart =…
0
votes
1 answer

How to read variables from the word document using docx4j?

I want get to the variables(${colour}) list and then pass the variables dynamically.Is it possible to get the variables list. Thanks
MMM
  • 63
  • 3
  • 10
0
votes
1 answer

How to set the name of the downloaded word document using docx4j?

I am generating a word document from HTML using docx4j, but I am not able to set the downloaded file name. By default it picks the servlet name as WordDocGenServlet.docx. Any help ?? Thanks in advance!
OmP
  • 189
  • 1
  • 3
  • 21
0
votes
0 answers

Docx4j: PPTX got corrupted while inserting an ellipse object

i have been searching the whole day for a solution but i'm unable to find one. That's why i decided to ask a question. My problem is that i'm inserting a ellipse object to the PPTX file. When i tries to open the presentation MS OFfice says it's…
Asad Khan
  • 61
  • 6
0
votes
2 answers

How to use docx4j in my project?

I want to use docx4j in my java project to read docx documents. I am using Eclipse. I downloaded the docx4j-jar file and included it in the build path. When running my test code i get this error message: Exception in thread "main"…
Iceman
  • 321
  • 1
  • 6
  • 21
0
votes
0 answers

Word document to PDF conversion with docx4j

I'm trying to convert a docx file to pdf, docx is a template with header, text and pictures that has been edited through docx4j. This is the piece of code for conversion... private static void wordClientToPDF() throws FileNotFoundException,…
Yury Lankovskiy
  • 143
  • 3
  • 14