docx4j

Converting a docx containing a chart to PDF

冷暖自知 提交于 2019-12-14 02:21:43
问题 I've got a docx4j generated file which contains several tables, titles and, finally, an excel-generated curve chart. I have tried many approaches in order to convert this file to PDF, but did not get to any successful result. Docx4j with xsl-fo did not work, most of the things included in the docx file are not yet implemented and show up in red text as "not implemented". JODConverter did not work either, I got a resulting PDF in which everything was pretty good (just little formatting/styling

Center image horizontally inside .docx generated with docx4j

让人想犯罪 __ 提交于 2019-12-13 21:57:42
问题 I've been trying for some days to center an image horizontally inside a .docx file generated from HTML with docx4j without success. What I've tried so far (and works in HTML ) is: <div align="center"><img alt="" src="data:image/png;base64,/9j/4AAQSkZJ..."></div> (by centering outer div) <div><img alt="" src="data:image/png;base64,/9j/4AAQSkZJ..." clase="img-default"></div> with the following commands inside Style tag: .img-default { margin: 0 auto; display: block; height: auto; max-width: 100

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

霸气de小男生 提交于 2019-12-13 11:24:07
问题 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 encrypted. I want to use Lucene to index the entire collection to allow better searching (e.g. "What day and year did I last write about how much I like oatmeal?"). The first step was to use POI to read a Word .doc, but I can't get off the dime because

Apply style to specific text in a styled paragraph using Docx4j

余生颓废 提交于 2019-12-13 06:49:40
问题 How to apply italic style to a specific text in a styled paragraph using Docx4j? Let's say a paragraph, as below, has been added to a document and it already has a style. word1 word2 word3 word4 What I need is to apply italic style to word3 and the general style of the paragraph is not modified, so words word1 word2 and word4 keep as is. Thanks in advance. 回答1: Sure, you'll need word3 to be in a run (w:r) of its own, so you can apply run property (w:rPr) of italics (w:i) to it. So first, you

Docx4j Issues converting to pdf

半腔热情 提交于 2019-12-13 05:46:40
问题 I know there's a lot of issues in this console report, but since I'm not that expert in docx4j and all the related packages, I' d like to have some explanations, especially on the reason why it is having formatting issues. Please give me some help. This is the console output 09:40:08,964 WARN [org.docx4j.fonts.PhysicalFonts] (http-/0.0.0.0:8080-5) Aborting: file:/C:/Windows/FONTS/impact.ttf (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?) 09:40:09,025 INFO [org.docx4j.fonts

Docx4j Footer not showing in MS-Word 2016

早过忘川 提交于 2019-12-13 04:07:32
问题 I am creating a docx file using DOCx4j Library in Java. I have created the Footer which is showing perfectly in Libra Office but it is not showing in MS-Word 2016. Footer Code: public static Relationship createFooterPageNumPart( WordprocessingMLPackage wordprocessingMLPackage) throws Exception { FooterPart footerPart = new FooterPart(); MainDocumentPart t = wordprocessingMLPackage.getMainDocumentPart(); footerPart.setPackage(wordprocessingMLPackage); // footerPart.setJaxbElement

XPages - docx4j - replacing a bookmark with text

我的未来我决定 提交于 2019-12-13 04:01:32
问题 I'm using docx4j in an XPages application to create Word documents containing content from an XPage. The Word document (in .docx format) is created based on a template (in .dotx format). One bookmark from my .dotx template is as follows: <w:p> <w:bookmarkStart w:name="Fachkompetenz" w:id="0"/> <w:bookmarkEnd w:id="0"/> </w:p> Using the function private static List<Object> getAllElementFromObject(Object obj, Class<?> toSearch) { List<Object> result = new ArrayList<Object>(); if (obj instanceof

ColdFusion & Java (docx4j library)

爷,独闯天下 提交于 2019-12-12 20:05:02
问题 I need to do docx manipulation (find/replace on placeholders and checking/unchecking checkboxes). Since ColdFusion 10 integrates well with Java, I decided to try and use the Java library docx4j, which basically mimics the OpenXML SDK (.net platform). I have the docx4j JAR inside a custom folder, which I have setup in my Application.cfc via JavaSettings (new in CF10, and I tried it with other JARS and it works): <cfcomponent output="false"> <cfset this.javaSettings = {LoadPaths = ["/myJava/lib

how to convert HTML to .docx using docx4j? [closed]

早过忘川 提交于 2019-12-12 11:32:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I read some articles about the conversion of html to .docx and I found out that docx4j gives pretty decent results. I wonder if anyone could provide me the following info: Needed jars and versions. Sample code for conversion from html to .docx . Sorry I couldn't post anything I tried because I haven't tried

How to replace EclipseLink 2.3.2 with EclipseLink 2.5 in WebLogic Server 12c

 ̄綄美尐妖づ 提交于 2019-12-12 08:49:14
问题 I currrently try to run Docx4j in WebLogic Server 12c. WebLogic Server 12c comes with EclipseLink 2.3.2. There is a similar Post describing the situation which unfortunately yield no answer. Docx4j does not work with the JAXB (MOXy) implementation which is part of EclipseLink 2.3.2. I got Docx4j running standalone with EclipseLink 2.5. So I am very confident that using EclipseLink 2.5 with Weblogic Server 12c will solve the issue with Docx4j. How can I replace the EclipseLink Vesion 2.3.2 the