Forrest logo
back to the pdftotext tool

pdftotext:tldr:3c83b

pdftotext: Convert `filename.pdf` to plain text and preserve the layout.
$ pdftotext -layout ${filename-pdf}
try on your machine

The command pdftotext -layout ${filename-pdf} is used to convert a PDF document into plain text format while trying to preserve the layout of the original document.

Here's a breakdown of the command:

  • pdftotext: It is a command-line tool used to convert PDF files to plain text.
  • -layout: This option specifies that the tool should attempt to maintain the layout of the original PDF document in the extracted text. This includes preserving columns, tables, and multi-column text formatting.
  • ${filename-pdf}: This is a placeholder for the actual name of the PDF file that you want to convert. It should be replaced with the appropriate file name and path.

Overall, running this command will extract the text from the specified PDF file while trying to retain the original formatting and layout.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pdftotext tool