Code Monkey home page Code Monkey logo

chunked-pdf-printer's Introduction

chunked-pdf-printer

Did you ever buy a network printer that, for whatever reason, simply cannot handle a 300+ page PDF file?

Well, I did, and this was my solution.

Simply put, chunked-pdf-printer.sh divides a long PDF file into 10 page chunks, and submits each chunk to the lp command, sleeping for 30 seconds in between. The sleep is to ensure that the print service keeps the chunks in the correct order.

It relies on the pdftk program. pdftk is a fabulous CLI tool. This script uses pdftk to find the total number of pages, and to generate each 10-page chunk of the larger file.

I got my copy of pdftk from Ubuntu's apt repository. I have not tested this under any other distribution. You, of course, are welcome to do so, and share improvements, as we programmers love to do.

PRs, issues and comments are welcome.

I notified the makers of pdftk of this script via this issue.
Hopefully they'll add this feature to pdftk directly. Until then, enjoy this script.

Usage:

Put the chunked-pdf-printer.sh script somewhere in your PATH, make sure it is executable (chmod 755), and invoke as follows:

   $ chunked-pdf-printer.sh my-giant-pdf.pdf [...]

Tim Bailey-Jones Plant City, FL USA

chunked-pdf-printer's People

Contributors

timbaileyjones avatar

Stargazers

 avatar

Watchers

 avatar  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.