コード例 #1
0
        public void RunPSFile(string path)
        {
            int exit_code;

            int rc_run = _gs.gsapi_run_file(_gs_instance, path, 0, out exit_code);

            if (ierrors.IsFatal(rc_run))
            {
                throw new GhostscriptAPICallException("gsapi_run_file", rc_run);
            }
        }
コード例 #2
0
        /// <summary>
        /// Runs a PostScript file.
        /// </summary>
        public void RunFile(string path)
        {
            if (!File.Exists(path))
            {
                throw new FileNotFoundException("Couldn't find input file.", path);
            }

            int exit_code;

            // GSAPI: tell a Ghostscript to run a file
            int rc_run = _gs.gsapi_run_file(_gs_instance, path, 0, out exit_code);

            if (ierrors.IsFatal(rc_run))
            {
                throw new GhostscriptAPICallException("gsapi_run_file", rc_run);
            }
        }
コード例 #3
0
        /// <summary>
        /// Runs a PostScript file.
        /// </summary>
        public void RunFile(string path)
        {
            if (String.IsNullOrWhiteSpace(path))
            {
                throw new FileNotFoundException("Input file is NULL.", path);
            }

            path = Path.GetFullPath(path).Replace("\\", "/");

            if (!File.Exists(path))
            {
                throw new FileNotFoundException("Couldn't find input file.", path);
            }

            int exit_code;

            // GSAPI: tell a Ghostscript to run a file
            int rc_run = _gs.gsapi_run_file(_gs_instance, path, 0, out exit_code);

            if (ierrors.IsFatal(rc_run))
            {
                throw new GhostscriptAPICallException("gsapi_run_file", rc_run, _stdIO);
            }
        }