PHP Classes

File: example_basic

Recommend this page to a friend!
  Classes of PHP-4-Business   WKHTMLTOPDF HTML to PDF creator   example_basic   Download  
File: example_basic
Role: Example script
Content type: text/plain
Description: Basic usage
Class: WKHTMLTOPDF HTML to PDF creator
Convert HTML to PDF using the Webkit engine
Author: By
Last change:
Date: 12 years ago
Size: 311 bytes
 

Contents

Class file image Download
<?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();
    }
   
?>