protected void Dispose(bool disposing)
        {
            if (!_disposed && disposing)
            {
                if (_file != null)
                {
                    _file.Dispose();
                    _file = null;
                }

                _disposed = true;
            }
        }
        private PdfDocument(PdfFile file)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            _file = file;

            var pageSizes = file.GetPDFDocInfo();

            if (pageSizes == null)
            {
                throw new Win32Exception();
            }

            PageSizes = new ReadOnlyCollection <SizeF>(pageSizes);
        }
 private PdfDocument(Stream stream)
     : this(PdfFile.Create(stream))
 {
 }