Questions tagged [hwpf]

Apache POI - HWPF - Java API to Handle Microsoft Word Files

HWPF is the name of a port of the Microsoft Word 97(-2007) file format to pure Java as part of the project. It also provides limited read only support for the older Word 6 and Word 95 file formats.

See the Apache POI homepage for details.

46 questions
1
vote
1 answer

Extracting Apache POI HWPF Hyperlinks

HYPERLINK "target"label How can i extract hyperlinks from a HWPF document? I can get paragraphs from the doc file and extract the correct styling if necessary, i.e. bold, italic etc. But how would i identify and extract hyperlinks from a paragraph?
Diyarbakir
  • 1,999
  • 18
  • 36
1
vote
1 answer

How to create HWPF document with apache poi

Please somebody help me with putting text into paragraphs. I have this code : private void createDOCDocument(String from, File file) throws Exception { POIFSFileSystem fs = new…
lisak
  • 21,611
  • 40
  • 152
  • 243
1
vote
0 answers

Page count showing zero for APACHE POI .docx file

I have implemented Apache POI library for Page count of Doc pages, but it shows page count zero when I download Google Doc as .docx file. Edit: My code is as follows public Integer getPagesCount(byte[] docBytes, String type) throws…
Manish Kumar
  • 101
  • 11
1
vote
0 answers

How to create table in doc using poi

I try to create table in .doc file. I didn't getting much help to create table in doc using poi. I try below code but it didn't work. It's didn't create table like below screenshot. private static void insertTable() throws FileNotFoundException,…
Divyesh Kanzariya
  • 3,629
  • 3
  • 43
  • 44
1
vote
0 answers

Replacing a text using CharacterRun within apache POI HWPF

I have a small problem regarding the String replacing within Apache POI. private static HWPFDocument replaceText(HWPFDocument doc, String findText, String replaceText) { Map ranges = new HashMap(); …
1
vote
1 answer

Apache POI can not add CustomProperty to Doc

I'm trying to add some Custom Properties to an existing document: HWPFDocument document = new HWPFDocument(new FileInputStream(sourceFile)); DocumentSummaryInformation docSumInf = document.getDocumentSummaryInformation(); CustomProperties…
J.K
  • 25
  • 7
1
vote
1 answer

Add word (.doc) file with password apache poi

I want to add a password to my word file (.doc). I searched for it in google, but found only a solution for (.docx). Can anyone help me? I am using this code, but the output file does not have a password. FileInputStream in = new…
kids
  • 29
  • 1
  • 5
1
vote
1 answer

Java Apache POI adding new row in to existing table. Word document

I'm trying to add a new row to existing table within MS Word document. I use POI 3.10, hwpf library. But after execution of this program, the file is crashed, the MS Word rise an warning message. All content looks strange, and not formatted. A…
Oljko
  • 71
  • 1
  • 2
  • 4
1
vote
2 answers

Apache POI HWPF Nested Lists?

I used the following code to read list structures from a word file using hwpf. My question is how to read a list structure that is nested ie a list within a list within a list and so on. if (p instanceof ListEntry) { ListEntry…
Mahadevan
  • 11
  • 2
1
vote
5 answers

How to avoid force close when read null value

I write simple android application to read document properties with Apache.POI, but when it try to read document with null properties it will force close.. for example I use getDocumentSummaryInformation() then use getCompany().. but when the…
Abednego Js
  • 43
  • 1
  • 6
1
vote
1 answer

Apache POI Word .DOC Replacing Text

I would like to open a .doc file search for some text and replace it with other text. I know of the RANGE.replaceText(placeholder, newString) method but it is unreliable when you have mergfields, or other special formatting in the document and can…
user2020457
  • 165
  • 1
  • 1
  • 13
1
vote
1 answer

Java MS Word libarary

I've document and I want to change all template parameters like {name}, {address} to my own values. I tried to use POI HWPF Library, but I lost document formatting after saving. Even when I open my MS Word document with POI and save it (without any…
whiter4bbit
  • 151
  • 1
  • 6
0
votes
1 answer

How to Convert drawn shapes of HWPFDocument to XSL FO?

I am trying to convert .doc file to PDF, For this I am initially trying to convert .doc > XSL-FO > PDF. On Converting the .doc to XSL-FO I am unable to convert the drawn objects such as checkbox,rectangle,square to XSL-FO. It gets converted as below…
abhi
  • 1
  • 1
0
votes
1 answer

NoClassDefFoundError for apache poi HWPF 5.0

I need to add support of word document editing in standalone jar. I add apache-poi-poi-5.0.0.jar and poi-scratchpad-5.0.0.jar to class path libraries and classpath. But still got this error on execuition. What i miss in configuration? I use IDEA…
0
votes
1 answer

How do I add line breaks e.g. \\n in a Apache POI HWPF Document

I have to modify Word Document in the old .doc format. Using Apache POI with the HWPF representation of the document. I struggled to insert line breaks into any table cell. In the modified document line breaks look like empty boxes. table cell with…