172173174175176177178179
} } } handler.endElement("div"); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to end a page", e); } }
188189190191192193194195
assert !inParagraph; inParagraph = true; try { handler.startElement("p"); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to start a paragraph", e); } }
203204205206207208209210
assert inParagraph; inParagraph = false; try { handler.endElement("p"); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to end a paragraph", e); } }
212213214215216217218219220
@Override protected void writeString(String text) throws IOException { try { handler.characters(text); } catch (SAXException e) { throw new IOExceptionWithCause( "Unable to write a string: " + text, e); } }
222223224225226227228229230
@Override protected void writeCharacters(TextPosition text) throws IOException { try { handler.characters(text.getCharacter()); } catch (SAXException e) { throw new IOExceptionWithCause( "Unable to write a character: " + text.getCharacter(), e); } }
232233234235236237238239240
@Override protected void writeWordSeparator() throws IOException { try { handler.characters(getWordSeparator()); } catch (SAXException e) { throw new IOExceptionWithCause( "Unable to write a space character", e); } }
242243244245246247248249250
@Override protected void writeLineSeparator() throws IOException { try { handler.characters("\n"); } catch (SAXException e) { throw new IOExceptionWithCause( "Unable to write a newline character", e); } }
138139140141142143144145
@Override protected void startDocument(PDDocument pdf) throws IOException { try { handler.startDocument(); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to start a document", e); } }
149150151152153154155156
try { // Extract text for any bookmarks: extractBookmarkText(); handler.endDocument(); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to end a document", e); } }
158159160161162163164165166
@Override protected void startPage(PDPage page) throws IOException { try { handler.startElement("div", "class", "page"); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to start a page", e); } writeParagraphStart(); }