You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Shiva Kumar <sh...@pawaa.com> on 2015/05/18 09:11:43 UTC

Reading individual textboxes from MainTextBoxRange() method.

I am trying to extract the text within individual textboxes in HWPFDocument,
but I can get the text from all text boxes combined together.

 

How to do this please suggest me.

>From the below code I can get text in all textboxes but how to find which
textbox has how many content.

 

 

                                int ps =
wordDocument.getMainTextboxRange().numParagraphs();

                                for (int p = 0; p < ps; p++) {

                                                Paragraph paras =
wordDocument.getMainTextboxRange().getParagraph(p);

                                                int cs =
paras.numCharacterRuns();

                                                for (int c = 0; c < cs; c++)
{

                                                                CharacterRun
chrs = paras.getCharacterRun(c);

                                                                char[] chars
= chrs.text().toCharArray();

                                                                if
(chrs.text().charAt(0) == '\r') {

                                                                }


                                                }

                                }

 

Thank You