Download the PHP package dlin/snappy-bundle without Composer

On this page you can find all versions of the php package dlin/snappy-bundle. 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 snappy-bundle

Dlin Symfony Snappy Bundle

Dlin Symfony Snappy Bundle is wrapper bundle for Snapy :

Snappy is a PHP5 library allowing thumbnail, snapshot or PDF generation from a url >or a html page. It uses the excellent webkit-based wkhtmltopdf and wkhtmltoimage >available on OSX, linux, windows.

Dlin Symfony Snappy Bundle provides a configurable service to work with PDF files


Installation

Installation using Composer

NOTE: Unfortunately, Composer does not support repositories in nested dependencies, we have to include dependencies and repositories in the root composer.json.

Add to your composer.json:

json
{
    "require" :  {
        ....
        "dlin/snappy-bundle": "dev-master",
        "google/wkhtmltopdf-amd64": "0.11.0-RC1",
        "google/wkhtmltopdf-i386": "0.11.0-RC1",
    },

    ....

    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "google/wkhtmltopdf-amd64",
                "version": "0.11.0-RC1",
                "dist": {
                    "url": "http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2",
                    "type": "tar"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "google/wkhtmltopdf-i386",
                "version": "0.11.0-RC1",
                "dist": {
                    "url": "http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2",
                    "type": "tar"
                }
            }
        }
    ]
}

Enable the bundle in you AppKernel.php

public function registerBundles()
{
    $bundles = array(
    ...
    new Dlin\Bundle\SnappyBundle\DlinSnappyBundle(),
    ...
}

Configuration

You can specify the installation location of wkhtmltopdf

#app/config/config.yml

dlin_snappy:
    pdf_service:
        wkhtmltopdf: /Applications/wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf

For most OS, this bundle will try to download and install the wkhtmltopdf binary itself. No configuration is required unless you want to use a different wkhtmltopdf binary. For Mac servers, one will have to download the DMG file and install it. The above configuration is required.

Usage

Geting the service in a controller

$pdf =  $this->get('dlin.pdf_service');

Getting the service in a ContainerAwareService

$pdf = $this->container->get('dlin.pdf_service');

Using the method "createPdfFromHtml"

#Pdf will be created (replace if already exist) as file '/tmp/test.pdf'
$pdf->createPdfFromHtml('<html><body><h1>hello</h1></body>', '/tmp/test.pdf');

Using the method "createPdfFromUrl"

#Pdf will be created (replace if already exist) as file '/tmp/test.pdf'
$pdf->createPdfFromUrl('google.com', '/tmp/test.pdf');

Download to browser (HTTP headers will be set and script terminates)

$pdf->sendHtmlAsPdf('<html><body><h1>hello</h1></body>', 'downloadFileName.pdf');
#or
$pdf->sendUrlAsPdf('google.com', 'downloadFileName.pdf');

Show PDF inline in browser (HTTP headers will be set and script terminates)

$pdf->sendHtmlAsPdf('<html><body><h1>hello</h1></body>', 'downloadFileName.pdf', true);
#or
$pdf->sendUrlAsPdf('google.com', 'downloadFileName.pdf', true);

Notes

License

MIT

Free Software, Yeah!


All versions of snappy-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.8
knplabs/knp-snappy Version *
google/wkhtmltopdf-amd64 Version 0.11.0-RC1
google/wkhtmltopdf-i386 Version 0.11.0-RC1
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 dlin/snappy-bundle contains the following files

Loading the files please wait ....