Skip to main content

Tool(s) for placing multiple PDF pages on a sheet for printin

Project description

pdfsquash

Tool(s) to transform PDFs for printing multiple pages on a sheet.

Usage

pdfsquash -o <output-pdf> <input-pdf-1> <input-pdf-2> ...

For more options, see

pdfsquash -h

Examples

Following PDF files are used as sample inputs:

Default options

pdfsquash -o samples/1-4-default.pdf \
    samples/1.pdf samples/2.pdf samples/3.pdf samples/4.pdf

Here is how result will look: 1-4-default.pdf

image

Change spacing between minipages

Default spacing is 0. To chang it to 10pt use this command:

pdfsquash -o samples/1-4-spacing.pdf \
    -s 10 \
    samples/1.pdf samples/2.pdf samples/3.pdf samples/4.pdf

Here is how result will look: 1-4-default.pdf

image

Change page margin

Default page margin is 20pt. To change it to 0pt use this command:

pdfsquash -o samples/1-4-margin.pdf \
    -m 0 \
    samples/1.pdf samples/2.pdf samples/3.pdf samples/4.pdf

Here is how result will look: 1-4-default.pdf

image

Keep aspect ratio of the original

By default, original mini-pages will be shrinked and stretched to fit the target sheet location, independently in X and Y direction*. If you want to preserve original aspect, do this:

pdfsquash -o samples/1-4-keep-aspect.pdf \
    -m 0 \
    -k \
    samples/1.pdf samples/2.pdf samples/3.pdf samples/4.pdf

Here is how result will look: 1-4-keep-aspect.pdf

image

TODO

  1. Support other paper sizes (currently hardcoded to US Letter)
  2. Support other number of mini-pages per paper sheet (2, 6, 8). Currently do only 4 mini-pages per paper sheet.
  3. Support page re-ordering. Currently mini-pages are placed in a fixed order (left-to-right, top-to-bottom).

License

MIT

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

If you're not sure about the file name format, learn more about wheel file names.

pdfsquash-0.0.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pdfsquash-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pdfsquash-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pdfsquash-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5fb939e9a9e936816c1b0ada6d29b6d5a304ef655ac7c1b90dfa31ab5b091cf6
MD5 ddd69800a2108cbc8ecbc5ed56087736
BLAKE2b-256 e91a9c6cd4d1c5c74aab6efa53157850d2fb05d0b4de363968db62f1cdb5b455

See more details on using hashes here.

Supported by

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