EnglishFrenchSpanish

OnWorks favicon

pdf2txt - Online in the Cloud

Run pdf2txt in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command pdf2txt that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


pdf2txt - extracts text contents of PDF files

SYNOPSIS


pdf2txt [option...] file...

DESCRIPTION


pdf2txt extracts text contents from a PDF file. It extracts all the text that is to be
rendered programmatically, i.e. text represented as ASCII or Unicode strings. It cannot
recognize text drawn as images that would require optical character recognition. It also
extracts the corresponding locations, font names, font sizes, writing direction
(horizontal or vertical) for each text portion. You need to provide a password for
protected PDF documents when its access is restricted. You cannot extract any text from a
PDF document which does not have extraction permission.

OPTIONS


-o file
Specifies the output file name. The default is to print the extracted contents to
standand output in text format.

-p pageno[,pageno,...]
Specifies the comma-separated list of the page numbers to be extracted. Page numbers
start at one. By default, it extracts text from all the pages.

-c codec
Specifies the output codec.

-t type
Specifies the output format. The following formats are currently supported:

text
Text format. This is the default.

html
HTML format. It is not recommended.

xml
XML format. It provides the most information.

tag
“Tagged PDF” format. A tagged PDF has its own contents annotated with HTML-like
tags. pdf2txt tries to extract its content streams rather than inferring its text
locations. Tags used here are defined in the PDF Reference, Sixth Edition[1]
(§10.7 “Tagged PDF”).

-D writing-mode
Specifies the writing mode of text outputs:

lr-tb
Left-to-right, top-to-bottom.

tb-rl
Top-to-bottom, right-to-left.

auto
Determine writing mode automatically

-M char-margin, -L line-margin, -W word-margin
These are the parameters used for layout analysis. In an actual PDF file, text
portions might be split into several chunks in the middle of its running, depending on
the authoring software. Therefore, text extraction needs to splice text chunks. In the
figure below, two text chunks whose distance is closer than the char-margin is
considered continuous and get grouped into one. Also, two lines whose distance is
closer than the line-margin is grouped as a text box, which is a rectangular area that
contains a “cluster” of text portions. Furthermore, it may be required to insert blank
characters (spaces) as necessary if the distance between two words is greater than the
word-margin, as a blank between words might not be represented as a space, but
indicated by the positioning of each word.

Each value is specified not as an actual length, but as a proportion of the length to
the size of each character in question. The default values are char-margin = 1.0,
line-margin = 0.3, and W = 0.2, respectively.

-n
Suppress layout analysis.

-A
Force layout analysis for all the text strings, including text contained in figures.

-V
Enable detection of vertical writing.

-s scale
Specifies the output scale. This option can be used in HTML format only.

-m n
Specifies the maximum number of pages to extract. By default, all the pages in a
document are extracted.

-P password
Provides the user password to access PDF contents.

-d
Increase the debug level.

EXAMPLES


Extract text as an HTML file whose filename is output.html:

$ pdf2txt -o output.html samples/naacl06-shinyama.pdf

Extract a Japanese HTML file in vertical writing:

$ pdf2txt -c euc-jp -D tb-rl -o output.html samples/jo.pdf

Extract text from an encrypted PDF file:

$ pdf2txt -P mypassword -o output.txt secret.pdf

Use pdf2txt online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Psi
    Psi
    Psi is cross-platform powerful XMPP
    client designed for experienced users.
    There are builds available for MS
    Windows, GNU/Linux and macOS.. Audience:
    End Users...
    Download Psi
  • 2
    Blobby Volley 2
    Blobby Volley 2
    Official continuation of the famous
    Blobby Volley 1.x arcade game..
    Audience: End Users/Desktop. User
    interface: OpenGL, SDL. Programming
    Language: C++, Lua. C...
    Download Blobby Volley 2
  • 3
    SuiteCRM
    SuiteCRM
    SuiteCRM is the award-winning Customer
    Relationship Management (CRM)
    application brought to you by authors
    and maintainers, SalesAgility. It is the
    world�s mos...
    Download SuiteCRM
  • 4
    Poweradmin
    Poweradmin
    Poweradmin is a web-based DNS
    administration tool for PowerDNS server.
    The interface has full support for most
    of the features of PowerDNS. It has full
    support...
    Download Poweradmin
  • 5
    Gin Web Framework
    Gin Web Framework
    Gin is an incredibly fast web framework
    written in Golang that can perform up to
    40 times faster, thanks to its
    martini-like API and custom version of
    httprout...
    Download Gin Web Framework
  • 6
    CEREUS LINUX
    CEREUS LINUX
    CEREUS LINUX basado en MX LINUX con
    varios entornos de escritorios. This is
    an application that can also be fetched
    from
    https://sourceforge.net/projects/cereu...
    Download CEREUS LINUX
  • More »

Linux commands

  • 1
    aa-clickquery
    aa-clickquery
    aa-clickquery - program for querying
    click-apparmor DESCRIPTION: This program
    is used to query click-apparmor for
    information. USAGE: aa-clickquery
    --click-fra...
    Run aa-clickquery
  • 2
    aa-exec-click
    aa-exec-click
    aa-exec-click - program for executing
    click packages under confinement
    DESCRIPTION: This program is used to
    execute click package under AppArmor
    confinement. I...
    Run aa-exec-click
  • 3
    cpio
    cpio
    cpio - copy files to and from archives ...
    Run cpio
  • 4
    cpipe
    cpipe
    cpipe - copy stdin to stdout while
    counting bytes and reporting progress ...
    Run cpipe
  • 5
    FvwmSave
    FvwmSave
    FvwmSave - the Fvwm desktop-layout
    saving module ...
    Run FvwmSave
  • 6
    FvwmSave1
    FvwmSave1
    FvwmSave - the FVWM desktop-layout
    saving module ...
    Run FvwmSave1
  • More »

Ad