The following VBScript 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.VBS - Code detail provided below.
Click here to download this example (includes required files):
' Define Variables
' PDF output name
varPDFName = "ps.pdf"
' File To Convert
varFile = "file.ps"
' Instantiate Object
Set APS = CreateObject("APServer.Object")
' PS To PDF conversion
varReturn = APS.PSToPDF(varFile, varPDFName)
If varReturn <> 0 Then Error("PSToPDF") End If
' Clear Server Object
Set APS = Nothing
' Conversion Successful
Msgbox "Done!"
' Error Handling
Sub Error(Method)
Msgbox "'" & Method & "' failed with a '" & varReturn
Set APS = Nothing
Wscript.Quit
End Sub
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
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.