Command line
The prasasti binary. Pull text out of a file, count its pages, or print what it knows about it.
prasasti text report.pdf -o report.txt --threads 0Install it with Cargo:
cargo install prasasti-cliprasasti text
Prints the text of every page, with pages split by a form feed (\f).
prasasti text report.pdf # to stdout
prasasti text report.pdf -o report.txt # to a file
prasasti text report.pdf | less| Flag | What it does |
|---|---|
-o, --output <file> | Write to a file instead of stdout |
-t, --threads <n> | Read pages on n threads. 0 uses every core. The default is 1. |
-p, --password <pw> | The password of an encrypted PDF |
prasasti count
Prints the number of pages.
$ prasasti count report.pdf
15prasasti info
Prints the format, the page count, whether the file was encrypted or rebuilt from damage, then its metadata.
$ prasasti info report.pdf
format: pdf
pages: 15
encrypted: false
recovered: false
Title: Quarterly report
Author: Finance teamcount and info don't take a password yet, so they only open files with an empty user password.
Exit codes
| Code | Meaning |
|---|---|
0 | Done |
1 | The file couldn't be opened or written. The reason is on stderr, after error:. |
2 | The command or its arguments are wrong. Usage is printed on stderr. |