docx4j

Instead of rendering tables and other html tags in docx these are saved as plain text using docx4j-ImportXHTML

纵然是瞬间 提交于 2019-11-29 15:53:15
I want to render html code to docx. Instead of rendering html(i.e. tables in tabular format) it simply writes html code in it as plain text. I am using docx4j-ImportXHTML jar. I used the code from here and modified it to save in a file. What am I doing wrong? public static void xhtmlToDocx(String xhtml, String destinationPath, String fileName) { File dir = new File (destinationPath); File actualFile = new File (dir, fileName); WordprocessingMLPackage wordMLPackage = null; try { wordMLPackage = WordprocessingMLPackage.createPackage(); } catch (InvalidFormatException e) { e.printStackTrace(); }

docx4j does not replace variables

孤街醉人 提交于 2019-11-29 09:52:52
I just followed approach No 2 in the VariableReplace example from docx4j 2.8.1 and everything it does, is to remove the variable markers ${}. The steps I did: Opened Word 2013, typed ${variable} as text only Saved it to somewhere read it in my Java program and build my HashMap with .put("variable", "TEST"); other code is copied and pasted from the example above. Saved the document I'd expect 'TEST' solely, and get just 'variable' without the markers in the output document. JasonPlutext No doubt Word is splitting your "variable" across runs, with grammar or spelling flags. Fix it up with

Cannot use docx4j inside of JBoss 7

喜你入骨 提交于 2019-11-29 07:42:07
I was able to successfully create a simple project with docx4j ( http://www.docx4java.org ). This simple project successfully created and wrote on a .docx document. Now I am trying to accomplish the same thing inside of a bigger project. This bigger project is a webapp running in JBoss AS 7.1. However, at my first docx4j related line of code: WordprocessingMLPackage wmlp = WordprocessingMLPackage.createPackage(); It runs into an error: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context at org.docx4j.openpackaging.parts.JaxbXmlPart.<init>(JaxbXmlPart.java:79)

OutOfMemoryError while doing docx comparison using docx4j

99封情书 提交于 2019-11-28 09:38:37
问题 in my application i am comparing two docx files and creating one html comparison file, when i tried with below 150 or 170 lines of file then there is no issue, while i try to compare the big files like 200 lines or more than that then that time it showing the java.lang.OutOfMemoryError: Java heap space error, can any one please help on this? 回答1: You are running out of memory because you aren't using the Docx4jDriver class, which makes the diff problem more tractable by doing a paragraph

docx4j does not replace variables

你。 提交于 2019-11-28 03:29:08
问题 I just followed approach No 2 in the VariableReplace example from docx4j 2.8.1 and everything it does, is to remove the variable markers ${}. The steps I did: Opened Word 2013, typed ${variable} as text only Saved it to somewhere read it in my Java program and build my HashMap with .put("variable", "TEST"); other code is copied and pasted from the example above. Saved the document I'd expect 'TEST' solely, and get just 'variable' without the markers in the output document. 回答1: No doubt Word

Cannot use docx4j inside of JBoss 7

戏子无情 提交于 2019-11-28 01:36:56
问题 I was able to successfully create a simple project with docx4j ( http://www.docx4java.org ). This simple project successfully created and wrote on a .docx document. Now I am trying to accomplish the same thing inside of a bigger project. This bigger project is a webapp running in JBoss AS 7.1. However, at my first docx4j related line of code: WordprocessingMLPackage wmlp = WordprocessingMLPackage.createPackage(); It runs into an error: java.lang.NoClassDefFoundError: Could not initialize

Convert docx file into PDF with Java

谁说胖子不能爱 提交于 2019-11-27 18:56:28
问题 I'am looking for some "stable" method to convert DOCX file from MS WORD into PDF. Since now I have used OpenOffice installed as listener but it often hangs. The problem is that we have situations when many users want to convert SXW,DOCX files into PDF at the same time. Is there some other possibility? I tryed with examples from this site: https://angelozerr.wordpress.com/2012/12/06/how-to-convert-docxodt-to-pdfhtml-with-java/ but the output result is not good (converted documents have errors

Apache POI or docx4j for dealing with docx documents [closed]

倾然丶 夕夏残阳落幕 提交于 2019-11-27 11:17:30
问题 What do you think Which is better to use to read docx document as java objects and why ? in other words. which library supports most of the word tags ? 回答1: Disclosure: I lead the docx4j project Although docx4j can also handle pptx and xlsx, it is mostly used for docx manipulation. By way of illustration, as at the time of writing, there are nearly 1000 topics in the docx4j forum. The pptx forum has only 10% of the volume. Whatever you want to do with the docx document, docx4j ought to be

Execution failed for task &#39;:app:dexDebug&#39;. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException

醉酒当歌 提交于 2019-11-26 10:01:34
问题 I am building my android project when i got this error after import docx4j library in my project. What should i do to get rid of this exception. Error:Execution failed for task \':app:dexDebug\'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process \'command \'/usr/lib/jvm/java-7-openjdk-amd64/bin/java\'\' finished with non-zero exit value 2 回答1: I had got the same error. But I resolved the issue by adding the following missing line from build