Server 2009

XPSToPDF

Example code is for an older version of Server, newer code is available.
<?php
// Copyright (c) 2020 ActivePDF, Inc.
// ActivePDF Server 2009
// Example generated 07/16/20 
?>

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

// Instantiate Object
$oSVR = new COM("APServer.Object");

// XPS to PDF conversion
// Convert XPS file into PDF
$intXPSToPDF = $oSVR->XPSToPDF($strPath . "XPS.xps", $strPath . "XPS.pdf");
if ($intXPSToPDF != 0) {
  Error("XPSToPDF", $intXPSToPDF);
}

// Release Object
$oSVR = null;

// Process Complete
echo "Done!";

// Error Handling
function Error($method, $outputCode) {
  echo "Error in " . $method . ": " . $outputCode;
}
?>

Copyright © 2020 ActivePDF, Inc