Paragraph extends Component implements TextboxContainer,
		TextHyperlinkContainer, ControlContainer { public String getTextContent() { return getTextContent(getOdfElement()); } private  Paragraph(TextParagraphElementBase paragraphElement); static Paragraph getInstanceof(TextParagraphElementBase paragraphElement); static Paragraph newParagraph(ParagraphContainer container); void setTextContent(String content); void removeTextContent(); String getTextContent(); void setTextContentNotCollapsed(String content); void appendTextContent(String content); void appendTextContent(String content, boolean isStyleInherited); void appendTextContentNotCollapsed(String content); void setStyleName(String styleName); String getStyleName(); Document getOwnerDocument(); void remove(); ParagraphStyleHandler getStyleHandler(); @Override TextParagraphElementBase getOdfElement(); void addComment(String content, String creator); boolean isHeading(); int getHeadingLevel(); void applyHeading(boolean isHeading, int level); void applyHeading(); Font getFont(); void setFont(Font font); HorizontalAlignmentType getHorizontalAlignment(); void setHorizontalAlignment(HorizontalAlignmentType alignType); Textbox addTextbox(); Iterator<Textbox> getTextboxIterator(); boolean removeTextbox(Textbox box); OdfElement getFrameContainerElement(); Textbox addTextbox(FrameRectangle position); Textbox getTextboxByName(String name); List<Textbox> getTextboxByUsage(PresentationDocument.PresentationClass usage); TextHyperlink applyHyperlink(URI linkto); Iterator<TextHyperlink> getHyperlinkIterator(); void removeHyperlinks(); TextHyperlink appendHyperlink(String text, URI linkto); Control createDrawControl(); OdfElement getDrawControlContainerElement();  }
@Test public void testGetTextContentWithLibreOfficeFile() throws FileNotFoundException, Exception { TextDocument document = TextDocument.loadDocument(ResourceUtilities.getAbsolutePath("Bell.odt")); Paragraph paragraph = document.getParagraphByIndex(0, true); Assert.assertEquals( "Bell, based in Los Angeles, makes and distributes electronic articles, " + "computer and building products.", paragraph.getTextContent()); }
@Test public void shouldReturnMultipleLines() throws Exception { final String expected = "Hello\tWorld!\twho \t ever read this, is stupid.\n\n\nReally!"; TextDocument document = TextDocument.newTextDocument(); Paragraph p = document.addParagraph(expected); String textContent = p.getTextContent(); Assert.assertEquals(expected, textContent.replace("\r", "")); }