Questions tagged [xwpf]

XWPF is a Java API to handle Microsoft Word 2007 .docx format files. It is part of the Apache POI project.

XWPF is a Java API to handle Microsoft Word 2007 .docx format files. It is part of the project.

See the Apache POI home page for details.

231 questions
2
votes
1 answer

Unable to change orientation of ms-word file(XWPF) using apache poi

i am trying to create a word document using XWPF format in apache poi. the document requires tables to be created, so i need to set the page orientation to landscape. i used the existing code of Landscape and portrait pages in the same word…
Mohammed Siddiq
  • 477
  • 4
  • 16
2
votes
2 answers

Apache POI - add multiple paragraphs to header/footer on the same line

I am using Apace POI to process some documents and I would like to add a header/footer which would consist of multiple paragraphs, but I would like for them to be displayed on the same line. This is my attempt so far: XWPFDocument document = new…
user4655581
2
votes
2 answers

Apache poi xwpf table alignment

I am creating a table in Apache Poi in xwpf using the below code : XWPFTable table = doc.createTable(Countrows1+1,4); table.getCTTbl().getTblPr().unsetTblBorders(); …
user3436156
  • 103
  • 1
  • 2
  • 11
2
votes
1 answer

poi XWPF double space

I am using the apache POI.XWPF library to create word documents. For the last couple of days I have been searching how to do double spaces for the whole document. I have checked the Apache javadocs and just by searching the internet but can't seem…
develop1
  • 747
  • 1
  • 10
  • 32
2
votes
1 answer

Can not resolve xwpf

I'm trying to use POI to convert word files to the txt files , but when i use org.apache.poi.xwpf.usermodel.XWPFDocument it tells me that "cannot resolve xwpf" my pom.xml :
user2728222
2
votes
1 answer

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

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…
Liquidpie
  • 1,589
  • 2
  • 22
  • 32
2
votes
1 answer

Create a horizontal rule in a Word document with Apache POI

Is it possible to create a horizontal rule in a Word document using Apache POI? I can't find anything in the documentation that seems relevant. If not, is there some way to insert raw HTML into the document?
RustyTheBoyRobot
  • 5,891
  • 4
  • 36
  • 55
2
votes
1 answer

Adding pictures to .docx files with Apache POI with XWPFDocument

I've been trying to add .jpg pictures to .docx files with Apache POI. XWPFDocument.addPictureData doesn't seem to work. XWPFDocument docx = new XWPFDocument(); FileOutputStream fos = new FileOutputStream(...); InputStream pic = new…
user1576720
  • 105
  • 2
  • 9
1
vote
1 answer

Apache Poi - how to remove all the links from Word Documents

I want to remove all the hyperlinks of a Word document and keep the text. I have these two methods to read word documents with doc and docx extensions. private void readDocXExtensionDocument(){ File inputFile = new File(inputFolderDir,…
zekifh
  • 169
  • 1
  • 2
  • 10
1
vote
0 answers

How to parse and print bulleted list using Apache POI?

I am trying to extract entire word document in Java project, go paragraph by paragraph and print the XWPFParagraphs back to another word file. I am able to accomplish my task except the bulleted list from input document is being printed as numbered…
1
vote
0 answers

How to create bullet points in the WXPFRun level in a word document with apache poi?

I am creating a Word document with Apache poi library. The whole document has only 1 paragraph. The styles and fonts are implemented with the help of different runs (XWPFRun). Things were all okay until I encountered a requirement with bullet…
Jeet
  • 359
  • 1
  • 6
  • 24
1
vote
1 answer

How to get content of a page of a .docx file using Apache Poi?

I'm trying to read .docx files with styling information using Apache Poi which I have done by looping through each XWPFParagraph and working with all the XWPFRun run inside the paragraphs. Now I want to get contents of each pages. So is there a way…
1
vote
1 answer

How to allow more rows to be created in apache POI with read only protection?

I'm working creating a docx file which needs to be readonly protected except in some fields. For those fields I have solved it with this: pInit.getCTP().addNewPermStart(); ... pEnd.getCTP().addNewPermEnd(); But now I want to allow adding new rows…
mz0
  • 21
  • 3
1
vote
1 answer

POI XWPF insert content from another docx in a bookmark

APACHE POI XWPF problem: in a main .docx document I have a cell with a bookmark:
Lof
  • 251
  • 1
  • 3
  • 7
1
vote
0 answers

I am using Apache POI to create header and footer in docx but the resulting file cannot be opened

I am using Apache POI to create header and footer but the resulting file cannot be opened. [1]: https://i.stack.imgur.com/eDGcF.png XWPFDocument docx = new XWPFDocument(); CTP ctpFooter =…
PIXCEL
  • 13
  • 3