Created
May 13, 2020 19:09
-
-
Save ichramm/11ef27a35c3fa3655d23fd14465c0803 to your computer and use it in GitHub Desktop.
extract pdf text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import org.apache.pdfbox.pdmodel.PDDocument) | |
(import org.apache.pdfbox.text.PDFTextStripper) | |
(import java.net.URL) | |
(defn extract-pdf-text | |
[url] | |
(with-open [pd (PDDocument/load (.openStream (URL. url)))] | |
(let [stripper (PDFTextStripper.)] | |
(.getText stripper pd)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extract HTML instead of plain text: