Category: Linux Terminal

Added: 3rd of August 2020

Viewed: 167 times

Convert a PDF document to text or html using pdftotext, pdftohtml in Linux using the terminal

Sometimes you might want to export text from a PDF file to a .txt file. For a single page it is probably quicker to select all then copy and paste the text, but if you have pages of information you can use a package called pdftotext.

To check if you already have pdftotext installed on your Ubuntu based distribution, open your terminal and enter the following

pdftotext -v


Here is the output from my system.
pdftotext version

To export text from your PDF file to .txt file enter the following command, filename being the name of the .pdf you want to export
pdftotext filename.pdf




You can also export the text and images in your PDF file to an .html document using the following command.
pdftohtml -c filename.pdf


Why would I use this
You might need to convert a pdf to html so that it can be uploaded to your webspace as well as providing a downloadable version in pdf format.





Other Tips & Tutorials

Linux Terminal

Create a new folder and file using the mkdir and touch commands using the terminal in Linux

Posted: 16th of August 2020

Views: 137

Linux Terminal

Convert a PDF document to text or html using pdftotext, pdftohtml in Linux using the terminal

Posted: 3rd of August 2020

Views: 167

Linux Terminal

List files in a directory using the ls command

Posted: 22nd of July 2020

Views: 168

Linux Terminal

How to access HP Linux Imaging and Printing System set up on Ubuntu using the terminal

Posted: 13th of November 2019

Views: 497

Linux Terminal

Where are the log files located in Linux

Posted: 16th of October 2019

Views: 563

Linux Terminal

Oracle VirtualBox, Unable to insert virtual optical disk

Posted: 11th of October 2019

Views: 1898

Linux Terminal

Oracle VirtualBox only displaying 32-bit version(s), when setting up new Virtual Machine on Linux

Posted: 11th of October 2019

Views: 657

Linux Terminal

The Linux uptime command

Posted: 3rd of October 2019

Views: 699

Linux Terminal

Using GParted in Linux to format a hard drive, flash drive, SD Card

Posted: 17th of September 2019

Views: 1024

Linux Terminal

Copy .iso image to USB flash drive using dd command in Linux using the terminal

Posted: 3rd of September 2019

Views: 282