File: commandline.rst

package info (click to toggle)
pdfminer 20260107%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,476 kB
  • sloc: python: 20,633; xml: 360; makefile: 93; sh: 35
file content (41 lines) | stat: -rw-r--r-- 994 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.. _tutorial_commandline:

Extract text from a PDF using the commandline
*********************************************

pdfminer.six has several tools that can be used from the command line. The
command-line tools are aimed at users that occasionally want to extract text
from a pdf.

Take a look at the high-level or composable interface if you want to use
pdfminer.six programmatically.

Examples
========

pdf2txt.py
----------

::

    $ pdf2txt.py example.pdf
    all the text from the pdf appears on the command line

The :ref:`api_pdf2txt` tool extracts all the text from a PDF. It uses layout
analysis with sensible defaults to order and group the text in a sensible way.

dumppdf.py
----------

::

    $ dumppdf.py -a example.pdf
    <pdf><object id="1">
    ...
    </object>
    ...
    </pdf>

The :ref:`api_dumppdf` tool can be used to extract the internal structure from a
PDF. This tool is primarily for debugging purposes, but that can be useful to
anybody working with PDF's.