<?php // Copyright (c) 2021 ActivePDF, Inc. // ActivePDF Server 2013 // Example generated 01/23/21 ?> <?php // Get current path $strPath = dirname(__FILE__) . "\\"; // Instantiate Object $oSVR = new COM("APServer.Object"); // Setup the FTP request supplying credentials if needed $oSVR->AddFTPRequest("127.0.0.1", "/folder"); $oSVR->SetFTPCredentials("user", "pass"); // Set which files will upload with the FTP request // To attach a binary file use AddFTPBinaryAttachment $oSVR->FTPAttachOutput = true; $oSVR->AddFTPAttachment($strPath . "file.txt"); // Convert the PostScript file into PDF $results = $oSVR->ConvertPSToPDF($strPath . "PS.ps", $strPath . "ftp.pdf"); if ($results->ServerStatus != 0) { Error("ConvertPSToPDF", $results, $results->ServerStatus); } // Options available to clear or remove FTP requests are only // needed if the object remains instantiated. $oSVR->RemoveFTP("127.0.0.1", "/folder"); $oSVR->ClearFTPAttachments(); $oSVR->ClearFTPs(); // Release Object $oSVR = null; // Process Complete echo "Done!"; // Error Handling function Error($method, $oResults, $errorStatus) { echo "Error with " . $method . ": <br/>" . $errorStatus . "<br/>" . $oResults->details; exit(1); } ?>