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 #10554 - Convert PostScript to PDF using Server
activePDF KB #10554 - Convert PostScript to PDF using Server
Information: Example Printer Version | Return to Search
Convert PostScript to PDF using Server
 
Product Version Code Samples    
Server
3.5.2
VBS
ASP
CF
PHP
 
Description
 
The following PHP example demonstrates the PSToPDF method, which converts a PostScript® file to PDF.

NOTE: This example is available in other script languages, you may select from the Code Sample list above to download the example in the language appropriate for your environment.

These files are required:
  • File.PS - The PS file to convert to PDF.
  • PSToPDF.PHP - Code detail provided below.
Click here to download this example (includes required files):
<?php
// Define Variables
    // PDF output name
    $varPDFName = getcwd() . "\ps.pdf";

    // File To Convert
    $varFile = getcwd() . "\file.ps";
    
// Instantiate Object
$APS = new COM("APServer.Object");

// PS To PDF conversion
$varReturn = $APS->PSToPDF($varFile, $varPDFName);
if ($varReturn != '0') { Error("PSToPDF", $varReturn); }

// Clear Server Object
$APS = null;

// Conversion Successful
echo "Done!";

// Error Handling
function Error($Method, $varReturn)
{
    echo "'$Method' failed with a '$varReturn'<br>";
    $APS = null;
    exit();
}
?>
 
Keywords
 
PSToPDF, Post, Script, PostSCript, To, Convert, Server, method, methods, property, properties, asp, cfm, cf, coldfusion, php, hypertext, preprocessor, cold, fusion, VBS, VBScript, vb, script, example, sample
 
Last Updated 2008-01-01 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