PHP Classes

File: demo.class.pdffile.php

Recommend this page to a friend!
  Classes of Laurens Ramandt   PDF print   demo.class.pdffile.php   Download  
File: demo.class.pdffile.php
Role: Example script
Content type: text/plain
Description: Example use
Class: PDF print
Alter a PDF document to make it print when opened
Author: By
Last change:
Date: 14 years ago
Size: 415 bytes
 

Contents

Class file image Download
<?php
require("class.pdffile.php");

//example A: insert javascript and save as new file
$obj = new pdfFile("example.pdf");
$obj->insertPrintCode();
$obj->saveAs("example-print.pdf");

//example B: insert javascript and output the file
$obj = new pdfFile("example.pdf");
//sets the header information, automatically inserts print code
//and echos the pdf contents (cfr. __toString method)
echo $obj;
?>