Spooler 2017

FormName

<?php
// Copyright (c) 2019 ActivePDF, Inc.
// ActivePDF Spooler 2017
// Example generated 07/18/19 
?>

<?php
// Get current path
$strPath = dirname(__FILE__) . "\\";

// Instantiate Object
$oSP = new COM("APSpooler.Object");

// Use the PrintJobProfile object to set specific printer settings
// for the print job if the default options are not what is needed.
$oPJP = $oSP->PrintJobProfile("SettingsOne");

$oPJP->BinSource = 15;
$oPJP->Collate = false;
$oPJP->ColorMode = 2;
$oPJP->DPI = 300;
$oPJP->Duplex = 1;
$oPJP->FormName = "SampleForm";
$oPJP->Nup = 0;
$oPJP->Orientation = 1;
$oPJP->PaperSize = 1;
$oPJP->PrinterName = "Microsoft Print to PDF";
$oPJP->PrintOddEvenAll = 3;
$oPJP->ProfileName = "SettingsOne";
$oPJP->Scaling = 1;
$oPJP->CustomScaling = 95.0;
$oPJP->TrueTypeOption = 3;

// File specific settings
$oSP->Copies = 1;
$oSP->PageRange = "1-2,4";
$oSP->PrintAnnotations = true;

// Print directly to a printer. Leave first parameter blank for default printer
$results = $oSP->PrintFileCustom(oPJP, $strPath . "5pageLI.pdf", "");
if ($results->Status != 0) {
  Error("PrintFileCustom", $results, $results->Status);
}

// Release Object
$oPJP = null;

// Release Object
$oSP = null;

// Process Complete
echo "Done!";

// Error Handling
function Error($method, $oResults, $errorStatus) {
  echo "Error with " . $method . ": <br/>"
    . $errorStatus . "<br/>"
    . $oResults->details;
  exit(1);
}
?>

Copyright © 2019 ActivePDF, Inc