Guest User

Untitled

a guest
Dec 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. package me
  2.  
  3. import java.io.{File, FileInputStream}
  4.  
  5. import org.apache.pdfbox.pdmodel.PDDocument
  6. import org.apache.pdfbox.tools.PDFText2HTML
  7.  
  8. object PDFtoHTML {
  9. def main(args: Array[String]): Unit = {
  10. val stream = new FileInputStream(new File("/Users/me/Downloads/example.pdf"))
  11. val document = PDDocument.load(stream)
  12. val converter = new PDFText2HTML()
  13. val html = converter.getText(document)
  14. println(html)
  15. document.close()
  16. stream.close()
  17. }
  18. }
Add Comment
Please, Sign In to add comment