# Reading .pdf from the command line?



## 1-800-It's-NOT-UNIX (Jul 21, 2018)

I've done a bit of research, but was hoping that someone here could point me in the right direction, just in case I missed something. Coming from GNU/Linux, there was a program called "pdftotext". I can't find anything comparable to that on FreeBSD. I've also tried using various other programs and approaches mentioned online, to no avail, that all seem geared more to the penguin system. Is there a program that can convert a .pdf to readable text in a non-GUI environment? Something along the lines of `pdftotext -layout foo.pdf - | less` ? Thank you.


----------



## ShelLuser (Jul 21, 2018)

Well, there is textproc/pdftohtml which does one part. After that you could try using textproc/html2text for the last step of the process.


----------



## obsigna (Jul 21, 2018)

1-800-It's-NOT-UNIX said:


> ... ? Something along the lines of `pdftotext -layout foo.pdf - | less` ? Thank you.



pdftotext(1) is part of the port graphics/poppler-utils. Simply execute `pkg install poppler-utils` and you could continue using pdftotext.


----------



## 1-800-It's-NOT-UNIX (Jul 21, 2018)

Thank you for the replies, ShelLuser and obsigna. I'm back up and .pdf'ing in the CLI as I post this.


----------

