docx

How to handle special characters when converting from HTML to DocX

ε祈祈猫儿з 提交于 2019-12-01 10:20:57
问题 I have a application that converts html files to DocX using DocX4J. I´m having problems with special characters like ç,á,é,í,ã,etc. My text font in the html files is Arial but when I convert them to DocX the special characters mentioned before are set to calibri font. So, in the same word (e.g Cláudio), I have "Cl" written in Arial font, "á" character in Calibri font and "udio" in Arial font. I saw that maybe I have to set font property in w:r but I´m having difficulty to see how to do it to

How to remove tables and paragraphs containing data from docx in java using apache poi

纵饮孤独 提交于 2019-12-01 09:38:49
问题 I have a word template that has multiple similar tables and some paragraphs associated to those tables placed just before them. Depending on the amount of data, I populate some tables and others are not required, so are there paragraphs. I need to remove these tables and paragraphs. As you can see in the image, I need to remove Table 2 and its paragraph Table Parahgraph Please help me how to do it. I tried using document.removeBodyElement(pos) , but it does not help. int startIndex = 0; int

Writing Styled Text to a .docx file

落花浮王杯 提交于 2019-12-01 08:05:54
问题 I'm trying to write an application that will write text to a .docx file. My application uses a JTextPane so the user can write whatever he/she wants, and it also provides many buttons such as bold, font color, font size... ect. What I'm having a problem with is maintaining the style of the text on the JTextPane to when I write to the .docx file. I'm fairly new to Swing and Apache POI so example code and/or a detailed explanation would be helpful. What I have is this: (pad refers to the

Getting text style from docx using Apache poi

柔情痞子 提交于 2019-12-01 07:34:49
I'm trying to get the style information from an MS docx file, I have no problem writing file content with added styles like bold, italic. font size etc, but reading the file content and getting the style information is not so clear. I've tried using XWPFDocument, this API does not seem to have the ability to read the styles. I'm now trying XWPFWordExtractor which seems a bit more promising but I'm still stuck getting the style information for the text. The type of content I reading looks similar to the following. "Hello, this is bold text and this is italic text abd this is bold-italic text "

How to set plain header in docx file using apache poi?

北城余情 提交于 2019-12-01 07:07:54
问题 I would like to create a header for docx document using apache poi but I have difficulties. I have no working code to show. I would like to ask for some piece of code as starting point. 回答1: There's an Apache POI Unit test that covers your very case - you're looking for TestXWPFHeader#testSetHeader(). It covers starting with a document with no headers or footers set, then adding them Your code would basically be something like: XWPFHeaderFooterPolicy policy = sampleDoc.getHeaderFooterPolicy()

Android - docx4j build issue

心不动则不痛 提交于 2019-12-01 06:52:07
I am developing an android application. In which I need to show the docx, xlsx files inside my application. I have searched in the internet and found docx4j will convert docx, xlsx files to html (or) pdf. So that I am planning to show the html return from the docx4j in the webview. So that I have downloaded the source from github and tried to run the sample. I made changes in eclipse.ini file as given in the link as well. But, I couldn't execute the application. When I run the app, I am getting the following exception. [2014-11-24 17:19:34 - AndroidDocxToHtml-master] Conversion to Dalvik

Reading .docx in C++

时间秒杀一切 提交于 2019-12-01 06:50:34
I'm trying to create a program that reads a .docx file and posts it content to a blog/forum for personal use. I finally have figured out how to use libcurl to do (what I figured) was the harder part of the program. Now I just have to read the .docx file, but have come under a snag. I can't seem to find any documentation on how to do this. Any ideas? Peter Olsson The easiest way is to use Word to do this. It has limitations on licensing. The SO question Creating, opening and printing a word file from C++ has some good references. Edit: According to these questions/answers can unzip the Open XML

Android - docx4j build issue

北城以北 提交于 2019-12-01 06:06:34
问题 I am developing an android application. In which I need to show the docx, xlsx files inside my application. I have searched in the internet and found docx4j will convert docx, xlsx files to html (or) pdf. So that I am planning to show the html return from the docx4j in the webview. So that I have downloaded the source from github and tried to run the sample. I made changes in eclipse.ini file as given in the link as well. But, I couldn't execute the application. When I run the app, I am

Getting text style from docx using Apache poi

不想你离开。 提交于 2019-12-01 05:03:13
问题 I'm trying to get the style information from an MS docx file, I have no problem writing file content with added styles like bold, italic. font size etc, but reading the file content and getting the style information is not so clear. I've tried using XWPFDocument, this API does not seem to have the ability to read the styles. I'm now trying XWPFWordExtractor which seems a bit more promising but I'm still stuck getting the style information for the text. The type of content I reading looks