Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds details on options parameter for saveToBuffer. #127

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 79 additions & 1 deletion docs/classes/PDFDocument.rst
Original file line number Diff line number Diff line change
@@ -590,7 +590,85 @@ PDFDocument

.. code-block:: javascript

var buffer = pdfDocument.saveToBuffer();
var buffer = pdfDocument.saveToBuffer("garbage=2,compress=yes,user-password=PASSWORD")

The options which you can use to compose your string parameter are as follows:

.. list-table::
:header-rows: 1

* - **Name**
- **Description**
- **Values**
- **Default**
* - `decompress`
- Decompress all streams (except compress-fonts/images).
- `yes` | `no`
- `no`
* - `compress`
- Compress all streams.
- `yes` | `no`
- `no`
* - `compress-fonts`
- Compress embedded fonts.
- `yes` | `no`
- `no`
* - `compress-images`
- Compress images.
- `yes` | `no`
- `no`
* - `ascii`
- ASCII hex encode binary streams.
- `yes` | `no`
- `no`
* - `pretty`
- Pretty-print objects with indentation.
- `yes` | `no`
- `no`
* - `clean`
- Pretty-print graphics commands in content streams.
- `yes` | `no`
- `no`
* - `sanitize`
- Sanitize graphics commands in content streams.
- `yes` | `no`
- `no`
* - `incremental`
- Write changes as incremental update.
- `yes` | `no`
- `no`
* - `continue-on-error`
- Continue saving the document even if there is an error.
- `yes` | `no`
- `no`
* - `garbage`
- Garbage collect unused objects.
- `yes` | `compact` (and compact cross reference table.) | `deduplicate` (and remove duplicate objects.)
- `no`
* - `decrypt`
- Write unencrypted document.
- `yes` | `no`
- `no`
* - `encrypt`
- Write encrypted document.
- `rc4-40` | `rc4-128` | `aes-128` | `aes-256`
- `no`
* - `permissions`
- Document permissions to grant when encrypting.
- `number`, see `PDF Reference 1.7`_ - page 123, table 3.20
- `no`
* - `user-password`
- Password required to read document.
- *your password*
-
* - `owner-password`
- Password required to edit document.
- *your password*
-
* - `regenerate-id`
- Regenerate document id.
- `yes` | `no`
- `yes`

----

2 changes: 1 addition & 1 deletion docs/footer.rst
Original file line number Diff line number Diff line change
@@ -136,6 +136,6 @@
.. _Wasm:
.. _WebAssembly: https://webassembly.org
.. _Node.js: https://nodejs.org/

.. _PDF Reference 1.7: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.7old.pdf