GithubHelp home page GithubHelp logo

ydx-2147483647 / pdfmerge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metaist/pdfmerge

0.0 0.0 0.0 14.7 MB

Command-line utility for merging, splicing, and rotating PDF documents.

Home Page: http://metaist.github.io/pdfmerge/

License: Other

Python 100.00%

pdfmerge's Introduction

pdfmerge

Command-line utility for merging, splicing, and rotating PDF documents.

Build Status pdfmerge on PyPI Supported Python versions

Changelog - Issues - Documentation

Why?

I find myself merging bits of different PDFs fairly regularly and really wanted a simple CLI way to do it.

Install

python -m pip install pdfmerge

Usage

$ pdfmerge [-h] [--version] [-o FILE|--output FILE] [-p PASSWORD|--password PASSWORD] PATH[RULE[, RULE ...]] [PATH[RULE, ...]] ...]
  • -o, --output output file (default: output.pdf). Must not be any of the input files.

  • -p, '--password` password for encrypted files (default: empty string).

  • PATH a file, directory, or wildcard string (e.g., file*.pdf) of files to merge.

  • RULE an optional string indicating which pages to extract and rotate. The syntax for each rule is:

    [START][..][END][ROTATE]
    

    Where START and END are positive (1-based) or negative page numbers and ROTATE is one of >, V, or < indicating a clockwise rotation of 90, 180, 270 degrees, respectively.

Command-line Example

$ pdfmerge -o out.pdf file1.pdf file2.pdf[3,3] file2.pdf[1V,2..-1] "other*.pdf[<]" "/path/pdf[1..4>,5]"

This example illustrates several features:

  • specifying an output file (must not be any of the input files)
  • merging multiple files, some more than once
  • splicing parts of file using indices (1-based; negatives allowed)
  • including the same page multiple times
  • rotating a page or page range
  • merging all the PDFs in a directory

Read more about the options

Python Module Usage

pdfmerge can also be imported into python scripts.

from pdfmerge import pdfmerge
pdfmerge(["pdf-1.pdf", "pdf-2.pdf[2>]"], "output.pdf")

License

MIT License

pdfmerge's People

Contributors

metaist avatar ydx-2147483647 avatar arjndr avatar lukasbindreiter avatar begert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.