Skip to main content

Merge individual pages of PDF file into one page

Project description

PyPDFMerge

Merge individual pages of PDF files into one page

Demo

Merging 2 pages into 1

Before After
Image 1 Image 2

Installation

pip install PyPDFMerge

NOTE: You need visual studio build tools for C++ to install PyPDFMerge package. Refer to this for more information.

Usage

Command Line

You can use the PyPDFMerge command to merge pdf files. It has the following options:

pdfmerger <path> [-o <output>] [-g <group_size>] [-q <quality>]

Example:

pdfmerger test.pdf

This will merge the test.pdf file and save it as output.pdf in the same directory.

NOTE: Output defaults to output.pdf, group size defaults to 2, and quality defaults to 1.5.

Python

You can also use the PyPDFMerge package in your Python code. It has the following options:

from pdfmerger import PDFMerge

pdf = PDFMerge(pdf_file=<path>, output_file=<output>, group_size=<group_size>, quality=<quality>, page_number=<page_number>)
pdf.run()

Example:

from pdfmerger import PDFMerge

pdf = PDFMerge(pdf_file="./test.pdf", output_file="./output.pdf", group_size=2, quality=1.5)
pdf.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

PyPDFMerge-0.0.3-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page