App-PDFUtils
view release on metacpan or search on metacpan
8. remove-pdf-password
FUNCTIONS
add_pdf_password
Usage:
add_pdf_password(%args) -> [$status_code, $reason, $payload, \%result_meta]
Password-protect PDF files.
This program is a wrapper for qpdf to password-protect PDF files
(in-place). This is the counterpart for remove-pdf-password. Why use
this wrapper instead of qpdf directly? This wrapper offers configuration
file support, where you can put the password(s) you want to use there.
The wrapper also offers multiple file support and additional options,
e.g. whether to create backup.
This function is not exported.
Arguments ('*' denotes required arguments):
* backup => *bool* (default: 1)
Whether to backup the original file to ORIG~.
* files* => *array[filename]*
(No description)
* password* => *str*
(No description)
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
compress_pdf
Usage:
compress_pdf(%args) -> [$status_code, $reason, $payload, \%result_meta]
Make PDF smaller.
This utility is a wrapper for gs (GhostScript) and is equivalent to the
following command:
% gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
This wrapper offers support for multiple files and automatically naming
output "INPUT.compressed.pdf" by default.
This function is not exported.
Arguments ('*' denotes required arguments):
* files* => *array[filename]*
(No description)
* overwrite => *bool*
(No description)
* setting => *str* (default: "ebook")
(No description)
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
convert_pdf_to_text
Usage:
convert_pdf_to_text(%args) -> [$status_code, $reason, $payload, \%result_meta]
Convert PDF file to text.
This utility uses one of the following backends:
* pdftotext
as well as optionally uses pdftk to manipulate PDF, and fmt to format
text. It offers some options and conveniences like page ranges, output
file specification, whether to overwrite existing files, etc.
TODO: add ocrmypdf as backend.
This function is not exported.
Arguments ('*' denotes required arguments):
* file* => *filename*
Input file.
* fmt => *bool*
Run Unix fmt over the txt output.
( run in 0.796 second using v1.01-cache-2.11-cpan-f56aa216473 )