Download the PHP package shuble/slurpy without Composer

On this page you can find all versions of the php package shuble/slurpy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package slurpy

Slurpy

Slurpy is a PHP wrapper for the pdftk command-line tool for working with PDF. This library is largely inspired by Snappy from KnpLabs, a library for generating images or pdf from html. Some of the Slurpy code comes directly from Snappy.

In order to use Slurpy you will have to download pdftk for either Windows, Mac OSX or linux.

Build Status

Installation

If you are using composer add the following lines to your composer.json:

And run these commands:

Now, just add the autoloader:

Or, if you are not using composer, require the provided autoload:

Then proceed with the installation of pdftk if not already installed. Please refer to the pdftk website, and grab the installer or sources, depending on your system.

That's it, you're done.

Simple usage

Visit the pdftk documentation for more details about each operations.

Create the factory

Slurpy comes with a simple factory for dealing with pdftk operations in their simple forms. Each call to factory methods returns a Slurpy instance, then you just need to call the generate method on this Slurpy instance to process the operation.

Catenate PDF files

The cat operation assembles pages from input PDFs to create a new PDF. Use cat to merge PDF pages or to split PDF pages from documents. You can also use it to rotate PDF pages. Page order in the new PDF is specified by the order of the inputs array.

Now, /path/to/ouput.pdf contains the 3 pdfs, with only odd pages rotated to east for the third pdf.

Shuffle PDF files

The shuffle operation collates pages from input PDFs to create a new PDF. Works like the cat operation except that it takes one page at a time from each page range to assemble the output PDF. If one range runs out of pages, it continues with the remaining ranges. This feature was designed to help collate PDF pages after scanning paper documents.

Background

The background operation Applies a PDF watermark to the background of a single input PDF. It uses only the first page from the background PDF and applies it to every page of the input PDF. This page is scaled and rotated as needed to fit the input page. If the input PDF does not have a transparent background (such as a PDF created from page scans) then the resulting background won’t be visible — use the stamp operation instead.

You can also pass a fourth parameter $multi if you want to use the multibackground operation.

multibackground is the same as the background operation, but applies each page of the background PDF to the corresponding page of the input PDF. If the input PDF has more pages than the stamp PDF, then the final stamp page is repeated across these remaining pages in the input PDF.

Burst

The burst operation splits a single, input PDF document into individual pages. Naming for the resulting page is specified if a printf-style format string. i.e. if you give an ouput of page_%02d.pdf to Slurpy, resulting pages are going to be page_01.pdf, page_02.pdf and so on.

NOTE that you may have to give output as a complete path such as /path/to/pdfs/page_%04d.pdf

Generate fdf

The generateFdf operation reads a single, input PDF file and generates an FDF file suitable for fillForm operation. It saves this FDF file using the output filename.

Fill form

The fillForm operation fills a single input PDF form with the given fdf or xfdf data file. By default after filling the form, the ouput pdf fields remains active. You can disable the fields from the output pdf by giving true as a fourth argument which will flatten the resulting pdf.

NOTE That Slurpy will soon be able to fill forms with simple key/value pairs as data instead of fdf or xfdf files.

Unit tests

Run the following command:

Done.

Credits

License

Slurpy is released under the MIT license. See the provided LICENSE file for more details.


All versions of slurpy with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
symfony/process Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shuble/slurpy contains the following files

Loading the files please wait ....