Skip to content

nass600/IdeupWkHtmlToPdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About
-----
A PHP class which helps working with WKHTMLTOPDF <http://code.google.com/p/wkhtmltopdf/>

This class is based on <http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp>
class.

I have removed $_GLOBALS & other static configuration options.

Author
------
Aurimas Baubkus aka aur1mas <aur1mas@devnet.lt>
Released under "New BSD license"

Usage
-----
<?php
    try {
        $wkhtmltopdf = new Wkhtmltopdf(array('path' => APPLICATION_PATH . '/../public/uploads/'));
        $wkhtmltopdf->setTitle("Title");
        $wkhtmltopdf->setHtml("Content");
        $wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, "file.pdf");
    } catch (Exception $e) {
        echo $e->getMessage();
    }
?>
On Gist: https://gist.github.com/733109

Feedback
--------
Issue tracker: https://github.com/aur1mas/Wkhtmltopdf/issues


Installation on Symfony2
------------------------

Add library to autoload.php at the end by writing this line:

//WkHtmlToPdf
require(__DIR__ . '/../vendor/wkhtmltopdf/WKPDF.php');

Change permissions for wkhtmltopdf-i386.so to be able to convert html files using the shell command through your Symfony app

Run phing cache command in order to create the temporary directory  and give it permissions where the pdf's will be generated

About

Class to handle conversions from html code to pdf file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages