Skip to content

philcali/spdf

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

SPDF

This simple utility wraps iText and flying saucer to quickly create PDF's from the commandline.

Installation

cs philcali/spdf

Usage

sdpf -h [file|folder|url...] -i [-o out.pdf]

The url must be in the form of *://*. The specified output file must be in the form of *.pdf*.

The utility was designed to play nice with other CL tools, so input and output can be piped and redirected (in fact, it is encouraged to do so).

cat flyer.html | spdf > out.pdf

curl www.google.com | spdf > google.pdf

lmxml flyer.lmxml | spdf -o out.pdf

Creating Multiple Pages

It's possible to create a multiple page document from a sequence of interspersed files, folders, or URL's by adding them to the var args. For example:

spdf http://google.com /home/philip/flyer.pdf > branding.pdf

spd /my/book > book.pdf

By using the -i flag, you can pipe input files, folders, or URL's from other shell commands. This would be particularly useful if you wanted to control the order of pages. For example:

find ./book | grep ".html$" | spdf cover.html -i > book.pdf

This would first load cover.html, then all of the html files in a directory called book piped to spdf. When run with -i, spdf expects valid inputs to be separated by some kind of whitespace.

Known Issues

  1. Currently, flying saucer will explode trying to paint a grid layout.
  2. The CSS resolver in flying saucer will throw a IOException, if it is given an empty or null, InputStream.

License

Because spdf uses iText for PDF conversion, this application must also be licensed under AGPL.

Read the LICENSE for spdf's copyright.

About

Quickly create PDFs on the command-line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages