The following VBScript example demonstrates the PSToPDF Server 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:
postscript.PS - The PS file to convert to PDF.
PSToPDF.VBS - Code detail provided below.
Click here to download this example for VBScript (includes required files):
Example:
' Variables
' Name of PS file to convert
strPSFileName = "postscript.ps"
' Name of PDF file to create
strPDFFileName = "ps.pdf"
' Instantiate activePDF Server Object
Set objSVR = CreateObject("APServer.Object")
' PSToPDF
lngRtn = objSVR.PSToPDF(strPSFileName, strPDFFileName)
If lngRtn = 0 Then
msgbox "Done!"
Else
errorRtn "PSToPDF", lngRtn
End If
' Release Object
Set objSVR = Nothing
' Error Return Handling
Sub errorRtn(strMethod, RtnCode)
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.