Download the PHP package siphoc/pdf-bundle without Composer

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

PDFBundle

The Siphoc PDF Bundle provides an easy way to create PDF's from your views.

Build Status

Installation

Step 1: Download the bundle using Composer

Add SiphocPdfBundle to composer.

{
    "require": {
        "siphoc/pdf-bundle": "2.0.*"
    }
}

Install the bundle:

$ composer.phar update siphoc/pdf-bundle

Composer will install the bundle with the required dependencies.

Step 2: Enable the bundle

In your AppKernel add the following:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Siphoc\PdfBundle\SiphocPdfBundle(),
    );
}

Step 3: configure your bundle

In your config.yml file:

siphoc_pdf:
    basepath: "%kernel.root_dir%/../web"
    binary: "/usr/local/bin/wkhtmltopdf"
    options:
        'lowquality': false
        'enable-javascript': true
        'debug-javascript': true

Usage

Download

In your controller, you can download the contents of your controller like this:

$pdfGenerator = $this->get('siphoc.pdf.generator');
$pdfGenerator->setName('my_pdf.pdf');
return $pdfGenerator->downloadFromView(
    'AcmeDemoBundle:Demo:index.html.twig', array(
        'name' => $name,
    )
);

Inline display

There's also an option to display the contents in the browser. To do so, use the following example:

$pdfGenerator = $this->get('siphoc.pdf.generator');
$pdfGenerator->setName('my_pdf.pdf');
return $pdfGenerator->displayForView(
    'AcmeDemoBundle:Demo:index.html.twig', array(
        'name' => $name,
    )
);

Documentation

The main Documentation can be found in Resources/doc/index.html. It is auto-generated by PHPDocumentor2. The directory itself is excluded through git because we use the PHPDoc Markdown plugin to create proper MD files to include in Git.

If you want to contribute, be sure to update the documentation and run both PHPDocumentor2 and PHPDoc Markdown. This way the documentation keeps up to date properly.

Development

This bundle is mainly created and maintained for Darwin Analytics.

Tests

For tests I've used PHPUnit. Contributions need to be supported with tests.

License

This bundle is under the MIT License.

Dependencies

Buzz

For external calls, I've included the Buzz Bundle from @kriswallsmith.

Snappy

To create the actual PDF. We're using Snappy. This has the wkhtmltopdf dependency. Be sure that you use the latest version (>=0.11.0_rc1).

Symfony

Since this is a Symfony bundle, there are some Symfony dependencies.

Http Foundation

To create a proper response, I've implemented the Symfony 2.1 Http Foundation component.

Templating

To render the views automatically, I've added the templating component to force a proper templating engine.

HttpKernel

Since version 1.1.2 we've implemented a logger instance. This depends on the Symfony2 HttpKernel component.


All versions of pdf-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
kriswallsmith/buzz Version >=0.8
knplabs/knp-snappy Version 0.1.*
symfony/http-foundation Version >=2.1
symfony/templating Version >=2.1
symfony/http-kernel Version >=2.1
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 siphoc/pdf-bundle contains the following files

Loading the files please wait ....