This program is a wrapper for L<qpdf> to password-protect PDF files
(in-place). This is the counterpart for L<remove-pdf-password>. Why use this
wrapper instead of B<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):
=over 4
=item * B<backup> => I<bool> (default: 1)
Whether to backup the original file to ORIG~.
=item * B<files>* => I<array[filename]>
(No description)
=item * B<password>* => I<str>
(No description)
=back
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.
This wrapper offers support for multiple files and automatically naming output
C<INPUT.compressed.pdf> by default.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<files>* => I<array[filename]>
(No description)
=item * B<overwrite> => I<bool>
(No description)
=item * B<setting> => I<str> (default: "ebook")
(No description)
=back
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.
as well as optionally uses L<pdftk> to manipulate PDF, and L<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):
=over 4
=item * B<file>* => I<filename>
Input file.
=item * B<fmt> => I<bool>
Run Unix fmt over the txt output.
=item * B<output> => I<filename>
Output path.
=item * B<overwrite> => I<bool>
(No description)
=item * B<pages> => I<uint_range>
Only convert a range of pages.
=item * B<raw> => I<bool>
If set to true, will run pdftotext with -raw option.
=item * B<return_output_file> => I<bool>
Return the path of output file instead.
This is useful when you do not specify an output file but do not want to show
the converted document to stdout, but instead want to get the path to a
temporary output file.
=back
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.
This is a wrapper for C<qpdf --check>. The wrapper offers additional options like
`--quiet``.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<file>* => I<filename>
Input file.
=item * B<quiet> => I<bool>
(No description)
=back
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.
This program is a wrapper for L<qpdf> to remove passwords from PDF files
(in-place).
The motivation for this wrapper is the increasing occurence of financial
institutions sending financial statements or documents in the format of
password-protected PDF file. This is annoying when we want to archive the file
or use it in an organization because we have to remember different passwords for
different financial institutions and re-enter the password everytime we want to
use the file. (The banks could've sent the PDF in a password-protected .zip, or
use PGP-encrypted email, but I digress.)
Compared to using B<qpdf> directly, this wrapper offers some additional
features/options and convenience, for example: multiple file support, multiple
password matching attempt, configuration file, option whether you want backup,
etc.
You can provide the passwords to be tried in a configuration file,
C<~/remove-pdf-password.conf>, e.g.:
passwords = pass1
passwords = pass2
passwords = pass3
or:
passwords = ["pass1", "pass2", "pass3"]
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<backup> => I<bool> (default: 1)
Whether to backup the original file to ORIG~.
=item * B<files>* => I<array[filename]>
(No description)
=item * B<passwords> => I<array[str]>
(No description)
=back
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.