コード例 #1
0
        static void Main(string[] args)
        {
            string strPath = System.AppDomain.CurrentDomain.BaseDirectory;

            // Instantiate Object
            APDocConverter.DocConverter docConverter =
                new APDocConverter.DocConverter();

            // Enable extra logging (logging should only be used while
            // troubleshooting) C:\ProgramData\activePDF\Logs\
            docConverter.Debug = true;

            // Start a remote conversion by opening a connection
            // Specify the IP address of the machine with the DocConverter
            // installation If 0 is used as the port number DocConverter will
            // use the default port
            docConverter.OpenRemoteConnection("#.#.#.#", 62625);

            // Convert the file to PDF
            // If the output parameter is not used the created PDF will use
            // the input string substituting the filename extension to 'pdf'
            DCDK.Results.DocConverterResult result =
                docConverter.ConvertToPDF(
                    $"{strPath}DocConverter.Word.Input.doc",
                    $"{strPath}DocConverter.RemoteConversion.pdf");

            // Close the remote connection when finished
            docConverter.CloseRemoteConnection();

            WriteResult(result);

            // Process Complete
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }