Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2012
    Rep Power

    Question Ignoring MS Word hidden fonts [POI HWPF]


    I'm having an issue processing a MS document where I'm trying to ignore hidden text (after a very long investigation I found that the doc had hidden text by highlighting the text and selecting Font > Effects > Hidden).

    I'm using maven and poi:poi:3.0-FINAL; created a HWPFDocument and have successfully processed all the Paragraphs and CharacterRuns in the doc. However, I've not yet been able to determine whether the font is hidden (so that I could ignore/consume it). I've dumped the results from most getter methods in Paragraph, ParagraphProperties, CharacterRun and CharacterProperties but as yet cannot find anything that could help or indicate any difference between normal text and hidden text.

    I've been through a stack of forums, the apache POI site and their unit tests (the only sample code they have for POI HWPF) and of course google, but I'm come up short.

    Any ideas, pointers or places to look will be greatly appreciated!

    There are no stack traces to add and sample code is simple:

    POIFSFileSystem poifsFileSystem = new POIFSFileSystem(fileInputStream..poifsFileSystem.) ;
    HWPFDocument doc = new HWPFDocument(poifsFileSystem);

    Range range = doc.getRange();
    for (int i = 0; i < range.numParagraphs(); i++) {
    Paragraph paragraph = range.getParagraph(i);
    for (int j = 0; j < paragraph.numCharacterRuns(); j++) {
    CharacterRun cr = paragraph.getCharacterRun(j);
    //dump all properties of cr


  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Scanner Ignoring input
    By totalspelnerd in forum New To Java
    Replies: 9
    Last Post: 04-15-2012, 12:05 PM
  2. writing word document using poi hwpf
    By devday in forum New To Java
    Replies: 4
    Last Post: 08-07-2011, 12:15 PM
  3. compile ignoring dependency errors
    By Geoffrey in forum Java Servlet
    Replies: 1
    Last Post: 09-10-2009, 07:45 PM
  4. How to create a table in word document using hwpf
    By devday in forum Advanced Java
    Replies: 0
    Last Post: 07-23-2009, 03:41 PM
  5. Fonts (Changing Fonts and Color's)
    By dbashby in forum New To Java
    Replies: 10
    Last Post: 04-06-2009, 02:32 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts