private PdfDocument(Stream stream, string password) { _file = new PdfFile(stream, password); _pageSizes = _file.GetPDFDocInfo(); if (_pageSizes == null) throw new Win32Exception(); PageSizes = new ReadOnlyCollection<SizeF>(_pageSizes); }
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); }
/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> /// <param name="disposing">Whether this method is called from Dispose.</param> 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); }
protected void Dispose(bool disposing) { if (!_disposed && disposing) { if (_file != null) { _file.Dispose(); _file = null; } _disposed = true; } }
private PdfDocument(Stream stream) : this(PdfFile.Create(stream)) { }
private PdfDocument(Stream stream) : this(PdfFile.Create(stream)) { this._pdfFileStream = stream; }