Extractor { public void disableOcr() { if (!ocrDisabled) { excludeParser(TesseractOCRParser.class); ocrDisabled = true; pdfConfig.setExtractInlineImages(false); } } Extractor(final DocumentFactory factory);  Extractor(); Extractor configure(final Options<String> options); void setOutputFormat(final OutputFormat outputFormat); OutputFormat getOutputFormat(); void setEmbedHandling(final EmbedHandling embedHandling); EmbedHandling getEmbedHandling(); void setEmbedOutputPath(final Path embedOutput); Path getEmbedOutputPath(); void setOcrLanguage(final String ocrLanguage); void setOcrTimeout(final Duration duration); void setDigestAlgorithm(final String digestAlgorithm); void setDigester(final DigestingParser.Digester digester); void disableOcr(); void extract(final Path path, final Spewer spewer); void extract(final Path path, final Spewer spewer, final Reporter reporter); TikaDocument extract(final Path path);  }
@Test public void testDisableOcr() throws Throwable { extractor.disableOcr(); TikaDocument tikaDocument = extractor.extract(Paths.get(getClass().getResource("/documents/ocr/simple.tiff").getPath())); final int read = tikaDocument.getReader().read(); Assert.assertEquals("image/tiff", tikaDocument.getMetadata().get(Metadata.CONTENT_TYPE)); Assert.assertEquals(-1, read); }