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
1
vote
1 answer

Referencing cells in XWPFTable with Apache POI

I'm writing a docx parser with Apache's POI library. I'm having some trouble understanding how cells are referenced within a XWPFTable. Can someone explain how the referencing is done if non uniform tables are presented (ie two columns with…
zmahir
  • 23
  • 4
1
vote
0 answers

Apche POI XWPFDocument Memory Leak

Im using Apache POI version 5.0.0. Im using it to create Word document and create a very large report from it. Apache POI is taking a lot of memory and after the report is created its not releasing the memory. I dont want to increase the java heap…
Aqeel Haider
  • 603
  • 7
  • 24
1
vote
0 answers

HttpsURLConnectionImpl.getInputStream: SSL error connection reset

My java code tries to fetch a document from it's server. Both the code as the document are on a Tomcat server in the same domain. https://domain/webapp/static/document. When I run this piece of code: try (InputStream stream = conn.getInputStream(); …
Jo Vanmont
  • 41
  • 4
1
vote
1 answer

Get XWPFRun From XWPFParagraph

I want create Word document from another Word document, but I need replace some text in new Word. I do it, but my problem is the new Word Document does not support the old document style. For this I can get XWPFRun from XWPFParagraph. How can I do…
totali
  • 260
  • 6
  • 22
1
vote
0 answers

XmlValueDisconnectedException at converting XWPFDocument to pdf when merging rows

I need to merge cells vertically and I found a sample code here at stackoverflow and it works ok, but afterwards when converting my XWPFDocument to pdf I'm getting following error fr.opensagres.poi.xwpf.converter.core.XWPFConverterException:…
lalala
  • 46
  • 5
1
vote
1 answer

Replacing text in XWPFParagraph without changing format of the docx file

I am developing font converter app which will convert Unicode font text to Krutidev/Shree Lipi (Marathi/Hindi) font text. In the original docx file there are formatted words (i.e. Color, Font, size of the text, Hyperlinks..etc. ). I want to keep…
1
vote
1 answer

Ho to empty all headers and footers in an XWPFDocument (DOCX) using Apache POI?

The following Java code has successfully removed all the contents in the headers and footers in a specific DOCX file, except one footer (it was a first page footer). Upon inspecting the DOCX, the naughty footer has the XML below. How would you…
Orion
  • 1,104
  • 3
  • 16
  • 40
1
vote
2 answers

How to add a new line in XWPFDocument in java?

I wanted to create a line break in XWPFDocument paragraph, I tried the below code, but its not working. XWPFParagraph paragraph = document.createParagraph(); XWPFRun run = paragraph.createRun(); run.setText(" we strive hard to " + …
Bubashan_kushan
  • 384
  • 8
  • 24
1
vote
0 answers

DOCX Apache POI - Shape/Image/WordArt with Text inside is not getting converted to PDF

I have used the below code : package com.allianz.re.gim.service.util; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import…
Vighnesh
  • 17
  • 3
1
vote
0 answers

Merging two docx files : bulleted list disappears

I want to merge two docx documents. The first one (test1.docx) contains : And the second one (test2.docx) is empty. I want to add first document content to second. I am doing it like this: String test1 = "test1.docx"; String test2 =…
thomas
  • 1,201
  • 2
  • 15
  • 35
1
vote
1 answer

copy table from templates with fixed place using Apache Poi

I have a table in the docx template. Depending on the number of objects, I have to duplicate the table as many times as I have objects. Duplicate tables must be after the table from the template. I have several tables in the template that should…
turo
  • 59
  • 1
  • 9
1
vote
0 answers

Different ways of writing a XWPF file

So I want to automatize the creation of a Proof Of Payment so I create it and it automatically fills the info of each client. The way that I'm trying it now is to replicate the word document through the Apache-Poi so I put it into a loop and fill…
1
vote
1 answer

How to add a hyperlink to the footer of a XWPFDocument using Apache POI?

The appendExternalHyperlink() method (source) is not working in the footer of a XWPFDocument. In the footer the result is not getting recognised as a hyperlink. I am new to Apache POI and have no experiences with the low level stuff. Can someone…
Martin
  • 178
  • 10
1
vote
0 answers

Apache POI word XWPF - How to find a link between a comment and paragraph?

I need to find a text associated with a paragraph comment but cannot find what links those two. The comment list consists of IDs which seams to be a commentID, however when iterating over paragraphs I cannot see a method that would return linked…
Whiat
  • 31
  • 5
1
vote
0 answers

how to add shapes in word document using apache poi library

I need to add below shapes available in MS word using Apache poi library. I am not able to find any specific class/method available for word to add such shapes. However, I can find some method to add shapes in excel from apache. XSSFDrawing…
Arvind
  • 46
  • 9