222223224225226227228229
} } } handler.endElement("div"); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to end a page", e); } }
238239240241242243244245
assert !inParagraph; inParagraph = true; try { handler.startElement("p"); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to start a paragraph", e); } }
253254255256257258259260
assert inParagraph; inParagraph = false; try { handler.endElement("p"); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to end a paragraph", e); } }
262263264265266267268269270
@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); } }
272273274275276277278279280
@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); } }
282283284285286287288289290
@Override protected void writeWordSeparator() throws IOException { try { handler.characters(getWordSeparator()); } catch (SAXException e) { throw new IOExceptionWithCause( "Unable to write a space character", e); } }
292293294295296297298299300
@Override protected void writeLineSeparator() throws IOException { try { handler.newline(); } catch (SAXException e) { throw new IOExceptionWithCause( "Unable to write a newline character", e); } }
107108109110111112113114
@Override protected void startDocument(PDDocument pdf) throws IOException { try { handler.startDocument(); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to start a document", e); } }
116117118119120121122123
@Override protected void endDocument(PDDocument pdf) throws IOException { try { handler.endDocument(); } catch (SAXException e) { throw new IOExceptionWithCause("Unable to end a document", e); } }
125126127128129130131132133
@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(); }