Represents a Ghostscript interpreter.
Inheritance: IDisposable
Esempio n. 1
0
        public void Close()
        {
            if (_formatHandler != null)
            {
                _formatHandler = null;
            }

            if (_interpreter != null)
            {
                _interpreter.Dispose();
                _interpreter = null;
            }
        }
Esempio n. 2
0
        public void Open(GhostscriptVersionInfo versionInfo, bool dllFromMemory)
        {
            if (versionInfo == null)
            {
                throw new ArgumentNullException("versionInfo");
            }

            this.Close();

            _filePath = string.Empty;

            _interpreter = new GhostscriptInterpreter(versionInfo, dllFromMemory);

            this.Open();
        }
Esempio n. 3
0
        public void Open(byte[] library)
        {
            if (library == null)
            {
                throw new ArgumentNullException("library");
            }

            this.Close();

            _filePath = string.Empty;

            _interpreter = new GhostscriptInterpreter(library);

            this.Open();
        }
Esempio n. 4
0
        public void Open(string path, byte[] library)
        {
            if (!File.Exists(path))
            {
                throw new FileNotFoundException("Could not find input file.", path);
            }

            if (library == null)
            {
                throw new ArgumentNullException("library");
            }

            this.Close();

            _filePath = path;

            _interpreter = new GhostscriptInterpreter(library);

            this.Open();
        }
Esempio n. 5
0
        public void Open(string path, GhostscriptVersionInfo versionInfo, bool dllFromMemory)
        {
            if (!File.Exists(path))
            {
                throw new FileNotFoundException("Could not find input file.", path);
            }

            if (versionInfo == null)
            {
                throw new ArgumentNullException("versionInfo");
            }

            this.Close();

            _filePath = path;

            _interpreter = new GhostscriptInterpreter(versionInfo, dllFromMemory);

            this.Open();
        }
Esempio n. 6
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    if (_formatHandler != null)
                    {
                        _formatHandler.Dispose();
                        _formatHandler = null;
                    }

                    if (_interpreter != null)
                    {
                        _interpreter.Dispose();
                        _interpreter = null;
                    }
                }

                _fileCleanupHelper.Cleanup();

                _disposed = true;
            }
        }
        public void Open(byte[] gsDll)
        {
            if (gsDll == null)
            {
                throw new ArgumentNullException("gsDll", "Cannot be null.");
            }

            this.Close();

            _filePath = string.Empty;

            _interpreter = new GhostscriptInterpreter(gsDll);

            this.Open();
        }
        public void Open(string path, byte[] gsDll)
        {
            if (!File.Exists(path))
            {
                throw new FileNotFoundException("Could not find input file.", path);
            }

            if (gsDll == null)
            {
                throw new ArgumentNullException("gsDll", "Cannot be null.");
            }

            this.Close();

            _filePath = path;

            _interpreter = new GhostscriptInterpreter(gsDll);

            this.Open();
        }