/// <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; } }
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; }
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; }
/// <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)) { }