PDF2TXT(1)

πŸ“¦
this version Β· 5 versions
, in epel 10, epel 9, fedora 43, fedora 44

✨ PDF2TXT ✨

okay bestie, gather round πŸ’– this is pdf2txt, the User Commands girlie who walks into your PDFs and walks out with the actual text and images. she does not gatekeep, she extracts. periodt.


🌸 NAME 🌸

pdf2txt β€” extract text and images from PDF πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

pdf2txt [-h] [--version] [--debug] [--disable-caching]
[--page-numbers PAGE_NUMBERS [PAGE_NUMBERS ...]]  [--pagenos PAGENOS]
[--maxpages MAXPAGES] [--password PASSWORD] [--rotation ROTATION]
[--no-laparams] [--detect-vertical] [--char-margin CHAR_MARGIN]
[--word-margin WORD_MARGIN] [--line-margin LINE_MARGIN]
[--boxes-flow BOXES_FLOW] [--all-texts] [--outfile OUTFILE]
[--output_type OUTPUT_TYPE] [--codec CODEC] [--output_dir OUTPUT_DIR]
[--layoutmode LAYOUTMODE] [--scale SCALE] [--strip-control] files
[files ...]

πŸ’œ DESCRIPTION πŸ’œ

so basically it's a command line tool that pulls text and images out of a PDF, and then outputs all of that as plain text, html, xml or tags. no cap, that's the whole job and she eats every time πŸ’…


✨ OPTIONS ✨

🫢 POSITIONAL ARGUMENTS

  • files β€” one or more paths to PDF files. (yes, plural, she's greedy in a cute way, give her all of them)

🌈 OPTIONAL ARGUMENTS

  • -h, --help β€” show a help message and exit. your little tutorial era 🧚
  • --version, -v β€” show the program's version number and exit. main character introduction.
  • --debug, -d β€” use debug logging level. she will literally tell you everything that's happening 😭
  • --disable-caching, -C β€” if caching of resources, such as fonts, should be disabled.

πŸ“ PARSER

used during PDF parsing β€” this is the part where she actually reads the file, bestie πŸ”₯

  • --page-numbers PAGE_NUMBERS [PAGE_NUMBERS ...] β€” a space-seperated list of page numbers to parse.
  • --pagenos PAGENOS, -p PAGENOS β€” a comma-separated list of page numbers to parse. this one is included for legacy applications; use --page-numbers for more idiomatic argument entry. (iykyk β€” old habits die hard πŸ’€)
  • --maxpages MAXPAGES, -m MAXPAGES β€” the maximum number of pages to parse.
  • --password PASSWORD, -P PASSWORD β€” the password to use for decrypting PDF file.
  • --rotation ROTATION, -R ROTATION β€” the number of degrees to rotate the PDF before other types of processing.

πŸ¦‹ LAYOUT ANALYSIS

used during layout analysis β€” aka her figuring out which squiggles belong together πŸ‘‘

  • --no-laparams, -n β€” if layout analysis parameters should be ignored.
  • --detect-vertical, -V β€” if vertical text should be considered during layout analysis
  • --char-margin CHAR_MARGIN, -M CHAR_MARGIN β€” if two characters are closer together than this margin they are considered to be part of the same line. the margin is specified relative to the width of the character.
  • --word-margin WORD_MARGIN, -W WORD_MARGIN β€” if two characters on the same line are further apart than this margin then they are considered to be two separate words, and an intermediate space will be added for readability. the margin is specified relative to the width of the character.
  • --line-margin LINE_MARGIN, -L LINE_MARGIN β€” if two lines are are close together they are considered to be part of the same paragraph. the margin is specified relative to the height of a line.
  • --boxes-flow BOXES_FLOW, -F BOXES_FLOW β€” specifies how much a horizontal and vertical position of a text matters when determining the order of lines. the value should be within the range of -1.0 (only horizontal position matters) to +1.0 (only vertical position matters). you can also pass None to disable advanced layout analysis, and instead return text based on the position of the bottom left corner of the text box.
lowkey the -1.0 to +1.0 range is not a suggestion bestie, stay inside it πŸ’…
  • --all-texts, -A β€” if layout analysis should be performed on text in figures.

πŸ’– OUTPUT

used during output generation β€” the glow-up phase, where it all becomes something you can actually read ✨

  • --outfile OUTFILE, -o OUTFILE β€” path to file where output is written. or - (default) to write to stdout.
  • --output_type OUTPUT_TYPE, -t OUTPUT_TYPE β€” type of output to generate {text,html,xml,tag}.
  • --codec CODEC, -c CODEC β€” text encoding to use in output file.
  • --output-dir OUTPUT_DIR, -O OUTPUT_DIR β€” the output directory to put extracted images in. if not given, images are not extracted. (no dir, no pics, that's the deal πŸ™ˆ)
  • --layoutmode LAYOUTMODE, -Y LAYOUTMODE β€” type of layout to use when generating html {normal,exact,loose}. if normal, each line is positioned separately in the html. if exact, each character is positioned separately in the html. if loose, same result as normal but with an additional newline after each text line. only used when output_type is html.
  • --scale SCALE, -s SCALE β€” the amount of zoom to use when generating html file. only used when output_type is html.
  • --strip-control, -S β€” remove control statement from text. only used when output_type is xml.

πŸ‘‘ SEE ALSO πŸ‘‘

dumppdf(1) β€” her sibling, also iconic, also doing the most πŸ’œ


and that's the whole page, bestie πŸŽ€ this vibe check was brought to you by the October 2021 edition of PDF2TXT(1) β€” go forth, extract, slay πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from