PHP Classes

File: pdfprint.php

Recommend this page to a friend!
  Classes of Mark de Leon  >  PHP Document Scanner using SANE or eSCL AirPrint  >  pdfprint.php  >  Download  
File: pdfprint.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Document Scanner using SANE or eSCL AirPrint
Web interface to scan printed documents
Author: By
Last change:
Date: 1 year ago
Size: 1,348 bytes


Class file image Download
( -1 );
ini_set( 'display_errors', 1 );
/* require_once("PrintIPP.php");
  $ipp = new PrintIPP();
// $ipp->setData("");
// $ipp->setData("./scans/Scan20190112165555RotateFlip.jpg"); // Path to file.


//specify the pdf you'd like to print
// $file = '/var/www/data/myfile.pdf';
//Change PrinterName to the name of the printer you set up in CUPS
//$cmd = "lpr -PDF";
//append any files you'd like to print to the end of the command
// $cmd .= $file;
//Runs "lpr -PPrinterName /var/www/data/myfile.pdf" and brings back any output to the console.
// $response = shell_exec($cmd);

topdf($filename, $options = "") {
# Tell HTMLDOC not to run in CGI mode...

# Write the content type to the client...
header("Content-Type: application/pdf");

# Run HTMLDOC to provide the PDF file to the user...
passthru("htmldoc -t pdf --quiet --jpeg --webpage $options " . escapeshellarg($filename));


For more information send a message to info at phpclasses dot org.