示例#1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <filterpriority>2</filterpriority>
        public void Dispose()
        {
            if (!_disposed)
            {
                if (_file != null)
                {
                    _file.Dispose();
                    _file = null;
                }

                _disposed = true;
            }
        }
示例#2
0
        private PdfDocument(PdfFile file)
        {
            if (file == null)
                throw new ArgumentNullException("file");

            _file = file;

            int pageCount;
            double maxPageWidth;

            bool success = file.GetPDFDocInfo(out pageCount, out maxPageWidth);

            if (!success)
                throw new Win32Exception();

            PageCount = pageCount;
            MaximumPageWidth = maxPageWidth;
        }
示例#3
0
        private PdfDocument(PdfFile file)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            _file = file;

            int    pageCount;
            double maxPageWidth;

            bool success = file.GetPDFDocInfo(out pageCount, out maxPageWidth);

            if (!success)
            {
                throw new Win32Exception();
            }

            PageCount        = pageCount;
            MaximumPageWidth = maxPageWidth;
        }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the PdfDocument class with the provided stream.
 /// </summary>
 /// <param name="stream"></param>
 public PdfDocument(Stream stream)
     : this(PdfFile.Create(stream))
 {
 }
示例#5
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <filterpriority>2</filterpriority>
        public void Dispose()
        {
            if (!_disposed)
            {
                if (_file != null)
                {
                    _file.Dispose();
                    _file = null;
                }

                _disposed = true;
            }
        }