PdfTK java Extended is an expanded, feature-rich command-line utility for manipulating, automating, and preparing PDF documents for print and digital workflows. Built on the pdftk-java fork—which itself is based on the original PDFtk—it retains full compatibility with classic pdftk syntax while introducing advanced prepress, layout, and variable-data capabilities.
Acting as an all-in-one electronic stapler, hole-punch, binder, and imposition engine, it handles merging, splitting, booklet and N-up imposition, page transformations, stamping, form filling, encryption, bookmarking, and image export.
Running cross-platform on Java, it lets you script complex PDF operations for batch processing, server-side automation, and everyday desktop workflows without a graphical interface or proprietary software—keeping document pipelines fast, consistent, and easy to maintain across teams and systems.
Features
- Document Concatenation & Page Interleaving (cat, shuffle): Merge multiple input PDFs in custom order or interleave pages across documents—ideal for pairing separately scanned odd and even sheets.
- Smart Splitting & Bursting (burst): Break PDFs into individual pages or segments using explicit page ranges, step intervals (every <step>), bookmark levels, or matching text (text <target_text>).
- Page Reordering & Compaction (reorder): Reverse page order (--reverse) or compact document layout (--compact <level>) with direct output file targeting.
- Booklet & Codex Imposition (impose --booklet, --book, --codex): Arrange pages into print-ready booklets and signatures with vertical/horizontal codex modes, binding edge selection (TOP, RIGHT, BOTTOM, LEFT), and sheet/signature stack controls.
- N-Up Grid Layouts (impose --n-up / --nup): Pack multiple logical pages onto a single sheet using COLSxROWS grids with alignment, scaling, margin controls, and repeat-to-fill options.
- Duplex, Tumble & Right-to-Left Print Support (--duplex, --tumble, --two-sided, --verso-opposite, --right-to-left): Configure two-sided press behavior, opposite verso layouts, and right-to-left reading directions for localized or specialty publications.
- Page Geometry & Scaling (transform, scale): Scale axes independently or uniformly, rotate pages in radians, apply NONE / FIT / FILL / AUTO resize modes, and enforce portrait/landscape orientation or custom margins.
- Page & Document Repetition (--repeat-page, --repeat-doc, --repeat-in-layer): Duplicate individual pages or entire documents for batch runs, proofing, or layered layouts.
- Conditional Blank Page Insertion (blank): Insert blank pages in specified counts across all pages, odd/even pages, page ranges, or wherever target text appears.
- Foreground Stamping & Background Watermarks (stamp, multistamp, background, multibackground): Apply single- or multi-page overlays and underlays across chosen page ranges with custom opacity (op), rotation, alignment, and percentage or unit-based (in, mm, pt) sizing.
- Variable Data Printing (vdata): Inject dynamic variable data from files, stdin (-), or interactive prompts (PROMPT) using configurable font sizes, margins, and alignment.
- CSV & Form Data Workflows (import, fill_form, generate_fdf, generate_xfdf): Import CSV records, populate interactive forms, and generate FDF or XFDF payloads for automated document generation.
- Form & XFA Flattening (flatten, drop_xfa, need_appearances): Convert interactive form fields and XFA layers into static PDF content and ensure appearance streams render reliably across viewers.
- Data & Field Inspection (dump_data, dump_data_utf8, dump_data_fields, dump_data_fields_utf8): Export full document metrics, outline/page data, and form field specifications in plain or UTF-8 encodings.
- Metadata Editing & Privacy Scrubbing (update_info, update_info_utf8, wipemeta, drop_xmp): Update info dictionaries in standard or UTF-8 text, strip XMP packets, or wipe document metadata before distribution.
- File Attachments & Extraction (attach_files, unpack_files): Embed supporting files inside PDFs or extract attached files during automated document intake.
- Automated Outline Bookmarks (bookmark): Create PDF bookmarks automatically across all pages, odd/even sheets, step intervals, page ranges, external bookmark files, or text matches.
- TIFF Conversion (totiff): Export specific page ranges into TIFF images with selectable formats/short codes, DPI settings, and compression modes.
- Encryption & Access Permissions (encrypt_40bit, encrypt_128bit, encrypt_aes128, allow, user_pw, owner_pw): Encrypt PDFs with 40-bit RC4, 128-bit, or AES-128 security while setting granular permission flags and passwords.
- Structural Repair & Stream Compression (repair, compress, uncompress, keep_first_id, keep_final_id): Fix damaged PDFs, compress or decompress content streams, and control document IDs across processing pipelines.
- Pipe, Prompt & Batch Scripting Controls (-, PROMPT, do_ask, dont_ask, verbose, replace_font): Read from and write to standard streams (-), prompt interactively for inputs/passwords, suppress or force prompts, enable verbose logs, and replace fonts cleanly.
- gitlab.com/xlanceV/pdftk-java-extended/