use of org.apache.tika.parser.pdf.PDFParser in project tika by apache.
the class DisplayMetInstance method getMet.
public static Metadata getMet(URL url) throws IOException, SAXException, TikaException {
Metadata met = new Metadata();
PDFParser parser = new PDFParser();
parser.parse(url.openStream(), new BodyContentHandler(), met, new ParseContext());
return met;
}
use of org.apache.tika.parser.pdf.PDFParser in project tika by apache.
the class JournalParser method parse.
public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException {
TikaInputStream tis = TikaInputStream.get(stream, new TemporaryResources());
File tmpFile = tis.getFile();
GrobidRESTParser grobidParser = new GrobidRESTParser();
grobidParser.parse(tmpFile.getAbsolutePath(), handler, metadata, context);
PDFParser parser = new PDFParser();
parser.parse(new FileInputStream(tmpFile), handler, metadata, context);
}
Aggregations