# Copyright (c) 2021 ActivePDF, Inc. # ActivePDF Server 2013 # Example generated 04/17/21 require 'win32ole' # Get current path strPath = File.expand_path(File.dirname(__FILE__)) + "\\" # Instantiate Object oSVR = WIN32OLE.new("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 puts "Error with ConvertPSToPDF:" puts "#{results.ServerStatus}" puts results.Details exit 1 end # 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 = '' # Process Complete puts "Done!"