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
-1
votes
1 answer

How to add page header with some information and footer with page number in .docx file using docx4j with Java?

I have a word document with .docx extension. I want add header with some information and footer with page number in each page. I don not know how add header and footer on word document. I am using Docx4j open source edition with Java.
anika
  • 63
  • 1
  • 6
-1
votes
1 answer

Docx4j writes XML as default in a Word document

I'm trying to write simple text (String) to a Word document by replacing variables in a Word template with the following code: MainDocumentPart documentPart = template.getMainDocumentPart(); try { …
Pedro
  • 3
  • 4
-1
votes
1 answer

Create Word (.docx) Documents Programatically With docx4j

i want to Load a template word document and add content to it and save it as new document. here is what i found : private static WordprocessingMLPackage getTemplate(String name) throws Docx4JException, FileNotFoundException { …
-1
votes
1 answer

Putting a jpg image inside of a word doc and resizing it

I'm wondering if you had any ideas about resizing an image in word doc, I'm using docx4j. I've got the image showing but it is too big and I've tried everything to resize it. I've tried compressing with ImageWriter/ImageWriteParam param and the…
Dkeane
  • 31
  • 6
-1
votes
2 answers

Error in read .doc and .docx file's content

I want to read a .txt, .doc and .docx files and print the contents of those files.when i run the below code some .doc and .txt files are read but many files are not able to read. import java.io.File; import javax.swing.*; import…
-2
votes
2 answers

Word template to PDF Conversion with multiple languages using Docx4J

Hi I am using Docx4j to convert word template to PDF. But Tamil font is not supported. It looks weird. I used below java code that seems to reduce the weird look, still words are not displaying correctly. I have installed Latha as Tamil font. Pls…
Developer404
  • 5,716
  • 16
  • 64
  • 102
-2
votes
1 answer

How to create an index in word file programmatically?

Suppose there is table of thousand data items and we need to create an index of any of the items. So,how can an index be created in Docx file programmatically i.e with the help of docx4j.
shivani
  • 1
  • 3
-2
votes
1 answer

Split docx to multiple docx using Java

I have a requirement to split 1 docx to multiple docx based on subheadings. where input document have TOC, graphs, paragraphs, tables , images and drawing tools . I have a write a app to get a docx and generate multiple docx based on subheading. I…
prisesh
  • 77
  • 5
-2
votes
1 answer

Reading word template user entered values in java

I have a word template for a application Form (which contains text, dropdowns, checkboxes, date fields..). In my web application whenever user starts a new process they need to fill some high level data, here I need to fill some of the user entered…
chandraP
  • 71
  • 3
-2
votes
1 answer

How to read an MS word xml file in Docx4j

I have questions. I want to create MS word file with Java. I can make simple word file. but I don't know how to do the coding to create a word with complex shapes. Using the xml code, in my opinion it seems to be able to make. How to use raw xml…
yangho
  • 13
  • 5
-3
votes
1 answer

Can POI or docx4j read Word docs that are password-protected?

I'm having an issue with POI that I'd like some help with. I have a personal journal that I've kept for years by making daily entries into a Word .doc per month that's stored in a year folder. I add a password to open each one, so they're all…
duffymo
  • 305,152
  • 44
  • 369
  • 561
1 2 3
60
61