Facebook Twitter Instagram
    WiredRevolution.com
    • Home
    • About
    • Contact Us
    • Essential Linux Commands
    • Sitemap
    Facebook Twitter Instagram
    WiredRevolution.com
    commands

    Convert PDF file to text with pdftotext

    RyanBy RyanSeptember 9, 2010Updated:September 9, 20101 Min Read
    Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Email

    In many cases it can be helpful to access text from within a PDF file but accomplishing this can be next to impossible. Luckily in Linux there is a command line program called pdftotext which is included with the xpdf package.

    This first step is making sure that the xpdf package is installed. In Ubuntu you can use the following command.
    $ sudo apt-get install xpdf

    Now you can convert a PDF to text with pdftotext. This code will output a file named &#60filename&#62.txt
    $ pdftotext <filename>.pdf

    You can also attempt to preserve some of the formatting within the PDF such as columns and spacing by using the “-layout” option.
    $ apdftotext -layout <filename>.pdf

    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Email
    Previous ArticleMount a VirtualBox shared folder inside a guest VM
    Next Article Change hostname on RedHat

    Related Posts

    Google Chrome Text Highlight Searching and Navigation

    YouTube Begins Transcoding All Video to WEBM

    Echo text without a trailing newline

    Most Commented
    March 12, 2009

    Fix blue tinted video in Ubuntu

    September 10, 2010

    Setup SSH access between VirtualBox Host and Guest VMs

    March 8, 2011

    Install GNOME Shell in Ubuntu 10.10 Maverick

    April 4, 2009

    Setup the PS3 Bluetooth Controller on Ubuntu

    October 22, 2008

    How to correctly use LD_LIBRARY_PATH

    Recent Comments
    • Execute command on linux virtual machine (or server) from windows commandline on Setup SSH access between VirtualBox Host and Guest VMs
    • Solved: How to SSH to a VirtualBox guest externally through a host? - Daily Developer Blog on Setup SSH access between VirtualBox Host and Guest VMs
    • How to SSH to a VirtualBox guest externally through a host? [closed] – Code D3 on Setup SSH access between VirtualBox Host and Guest VMs
    • How to copy and paste from VirtualBox? [duplicate] on Setup SSH access between VirtualBox Host and Guest VMs
    • Jackie Laguna on Fix OpenGL: ChoosePixelFormat SketchUp error in WINE
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.