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. 2
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. 3
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;
                    }
                }

                _disposed = true;
            }
        }