Do you want to convert pdf file to text file?. As you know you can easily convert pdf files in Window but what about Linux?. Don’t worry friends, you can also convert any pdf file into the editable text file using pdftotext in the Linux-based operating system.
Basically, pdftotext is a command line file converter which is a part of poppler utility package. So first we have to check and install poppler utility package and then start your file conversion. Just have a glance at this article to find out how to convert pdf file to text file in Ubuntu 14.04.
Steps to convert pdf file to text file:
Step 1: First open your terminal and then type: “dpkg -s poppler -utils”. This command may check ‘poppler utility’ package on your system.
Step 2: If your system doesn’t contain this package, then type “sudo apt-get install poppler -utils” to install poppler utility package. Type your password when prompted.
Step 3: Type: “pdftotext /home/teckpix/documents/sample.pdf /home/teckpix/Documents/sample.txt” and press enter. This command may change your pdf file to text file. (Note: Here source file is not deleted, although a new text file is created having the name provided by you, as in our case it is “sample.txt”)
Step 4: You’ll see a sample.txt file has been created under your document folder as shown in the image below.
Step 5: Now, click on that text file and you may see all the data of your pdf file into this text file.
Step 6: If you want to copy the layout of your pdf file in a text file, then type: pdftotext -layout /home/teckpix/Documents/sample.pdf /home/teckpix/Documents/sample.txt.
Step 7: If you want to convert particular pages into text format then you can use: “pdftotext -f 5 -l 9 /home/teckpix/Documents/sample.pdf /home/teckpix/Documents/sample.txt”.
Step 8: Type: “pdftotext -opw ‘password’ /home/teckpix/Documents/sample.pdf /home/teckpix/Documents/sample.txt” to create your text file encrypted with owner password.
Step 9: Type: “pdftotext -upw ‘password’ /home/teckpix/Documents/sample.pdf /home/teckpix/Documents/sample.txt” to create your text file encrypted with user protected password.
Step 10: Type: “pdftotext -eol ‘password’ /home/teckpix/Documents/sample.pdf /home/teckpix/Documents/sample.txt”. This command is used to convert line endings where “eol” represents end of the line.
That’s all friends. Keep reading.