Giter Club home page Giter Club logo

pdfstitch's Introduction

pdfstitch

pdfstitch does a similar job to pdfnup but focuses on the following features:

  • Crop pages to a certain size
  • Adjust the crop position per page

It has been created to print sewing patterns distributed as A4 or Letter PDFs on a large format printer thus saving oneself the hassle of cutting and gluing individual pages.

License

pdfstitch is free software under the GNU GPL version 3. See LICENSE for details.

Dedication

pdfstitch is dedicated to the memory of Janka "marsi" Kuhfuß.

Dependencies

pdfstitch makes use of the following Perl modules:

  • File::Basename (part of perl base)
  • File::LibMagic
  • Getopt::Long (part of perl base)
  • PDF::API2
  • YAML

On Debian, you can install them with:

# apt install libfile-libmagic-perl libpdf-api2-perl libyaml-perl

On FreeBSD, you can install them with:

# pkg install p5-File-LibMagic p5-PDF-API2 p5-YAML

Usage

  1. Run pdfstitch on your input PDF:

    ./pdfstitch [--genmeta] [--defaultcrop=0.9] foobar.pdf

    This will generate a YAML file called foobar.pdf.stitch. Edit this file according to the desired output. This is also the default action if called with a PDF. Per default 10% (factor 0.9) is applied as crop factor. You can adjust this value with the --defaultcrop parameter.

  2. Optional: Generate a preview and/or cropped PDF:

    ./pdfstitch --preview foobar.pdf.stitch

    This will generate a new PDF called foobar-preview.pdf. It contains only the pages you select in the YAML file with each page being overlayed with a transparent box showing the area the page will be cropped to.

    ./pdfstitch --crop foobar.pdf.stitch

    This will generate a new PDF called foobar-cropped.pdf. It contains only the pages you select in the YAML file with each page being cropped accordingly.

  3. Generate the final stitched PDF:

    ./pdfstitch --stitch foobar.pdf.stitch

    This will generate a single-page PDF called foobar-stitched.pdf with all selected pages being stitched together as specified in the YAML file. This is also the default action if called with just a YAML file.

Notes

  • The output file name is based on the .stitch file name.
  • All output files are placed in the current working directory.

pdfstitch's People

Contributors

jakobhaufe avatar sur5r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pdfstitch's Issues

674ff5de8daa9e7cedcee4d01992fa2b972cd05b breaks everything besides ``--preview``

674ff5d introduced a new option --defaultcrop. A default value for this option is always set which triggers the option plausibility check:

die "--defaultcrop can only be combined with --genmeta!\n" if($defaultcrop and ($preview or $crop or $stitch));

No operation besides --preview can be called.

We have two options to fix this:

  • Remove the check
    While this would not cause any malfunction it might confuse users as supplying a value to --defaultcrop while not calling --preview would throw no error despite having no effect.
  • Move setting the default value to the beginning of the preview code block which would avoid the aforementioned behavior.

Implement multi-page output

As suggested by @xkpd3 on IRC.

Example:
Process a 90 page input file into a 15 page output file with layout 3x2

Two options come to mind:

  • Overflow into a new page once the grid is full
  • Allow explicit specification of output pages in YAML

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.