Example code is for an older version of Server, newer code is available.
<?php
// Copyright (c) 2021 ActivePDF, Inc.
// ActivePDF Server 2009
// Example generated 02/27/21
?>
<?php
// Get current path
$strPath = dirname(__FILE__) . "\\";
// Instantiate Object
$oSVR = new COM("APServer.Object");
// Enable extra logging in the activepdflogs folder
$oSVR->DebugMode = true;
// Convert Image to PDF
// Supported image types found in Server documentation
$intImageToPDF = $oSVR->ImageToPDF($strPath . "IMG.jpg", $strPath . "Debug.pdf", 0, 0, true, true, 72, "", 0, 0);
if ($intImageToPDF != 0) {
Error("ImageToPDF", $intImageToPDF);
}
// Release Object
$oSVR = null;
// Process Complete
echo "Done!";
// Error Handling
function Error($method, $outputCode) {
echo "Error in " . $method . ": " . $outputCode;
}
?>