The following PHP example demonstrates how to submit a document to DocConverter locally. Refer to the Submit and CheckStatus methods for additional information and usage requirements.
These files are required:
test.txt - The input document to convert.
BasicCOM.php - Code detail provided below.
Click here to download this example (includes required files):
// File to convert
$varFile = $varPath . "test.txt";
// Output Directory
$varOutput = $varPath;
// Error Directory
$varError = $varPath;
// Original Directory
$varOriginal = $varPath;
// IP address of server with DocConverter
$varIP = "127.0.0.1";
// Port of server with DocConverter
$varPort = 0;
// Timeout
$varTimeout = 60;
// Instantiate Object
$objDC = new COM("APDocConv.Object");
// Timeout for CheckStatus
$objDC->StatusTimeout = $varTimeout;
// Submit the file for conversion
$varReturn = $objDC->Submit($varIP, $varPort, $varFile,
$varOutput, $varError, $varOriginal, "", "", False, "");
if ($varReturn != '0') { Error("Submit", $varReturn); }
// Check the status of the conversion
$varReturn = $objDC->CheckStatus("", $varPort, $varFile, $varOutput, $varError);
if ($varReturn != '1') {
Error("CheckStatus", $varReturn); } else {
echo "Done!"; }
// Release Object
$objDC = null;
// Error Handling
function Error($Method, $varReturn) {
echo "'$Method' failed with a '$varReturn'<br>";
echo "<a href='http://www.activepdf.com/support/kb/?id=10347&tk=ts'>";
echo "Return Codes</a>";
$objDC = null;
exit(); }
?>
Related Articles
10672 - Remote Submission with DocConverterThe following VBScript example demonstrates how to submit a document to DocConverter from a remote client. Refer to the 10663Submit and
The information in this article is for the use of activePDF Customers and Evaluation Users Only. No part of this document may be transmitted or reproduced without the express written consent of activePDF.