Server 2009

ImageToPDF

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

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

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

// Convert Image to PDF
// Supported image types found in Server documentation
$intImageToPDF = $oSVR->ImageToPDF($strPath . "IMG.jpg", $strPath . "IMG.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;
}
?>

Copyright © 2019 ActivePDF, Inc