### Build and Install PDFtk from Source RPM on Red Hat/CentOS Source: https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos Guides users through building a PDFtk Server binary RPM from a source RPM. It involves setting up the RPM build environment, installing development tools like gcc and java compilers, rebuilding the source RPM, and then installing the generated binary RPM. ```bash sudo yum install gcc gcc-java libgcj libgcj-devel gcc-c++ rpmbuild --rebuild pdftk-2.02-1.el6.src.rpm sudo rpm -i pdftk-2.02-1.*.rpm ``` -------------------------------- ### Install PDFtk using Binary RPM on Red Hat/CentOS Source: https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos Installs PDFtk Server by first installing the 'libgcj' dependency using yum, followed by installing the downloaded PDFtk RPM package. This is the recommended method for most users. ```bash sudo yum install libgcj sudo rpm -i pdftk-2.02-1.*.rpm ``` -------------------------------- ### Build and Install PDFtk from Source Code on Red Hat/CentOS Source: https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos Details the process of compiling PDFtk Server directly from its source code. This method requires installing development tools, downloading and unzipping the source archive, and using make commands to build and install the executable. It also mentions a potential memory issue during compilation. ```bash sudo yum install gcc gcc-java libgcj libgcj-devel gcc-c++ wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip unzip pdftk-2.02-src.zip cd pdftk-2.02-dist/pdftk make -f Makefile.Redhat sudo make -f Makefile.Redhat install ``` -------------------------------- ### GPL Interactive Program Startup Notice Source: https://www.pdflabs.com/docs/pdftk-license/gnu_general_public_license_2 This snippet shows the recommended output for a program that starts in interactive mode when licensed under the GNU GPL. It displays version, copyright, warranty information, and details on redistribution. ```text Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Join PDF Files using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Concatenates multiple PDF files into a single output file. Supports direct file listing, using handles for clarity, and wildcard matching for all PDFs in a directory. ```bash pdftk in1.pdf in2.pdf cat output out1.pdf ``` ```bash pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf ``` ```bash pdftk *.pdf cat output combined.pdf ``` ```bash pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf ``` -------------------------------- ### Dump PDF Data using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Extracts metadata and bookmark information from a PDF document and writes it to a text file. Useful for reporting or analyzing document content. ```bash pdftk in.pdf dump_data output report.txt ``` -------------------------------- ### Burst PDF into Pages using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Splits a single PDF document into individual pages, creating a separate file for each page. Can also apply encryption and permissions to the burst pages. ```bash pdftk in.pdf burst ``` ```bash pdftk in.pdf burst owner_pw foopass allow DegradedPrinting ``` -------------------------------- ### Repair PDF using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Attempts to fix corrupted PDF files by repairing the Cross-Reference table and stream lengths. Outputs a potentially fixed version of the PDF. ```bash pdftk broken.pdf output fixed.pdf ``` -------------------------------- ### Decrypt PDF using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Removes password protection from a PDF file. Requires the original password to be provided as input. ```bash pdftk secured.pdf input_pw foopass output unsecured.pdf ``` -------------------------------- ### Collate PDF Pages using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Combines PDF pages from multiple files into a single collated document. It supports standard collation and also handles cases where one of the input files is in reverse order. ```bash pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf ``` ```bash pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdf ``` -------------------------------- ### GPL Notice for Interactive Programs Source: https://www.pdflabs.com/docs/pdftk-license/gnu_general_public_license_3 This snippet demonstrates the short notice to be displayed when a program starts in interactive mode. It includes copyright information, a clear statement of no warranty, and instructions for users to access details about redistribution rights and conditions. ```text Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Uncompress PDF Streams using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Removes compression from PDF page streams, making the PDF content editable in a text editor. Outputs an uncompressed version of the PDF. ```bash pdftk doc.pdf output doc.unc.pdf uncompress ``` -------------------------------- ### Encrypt PDF using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Secures a PDF file with password protection and optionally restricts permissions. Supports 128-bit encryption by default and allows setting owner and user passwords, along with print permissions. ```bash pdftk 1.pdf output 1.128.pdf owner_pw foopass ``` ```bash pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz ``` ```bash pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printing ``` ```bash pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass ``` -------------------------------- ### Remove PDF Pages using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Creates a new PDF file excluding specific pages from an original document. Allows removal of single pages or ranges of pages. ```bash pdftk in.pdf cat 1-12 14-end output out1.pdf ``` ```bash pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf ``` -------------------------------- ### Set Page Size and Orientation with STAMPtk Source: https://www.pdflabs.com/docs/how-to-add-headers-footers-watermarks-and-stamps-to-pdf Demonstrates how to specify the page size and orientation for a STAMPtk-generated PDF. The `media` option sets the page size (e.g., 'A4'), and appending 'Landscape' changes the orientation. For example, `AAmedia=A4Landscape` creates an A4-sized landscape page. ```bash AAmedia=A4 ``` ```bash AAmedia=A4Landscape ``` -------------------------------- ### Rotate PDF Pages using PDFtk Source: https://www.pdflabs.com/docs/pdftk-cli-examples Rotates specific pages or the entire document by a specified degree (e.g., 90, 180). Supports rotating individual pages or ranges, and applying rotations clockwise or to specific orientations. ```bash pdftk in.pdf cat 1east 2-end output out.pdf ``` ```bash pdftk in.pdf cat 1-endsouth output out.pdf ``` -------------------------------- ### pdftk - Output to Standard Output (stdout) Source: https://www.pdflabs.com/docs/pdftk-version-history This example illustrates how to direct the output of pdftk operations to standard output (stdout) by using '-' as the output filename. This is useful for piping the processed PDF data to other tools or for immediate viewing without saving to a file. ```shell pdftk input.pdf cat 1 output - | less ``` -------------------------------- ### Add Multiple Text Elements to a Stamp with STAMPtk Source: https://www.pdflabs.com/docs/how-to-add-headers-footers-watermarks-and-stamps-to-pdf Illustrates creating a stamp PDF with multiple text elements using STAMPtk. Different text elements are added using distinct prefixes (e.g., `AA` and `BB`). This example adds a translucent 'DRAFT' stamp and a smaller, solid red 'Latest' text, positioned at the top-left. The `alpha` option applies globally to all text in the output PDF. ```bash stamptk alpha=0.4 AAtext="DRAFT" AApos=center,center AAsize=100 AAangle=NE AAfont=sansBold BBtext="Latest" BBsize=50 BBcolor=255,0,0 BBorigin=left,top BBpos=left,top output=stamp.pdf ``` -------------------------------- ### pdftk - Handling Duplicate Form Field Names Source: https://www.pdflabs.com/docs/pdftk-version-history This example showcases pdftk's enhanced form field handling when combining PDF pages. It addresses the issue of duplicate form field names, which are invalid in PDF format. pdftk now detects these duplicates and automatically adds prefixes to ensure uniqueness, while preserving fields represented by multiple annotations. ```shell pdftk A=form.pdf cat A A A output formX3.pdf ``` -------------------------------- ### GPL License Notice for Source Files Source: https://www.pdflabs.com/docs/pdftk-license/gnu_general_public_license_2 This code snippet provides the standard text to be included at the beginning of each source file in a program licensed under the GNU General Public License. It includes copyright information, redistribution rights, and warranty disclaimers. ```text Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ``` -------------------------------- ### Copyright Disclaimer Sample Source: https://www.pdflabs.com/docs/pdftk-license/gnu_general_public_license_2 This is a sample copyright disclaimer that an employer or school might sign to disclaim copyright interest in a program written by an employee or student. It should be adapted with specific names and dates. ```text Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice ``` -------------------------------- ### GPL Notice for Source Files Source: https://www.pdflabs.com/docs/pdftk-license/gnu_general_public_license_3 This code snippet provides the standard GNU GPL notice to be included at the beginning of each source file. It includes copyright information, license terms, warranty disclaimers, and a pointer to the full license text. This ensures compliance and informs users about their rights and obligations. ```text Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ``` -------------------------------- ### pdftk - Inputting Files via Standard Input (stdin) Source: https://www.pdflabs.com/docs/pdftk-version-history This snippet shows how pdftk supports reading input PDF, FDF, or Info files directly from standard input (stdin). This feature, contributed via a patch, allows for more flexible data piping and integration with other command-line tools without requiring temporary files. ```shell cat input.pdf | pdftk - dump_data_fields ``` -------------------------------- ### Set User Password (user_pw) Source: https://www.pdflabs.com/docs/pdftk-man-page Sets the user password for the output PDF. If encryption is enabled but no passwords are provided, the owner and user passwords remain empty, allowing anyone to alter security settings. ```shell pdftk in.pdf user_pw myuserpassword output out.pdf ``` -------------------------------- ### Overlay PDF Pages with PDFtk (multistamp) Source: https://www.pdflabs.com/docs/how-to-add-headers-footers-watermarks-and-stamps-to-pdf Demonstrates how to overlay one PDF's pages onto another using PDFtk's `multistamp` command. This is useful for applying stamps or watermarks to entire documents. The stamp PDF can have multiple pages, and its pages are applied sequentially to the target PDF. ```bash pdftk in.pdf multistamp stamp.pdf output out.pdf ``` -------------------------------- ### Set Owner Password (owner_pw) Source: https://www.pdflabs.com/docs/pdftk-man-page Sets the owner password for the output PDF. If encryption is enabled but no passwords are provided, the owner and user passwords remain empty, allowing anyone to alter security settings. ```shell pdftk in.pdf owner_pw myownerpassword output out.pdf ``` -------------------------------- ### Encrypt PDF (40-bit or 128-bit) Source: https://www.pdflabs.com/docs/pdftk-man-page Encrypts the output PDF. Defaults to 128-bit encryption if user or owner passwords are provided. Can be explicitly set to 40-bit using 'encrypt_40bit'. ```shell pdftk in.pdf encrypt_128bit owner_pw mypassword user_pw mypassword output out.pdf ``` ```shell pdftk in.pdf encrypt_40bit output out.pdf ``` -------------------------------- ### Create a Translucent Text Stamp with STAMPtk Source: https://www.pdflabs.com/docs/how-to-add-headers-footers-watermarks-and-stamps-to-pdf Shows how to create a translucent text stamp (e.g., 'DRAFT') using STAMPtk. The `alpha` option controls transparency, `AAtext` sets the text content, `AApos` its position, `AAsize` its size, `AAangle` its orientation, and `AAfont` its typeface. The output is saved as a PDF. ```bash stamptk alpha=0.4 AAtext="DRAFT" AApos=center,center AAsize=100 AAangle=NE AAfont=sansBold output=stamp.pdf ``` -------------------------------- ### pdftk - Interactive vs. Non-Interactive Modes Source: https://www.pdflabs.com/docs/pdftk-version-history This demonstrates the different operating modes of pdftk: 'do_ask' (interactive, default on Windows) and 'dont_ask' (non-interactive, default on Linux). The interactive mode prompts the user before overwriting files or requesting passwords, while the non-interactive mode is suitable for automated, hands-free processing. ```shell # Interactive mode (Windows default) pdftk --prompt_password input.pdf output output.pdf # Non-interactive mode (Linux default) pdftk --overwrite_if_exists input.pdf output output.pdf ``` -------------------------------- ### pdftk - Background Operation for Rotated Pages Source: https://www.pdflabs.com/docs/pdftk-version-history This illustrates the 'background' operation in pdftk, designed to overlay a background PDF onto existing PDF pages. The improvement ensures that rotated pages, whether in the input or background PDF, are handled correctly, preserving their orientation in the output. This provides users with greater control over the final document's layout. ```shell pdftk input.pdf background background.pdf output output.pdf ``` -------------------------------- ### Unpack Files from PDF (unpack_files) Source: https://www.pdflabs.com/docs/pdftk-man-page Extracts all attached files from a PDF to the current folder or a specified output directory. The output directory can be set explicitly or interactively. ```shell pdftk report.pdf unpack_files output ~/atts/ ``` ```shell pdftk report.pdf unpack_files output PROMPT ``` -------------------------------- ### pdftk - Adding New Output Options: background, flatten Source: https://www.pdflabs.com/docs/pdftk-version-history This snippet points to the introduction of two new output options in pdftk: 'background' for overlaying one PDF onto another, and 'flatten' for merging annotations and form fields into the PDF content, making them non-editable. These options provide more control over the final appearance and editability of the PDF. ```shell # Example of background operation pdftk doc.pdf background watermark.pdf output output_with_background.pdf # Example of flatten operation pdftk form.pdf fill_form data.fdf flatten output flattened_form.pdf ``` -------------------------------- ### Set PDF Permissions (allow) Source: https://www.pdflabs.com/docs/pdftk-man-page Applies specific permissions to the output PDF, but only if an encryption strength is specified or passwords are provided. If not specified, defaults to 'none', disabling all features. Available permissions include Printing, DegradedPrinting, ModifyContents, Assembly, CopyContents, ScreenReaders, ModifyAnnotations, FillIn, and AllFeatures. ```shell pdftk in.pdf allow Printing DegradedPrinting ModifyContents owner_pw pass output out.pdf ``` -------------------------------- ### Enable Verbose Output (verbose) Source: https://www.pdflabs.com/docs/pdftk-man-page Appends 'verbose' to a pdftk command to enable detailed, chatty output, providing more information about the operation's progress and actions. ```shell pdftk in.pdf operation output out.pdf verbose ``` -------------------------------- ### Attach Files to PDF (attach_files) Source: https://www.pdflabs.com/docs/pdftk-man-page Embeds arbitrary files into a PDF using its file attachment feature. Files can be attached at the document level or to a specific page using the 'to_page' option. Multiple files can be listed. ```shell pdftk in.pdf attach_files table1.html table2.html to_page 6 output out.pdf ``` -------------------------------- ### pdftk - Burst Feature with Custom Output Filenames Source: https://www.pdflabs.com/docs/pdftk-version-history This snippet demonstrates how to use the 'burst' feature of pdftk to split PDF pages into separate files. It shows how to control the output filenames using a printf-styled format string passed via the 'output' option. This allows for dynamic naming based on page numbers or other criteria. ```shell pdftk input.pdf burst output "output_page_%02d.pdf" ``` -------------------------------- ### Set Output Filename (-) Source: https://www.pdflabs.com/docs/pdftk-man-page Specifies the output PDF filename. Using '-' directs the output to stdout. This option is also used to set the output filename for dump_data, the output directory for unpack_files, and page filenames for burst operations. ```shell pdftk input.pdf operation output - ``` -------------------------------- ### Collate PDF Pages with pdftk shuffle Source: https://www.pdflabs.com/docs/pdftk-man-page The `shuffle` operation collates pages from input PDFs, taking one page at a time from each specified page range. It handles cases where ranges have different lengths and supports all features of `cat`, including reverse ranges and rotations. This is useful for organizing scanned documents. ```shell pdftk A=doc1.pdf B=doc2.pdf shuffle A1-10 B1-10 output collated.pdf ``` ```shell pdftk A=doc1.pdf B=doc2.pdf shuffle A1-5 B3-7even output partial_collate.pdf ``` -------------------------------- ### pdftk - Adding New Operations: fill_form, update_info, attach_file, unpack_file Source: https://www.pdflabs.com/docs/pdftk-version-history This entry highlights the addition of several new operations to pdftk: 'fill_form' for populating form fields, 'update_info' for modifying PDF metadata, 'attach_file' for embedding files, and 'unpack_file' for extracting embedded files. These operations significantly expand pdftk's capabilities in form management and file handling within PDFs. ```shell # Example of filling a form pdftk input_form.pdf fill_form data.fdf output filled_form.pdf # Example of updating info pdftk input.pdf update_info info.txt output updated_info.pdf ``` -------------------------------- ### Split PDF into Single Pages with pdftk burst Source: https://www.pdflabs.com/docs/pdftk-man-page The `burst` operation splits a single input PDF into individual pages. By default, output pages are named sequentially (e.g., pg_0001.pdf). A custom naming format using printf-style specifiers can be provided in the output section. Encryption can also be applied to the output files. ```shell pdftk input.pdf burst output page_%02d.pdf ``` ```shell pdftk input.pdf burst owner_pw secretpass output encrypted_pages ``` ```shell pdftk input.pdf burst ``` -------------------------------- ### Catenate/Merge PDF Pages with pdftk cat Source: https://www.pdflabs.com/docs/pdftk-man-page The `cat` operation in pdftk assembles pages from input PDFs into a new PDF. It supports merging, splitting, rotating pages, and specifying page ranges with options like 'even', 'odd', and reverse order. Handles can be used to reference specific input files. ```shell pdftk A=in1.pdf B=in2.pdf cat A1 B2-20even output out.pdf ``` ```shell pdftk cat in1.pdf in2.pdf output combined.pdf ``` ```shell pdftk in.pdf cat 1-5odd output odd_pages.pdf ``` ```shell pdftk A=in1.pdf B=in2.pdf cat Bend-1odd output reversed_odd_pages.pdf ``` ```shell pdftk in.pdf cat 1-endeast output rotated_document.pdf ``` -------------------------------- ### Update PDF Info Dictionary (update_info) Source: https://www.pdflabs.com/docs/pdftk-man-page Modifies the bookmarks and metadata in a PDF's Info dictionary using an external data file. This operation does not affect XMP stream metadata. The input data file format is the same as the output of dump_data. Non-ASCII characters require XML numerical entity encoding. ```shell pdftk in.pdf update_info in.info output out.pdf ``` -------------------------------- ### Update PDF Info Dictionary with UTF-8 (update_info_utf8) Source: https://www.pdflabs.com/docs/pdftk-man-page Identical to the update_info operation, but it accepts input data encoded in UTF-8. ```shell pdftk in.pdf update_info_utf8 in.utf8.info output out.pdf ``` -------------------------------- ### pdftk - Dump Data Fields Reporting Improvements Source: https://www.pdflabs.com/docs/pdftk-version-history This details improvements to the `dump_data_fields` feature in pdftk. The bug fixes enhance its reporting accuracy, and new functionality is added to report all possible settings for various form field types, including check boxes, radio buttons, list boxes, and combo boxes, providing more comprehensive form information. ```shell pdftk input.pdf dump_data_fields output form_fields_info.txt ``` -------------------------------- ### Enable Field Appearance Generation (need_appearances) Source: https://www.pdflabs.com/docs/pdftk-man-page Sets a flag that prompts PDF viewers like Reader/Acrobat to generate new field appearances based on form field values. This is particularly useful for non-ASCII text to ensure proper display. It cannot be used with the 'flatten' option. ```shell pdftk in.pdf need_appearances fill_form data.txt output out.pdf ``` -------------------------------- ### STAMPtk Command for Multi-Page Stamp with Custom Headers/Footers Source: https://www.pdflabs.com/docs/how-to-add-headers-footers-watermarks-and-stamps-to-pdf This command utilizes STAMPtk to generate a multi-page stamp (stamp.pdf) with custom headers and footers. It supports different content for odd and even-numbered pages, allows precise text positioning using relative terms and margins, and specifies media sizes for each stamp element. The command includes ranges for applying stamps to specific pages. ```shell stamptk AAmedia=A4 AAtext="Specially Prepared for John Hancock" AAorigin=left,top AApos=left,top AArange=1-15Odd BBmedia=A4 BBtext="Prepared July 4, 1776" BBorigin=right,top BBpos=right,top BBrange=1-15Even CCmedia=A4 CCtext="Final Version" CCorigin=center,bottom CCpos=center,bottom CCrange=1-15 output=stamp.pdf ``` -------------------------------- ### Concatenate PDFs using pdftk Source: https://www.pdflabs.com/docs/pdftk-version-history This command demonstrates how to concatenate multiple PDF files into a single output file using pdftk. It removes the previous restriction on the number of input documents. ```bash pdftk *.pdf cat output combined.pdf ``` -------------------------------- ### Compress/Uncompress PDF Page Streams (compress/uncompress) Source: https://www.pdflabs.com/docs/pdftk-man-page These options are useful for editing PDF page code directly. 'uncompress' removes compression from PDF page streams, making them readable in text editors. 'compress' restores the original compression. ```shell pdftk in.pdf uncompress output uncompressed.pdf ``` ```shell pdftk uncompressed.pdf compress output compressed.pdf ``` -------------------------------- ### pdftk - Uncompress Option with Page Number Markers Source: https://www.pdflabs.com/docs/pdftk-version-history This shows the usage of the 'uncompress' option in pdftk, which not only decompresses PDF data but also adds page number markers (`/pdftk_PageNum _N_`) to page dictionaries. These markers facilitate easy lookup of specific pages. The 'compress' option removes these markers. ```shell # Uncompress with page number markers pdftk input.pdf uncompress output uncompressed.pdf # Compress and remove markers pdftk input.pdf compress output compressed.pdf ``` -------------------------------- ### Flatten Form Fields (flatten) Source: https://www.pdflabs.com/docs/pdftk-man-page Merges interactive form fields and their data with the PDF pages. This operation is intended for a single input PDF and can sometimes be used in conjunction with the fill_form operation. ```shell pdftk form.pdf flatten output flattened_form.pdf ``` -------------------------------- ### Keep First or Final Document ID (keep_first_id/keep_final_id) Source: https://www.pdflabs.com/docs/pdftk-man-page When combining pages from multiple PDFs, these options allow copying the document ID from either the first ('keep_first_id') or the last ('keep_final_id') input document into the output PDF. By default, a new document ID is created. ```shell pdftk pdf1.pdf pdf2.pdf keep_first_id cat output combined.pdf ``` ```shell pdftk pdf1.pdf pdf2.pdf keep_final_id cat output combined.pdf ``` -------------------------------- ### pdftk - Fixing Page Annotation Crashes Source: https://www.pdflabs.com/docs/pdftk-version-history This addresses a critical bug where the presence of page annotations, particularly web links in PDFs generated by FPDF, caused pdftk to crash. The fix involves removing an erroneous assumption that all page annotations must be indirect objects, thus improving stability when processing such PDFs. ```shell # Operation that might have caused a crash with specific annotations pdftk input_with_annotations.pdf cat output output.pdf ```