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

Doc4j Struts2 Action OutOfMemoryError

I am having an Action class in struts2 application and i want to display a docx file to the user. When i load the file with InputStream the file opens without problem fileStream = new DataInputStream( new…
0
votes
1 answer

how to add a digital signature to an xlsx file

I am trying to add a digital signature to an xlsx file... Can't seem to find any resources for this (other than adding signatures to literal/regular xml files). Is this possible with docx4j? I see it includes jaxb-xmldsig but there are no samples…
0
votes
1 answer

DOCX4J: How add rows to existing table in docx template?

I need add rows to existing table in docx template. How it make? Please share code.
0
votes
1 answer

Content control binding loses formatting on text inside content control

Text formatting (font type, font size, colors, ...) gets lost when I try to bind an XML with a docx with content controls that contain text with formatting. I have modified the sample ContentControlsMergeXML a little to illustrate the issue. The…
Skiwi
  • 3
  • 1
0
votes
2 answers

Converting files

is there'll be possible to convert from this .xml file to .docx programmaticaly in java, and backwards from .docx to .xml(with docx4j,or? how any samples)? Bestätigt wurde ich in…
user2994149
  • 37
  • 1
  • 11
0
votes
1 answer

How to export WordprocessingML to PDF with docx4j and send to response object?

i'm using docx4j lib to work with docx file. And want to export a pdf file when user browse my jsp page. i've got WordprocessingML from word file. But don't know how to convert it to pdf file and response (as use can download pdf file) any idea ?
0
votes
1 answer

Docx4J: How to remove relationship for MailMerge?

I'm developing a feature with which users can upload docx-documents with placeholders. These placeholders will later be replaced with data from a database. In order to assure that the user only uses predefined placeholders, he has to select a Ms…
user1335772
  • 277
  • 1
  • 3
  • 10
0
votes
0 answers

Leading spaces are ignored (docx4j)

I am using docx4j to load a template, replace specific keywords inside it (load the template, marshall then unmarshall) My problem is that leading spaces inside the text I insert inside the template are ignored when I open the generated file. I…
Transient
  • 326
  • 2
  • 11
0
votes
2 answers

docx conversion to pdf in korean font

Hope someone can help me. It's about docx to pdf conversion having korean sign in docx document. I'm able to convert a docx document to pdf with docx4j. In pdf document, I can see the result. But if my docx document contains korean font, I can't see…
duracell
  • 644
  • 8
  • 13
0
votes
1 answer

Add background color to Excel rows generated by DocX4J

I'm using DocX4J for creating an excel file. Now I want to give some rows a background color, depending on a calculation done before creating the excel. However, I can not find a method or something to add a backround color for a row. The Java-Doc…
Mirco
  • 2,940
  • 5
  • 34
  • 57
0
votes
2 answers

How to add text to beginning docx java

I found that people use docx4j to modify docx's. I went through 'getting started' and I believe I have basic knowledge of this lib works. What I want to achieve is to add basic text to the beginning of document (before any other text). I managed to…
kukis
  • 4,489
  • 6
  • 27
  • 50
0
votes
2 answers

docx4j generate PDF with mail merge fields

i am using Docx4j to generate pdf documents based on Microsoft Word templates. In a microsoft word template, i have some Mail Merge fields, which should be replaced. I am able to replace Mail Merge field but in generated PDF are displayed in a wrong…
0
votes
0 answers

Grails run-app fails with: "java.lang.ClassNotFoundException:org.docx4j.openpackaging.packages.WordprocessingMLPackage"

I've updated my application to Grails 2.3 and I’m now having an extremely frustrating issue getting the app up and running. I was hoping someone could offer some assistance. We have a dependency on doc4j and every time I go to run the app I get a …
contemplate
  • 1
  • 1
  • 2
0
votes
0 answers

Java library can't find resource from Ant script

I am working on a docx-pdf convert task, which should be called from an Ant script. As the basis I use the docx4j libraries. In one of its classes is a getResource call, which tries to access the org/docx4j/convert/out/pdf/viaXSLFO/docx2fo.xslt…
Mensfeld
  • 101
  • 1
  • 7
0
votes
1 answer

docx4j html conversion breaks one line into multiple span elements

I have a small problem with the docx4j generated html. In 95% of the cases everything works fine. But there are some lines in the document, which are converted into multiple spans with the same styling. For example: I have a line like:…
omniflash
  • 191
  • 1
  • 14