PHP Classes

File: example/markup.php

Recommend this page to a friend!
  Classes of Dave Smith   Convert HTML to PDF PHP Library   example/markup.php   Download  
File: example/markup.php
Role: Example script
Content type: text/plain
Description: Example Usage
Class: Convert HTML to PDF PHP Library
Convert HTML to PDF using pdflayer API
Author: By
Last change:
Date: 8 years ago
Size: 383 bytes
 

Contents

Class file image Download
<?php
/*
Post markup to the api
*/

include('../html2pdf.class.php');
$h2pdf = new html2pdf();

//read html into a variable
$html = file_get_contents('test.html');

//set the document_html parameter with the html markup
$h2pdf->setParam('document_html',$html);

//start the conversion
$h2pdf->convertHTML();

//display the pdf file
$h2pdf->displayCapture();

?>