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

Convert docx page 1 at a time to an image

I need to convert docx file to an image page by page. So if I Pass page number to a method - that method should read that page out of docx file and convert that to an image. Any example of that using Apache POI API ? I did that for pptx file but was…
user2565431
  • 49
  • 2
  • 10
0
votes
1 answer

Issues with embedding PDF in pptx using docx4j

I have to attach a pdf file in a pptx slide during runtime. Tried the following: Attached a pdf file in the pptx slide (Insert -> Object -> Adobe Acrobat Document). Accessed the oleobject using the following code : OleObjectBinaryPart…
0
votes
1 answer

Extracting Images and Hyperlinks from .docx file from docx4j api

Suppose part type is "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" then how will I get it. Code Snippet: …
0
votes
2 answers

docx4java's SectionWrapper.getHeaderFooterPolicy -- can I use this to remove headers & footers

Rewritten to look more like a programming question Okay, so I have done a little more research and it looks like the java package I need to use is docx4j. Unfortunately, my lack of familiarity with the package as well as the underpinnings of the PDF…
Jordan Reiter
  • 20,467
  • 11
  • 95
  • 161
0
votes
1 answer

Issues converting docx to pdf using docx4j

I am using docx4j 2.8.1 and I tried to convert several different docx file, but i have always the same issue. maybe the issue is coming from the version of the library or some dependency missing. Code: package test; import java.io.File; import…
oueslatibilel
  • 567
  • 1
  • 8
  • 24
0
votes
1 answer

How to modify description tag of a docx document

I'm using docx4j to read contents of a word document. The core.xml has a description tag which I would like to modify in the documents I'm reading. What is a best way to do this? Will I have to read the entire content of the document and create a…
Anthony
  • 33,838
  • 42
  • 169
  • 278
0
votes
1 answer

How to read all the font sizes used in a docx

I am using docx4j and the very useful webapp they've built for parts list: http://webapp.docx4java.org/OnlineDemo/PartsList.html I have a sample document with five words. First four are in font size 12 and the last is in font size 8. I would like…
Anthony
  • 33,838
  • 42
  • 169
  • 278
0
votes
1 answer

adding image to word document using docx4j

I am trying to add an image to the word document I want to create from docx4j.. Here goes my code.. package presaleshelperapplication; import java.io.ByteArrayOutputStream; import org.docx4j.dml.wordprocessingDrawing.Inline; import…
user1901079
  • 427
  • 2
  • 7
  • 19
0
votes
1 answer

Content control picture binding

Thanks to this excellent sample, I'm now familiar with the binding of values at runtime using docx4j from any well built xml file to a word template containing content controls. But I can't find a way to achieve the simular thing to inject a picture…
Camille Laborde
  • 858
  • 11
  • 17
0
votes
1 answer

java.lang.NoSuchMethodError: org.apache.log4j.Logger.getAllAppenders() when running docx4j

I'm writing a simple program with docx4j but getting java.lang.NoSuchMethodError: org.apache.log4j.Logger.getAllAppenders() I do have log4j 1.2.15 installed (listed in docx4j's dependencies). Has anyone encountered the same problem?
Hieu Phan
  • 581
  • 3
  • 7
  • 14
0
votes
1 answer

How to show/display/read/edit xlsx content in android activity using docx4j?

I am new to using docx4j library, I am trying to open the xlsx file using API's provided by docx4j. I am able to load the file by using SpreadsheetMLPackage xlsMLPackage = (SpreadsheetMLPackage)loader.get(is1); I don't know how to show the file…
0
votes
2 answers

Set password for the docx, ppt, xlsx file

How to set password for the docx,ppt,xlsx file in Java? What are APIs available for this? I was exploring docx4java. Any examples / options are welcome.
0
votes
1 answer

table not getting created in docx using docx4j library

I'm trying to create a table and add it to MainDocumentPart using docx4j library as below but its corrupting the document and it's not opening ( im using MS Word 2010 with docx format ) // creating docx WordprocessingMLPackage wordPackage = …
JavaGeek
  • 1,535
  • 9
  • 39
  • 63
0
votes
2 answers

Docx4j: Insert item X times after current item under parent

I'm attempting to use DOCX4J to parse and insert content into a template. As part of this template I have loops which I need to copy everything inbetween two markers, and repeat all that content X times. The relavant code is as follows: public…
Doug
  • 6,446
  • 9
  • 74
  • 107
0
votes
2 answers

convert docx to doc with java

I have a legacy software which produces a xml and then with help of docx4j a docx document . I must also create a microsoft doc document from the xml file with java. How can I do that. I'd really appreciate for any help. Thanks
duracell
  • 644
  • 8
  • 13