---
title: "Fun with Pdf"
description: "Ever wanted to combine or merger many pdf files to a single file , no issues , you can do it easily on the shell. If PDF is."
url: "https://h3manth.com/scribe/fun-with-pdf/"
canonical_url: "https://h3manth.com/scribe/fun-with-pdf/"
markdown_url: "https://h3manth.com/scribe/blog/fun-with-pdf.md"
publishDate: "2008-12-19T00:00:00.000Z"
author: "Hemanth HM"
category: "cli"
tags: ["programming"]
word_count: 175
reading_time_minutes: 1
x_markdown_tokens: 365
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Fun with Pdf

> Ever wanted to combine or merger many pdf files to a single file , no issues , you can do it easily on the shell. If PDF is.

Ever wanted to combine or merger many pdf files to a single file , no issues , you can do it easily on the shell.

If PDF is electronic paper, then pdftk is an electronic staple-remover,hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents.  Use it to:

       * Merge PDF Documents
       * Split PDF Pages into a New Document
       * Rotate PDF Documents or Pages
       * Decrypt Input as Necessary (Password Required)
       * Encrypt Output as Desired
       * Fill PDF Forms with X/FDF Data and/or Flatten Forms
       * Generate FDF Data Stencil from PDF Forms
       * Apply a Background Watermark or a Foreground Stamp
       * Report PDF Metrics such as Metadata and Bookmarks
       * Update PDF Metadata
       * Attach Files to PDF Pages or the PDF Document
       * Unpack PDF Attachments
       * Burst a PDF Document into Single Pages
       * Uncompress and Re-Compress Page Streams
       * Repair Corrupted PDF (Where Possible)

Do this first : sudo apt-get install pdftk 
To merge : pdftk *.pdf cat output all.pdf
