ActivePDF
Shopping Cart My Account Help Contact Us
Request a Call
Search
Products Solutions Support Downloads Corporate
Submit an Issue
Knowledge Base
Server Product Support
Examples & How-Tos
Support Options
Support Policies
Annual Subscription
Extensions
Documentation
Resource Links
   
 
 
 
 

HomeSupportKnowledge Base
 
activePDF KB #10674 - Local Submission with DocConverter
activePDF KB #10674 - Local Submission with DocConverter
Information: Example Printer Version | Return to Search
Local Submission with DocConverter
 
Product Version Service Pack Code Samples  
DocConverter
3.5.2
SP4
SP5
SP6
SP7
VBS
ASP
CF
PHP
 
Description
 
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):
<?php
// Define Variables
    // Local path
    $varPath = getcwd() . chr(92);
    
    // 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 DocConverter
    The following VBScript example demonstrates how to submit a document to DocConverter from a remote client. Refer to the 10663Submit and


 
Keywords
 
CheckStatus, StatusTimeout, Submit, doc, converter, convert, local, locally, submission, docconverter, dc, via, same, machine, location, asp, cfm, cf, coldfusion, php, hypertext, preprocessor, cold, fusion, VBS, VBScript, vb, script, example, create, from, html, text, method, property
 
Last Updated 2008-02-09 Printer Version | Return to Search
 
Knowledge Base Article Feedback*
*KB article feedback ONLY (submit support issues here)
Quality of this article?
  Poor Excellent 
1 2 3 4 5 6 7 8 9 10
Is this article helpful? Yes       No       Maybe
Comments (Optional)
Email Address (Optional)
Please enter the word "PDF"
(without quotes)
 
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.

Copyright © 2005, activePDF, Inc. All Rights Reserved
2003 activePDF Site Map Feedback Privacy Policy Legal