PDFALTOSaxHandler extends DefaultHandler { public List<LayoutToken> getTokenization() { return tokenizations; } PDFALTOSaxHandler(Document d, List<GraphicObject> im); void setAnalyzer(Analyzer analyzer); Analyzer getAnalyzer(); List<LayoutToken> getTokenization(); void characters(char[] ch, int start, int length); String trimAndNormaliseText(String content); void endElement(String uri, String localName,
			String qName); void endDocument(); void startElement(String namespaceURI, String localName,
			String qName, Attributes atts); static final Logger LOGGER; }
@Test public void testParsing_pdf2XMLwithNoIMages_ShouldWork() throws Exception { InputStream is = this.getClass().getResourceAsStream("pdfalto_noImages.xml"); SAXParser p = spf.newSAXParser(); p.parse(is, target); List<LayoutToken> tokenList = target.getTokenization(); assertTrue(tokenList.size() > 0); assertTrue(document.getImages().size() == 0); assertTrue(images.size() == 0); assertTrue(document.getPages().size() == 4); assertTrue(document.getBlocks().size() == 26); }
@Test public void testParsing_pdf2XMLwithIMages_ShouldWork() throws Exception { InputStream inputStream = this.getClass().getResourceAsStream("pdfalto_Images.xml"); SAXParser p = spf.newSAXParser(); p.parse(inputStream, target); List<LayoutToken> tokenList = target.getTokenization(); assertTrue(tokenList.size() > 0); assertThat(images.size(), is(16)); assertThat(document.getImages().size(), is(16)); assertTrue(document.getPages().size() == 4); assertTrue(document.getBlocks().size() == 26); }