docx4j

Convert DOCX to HTML incliding IMAGES

送分小仙女□ 提交于 2019-12-24 13:13:34
问题 I am using DOCX4J to convert the DOCX to HTML .I have successfully done the conversion and got the html format.I will be using the html format to embed it as EMAIL body to send an email.But I have some issues which are listed below.... Unable to display images in email body Losing the spaces and bullets Please find the code which I have written, WordprocessingMLPackage wordMLPackage; wordMLPackage = Docx4J.load(new java.io.File(resourcePath2)); HTMLSettings htmlSettings = Docx4J

how to read and edit existing pptx using Docx4j?

感情迁移 提交于 2019-12-24 07:58:32
问题 I am using the following code to iterate over existing pptx, but how can I edit (replace text or image) in specific slide. Example in documentation String inputfilepath = "C:/tmp/template.pptx"; PresentationMLPackage presentationMLPackage = (PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath)); for (int i=0 ; i<presentationMLPackage.getMainPresentationPart().getSlideCount(); i++) { SlidePart slidePart = presentationMLPackage.getMainPresentationPart().getSlide(i);

Android HTML to docx Docx4j issues

喜欢而已 提交于 2019-12-24 06:45:22
问题 I am trying to convert html string to docx using the below code as per github code recommended on previous stackoverflow questions. I added the following libraries other than the ones used for Android docx to HTML by docx4j: 1. docx4j-importXHTML-3.2.2.jar 2. itext-2.1.7.jar 3. xml-renderer-3.0.0.jar 4. xalan-2.7.0.jar The following is the android version of code in XhtmlToDocxAndBack.java : try { String html = "<html><head><title>Import me</title></head><body><p>Hello World!</p></body></html

Docx4J Bad [Content_Types].xml with WebLogic 12c

怎甘沉沦 提交于 2019-12-24 05:32:35
问题 I'm wondering if anyone has had the same problem with the setup: WebLogic 12c Docx4J 2.8.1 Java EE 6 I tried to get the content of a certain Microsoft Word 2007 Document with Docx4J but got an error like the following: When I try to do: WordprocessingMLPackage package = WordprocessingMLPackage.load(new File((path)); it will throw exception like: 2013-06-05 15:29:12.0283 ERROR Thread-18 org.docx4j.jaxb.NamespacePrefixMapperUtils – name: com.sun.xml.internal.bind.namespacePrefixMapper value:

How to create or update table of contents in a word file?

 ̄綄美尐妖づ 提交于 2019-12-23 22:21:46
问题 I can read or write word document in Java using Apache POI or docx4j. But I cant find any references to create or update table of contents in a Word file. Is there any other API can support TOC in Java? Or, is it possible in Apache POI or docx4j to have options to create or update TOC? 回答1: There's a cleaner way for this too. You just need to open a empty docx which will act as a template. Add some sample text into it with the style that you want to include and then this piece of code will

How to write HTML text with Marathi text to PDF document using docx4j?

落爺英雄遲暮 提交于 2019-12-23 05:01:51
问题 I am using docx4j to create PDF documents from the HTML text. The HTML text has some English and Marathi text in it. English text comes properly in the pdf. but the marathi text is not displayed in the generated pdf. In place of text, it shows square boxes. Below is the code I am using. import java.io.FileOutputStream; import org.docx4j.Docx4J; import org.docx4j.convert.in.xhtml.XHTMLImporterImpl; import org.docx4j.openpackaging.packages.WordprocessingMLPackage; public class

How to write HTML text with Marathi text to PDF document using docx4j?

有些话、适合烂在心里 提交于 2019-12-23 05:01:40
问题 I am using docx4j to create PDF documents from the HTML text. The HTML text has some English and Marathi text in it. English text comes properly in the pdf. but the marathi text is not displayed in the generated pdf. In place of text, it shows square boxes. Below is the code I am using. import java.io.FileOutputStream; import org.docx4j.Docx4J; import org.docx4j.convert.in.xhtml.XHTMLImporterImpl; import org.docx4j.openpackaging.packages.WordprocessingMLPackage; public class

Docx4j throws exception when convert to pdf

帅比萌擦擦* 提交于 2019-12-23 04:53:14
问题 this excpetion is throw in web application, but in a stand alone application not happen this. Any idea, i use docx4j 3.3.0. The application runing Jboss 6.3 eap. Before a use an older version (3.2.2) but not throws this error. JBWEB000309: type JBWEB000066: Exception report JBWEB000068: message Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest JBWEB000069: description JBWEB000145: The server encountered an internal

Create docx using docx4j with multiple headers

邮差的信 提交于 2019-12-23 02:50:41
问题 Is it possible to create new header for every different sections using docx4j? I've seen that MS Word provides functionality to create different headers by creating different sections using section breaks. But I want to implement this functionality using docx4j. For example: If I've to create a docx files that may contains list of products, some terms and conditions, and some other sections. And I want title for each section to be displayed at top with paging (Like Product Summary: Page 1 of

DOCX4J Insert a line break

五迷三道 提交于 2019-12-23 02:42:16
问题 I have a variable in a DOCX that I want to replace with a value. First, that variable is not placed at the beginning of the line but after some tabs. My value is a postal address and I want to have the street and zip code (+city) in different line with the same indentation. The street replace the variable in his line, and the zip code is in a new line like that: 4 Privet Drive Little Whinging This is the XML for the variable: <w:p> <w:pPr> <w:tabs> <w:tab w:val="left" w:pos="6120"/> </w:tabs>