Interface IPdfDocument
Represents an open PDF document contract independent of any UI or native implementation.
public interface IPdfDocument : IAsyncDisposable, IDisposable
- Inherited Members
Properties
FilePath
The path the document was opened from; for a document opened from memory, the name given at open time.
string FilePath { get; }
Property Value
IsOpen
False after the document is disposed.
bool IsOpen { get; }
Property Value
Metadata
The document information and permissions read at open time.
DocumentMetadata Metadata { get; }
Property Value
PageCount
The number of pages.
int PageCount { get; }
Property Value
Methods
GetBookmarksAsync(CancellationToken)
Gets the document outline (bookmarks) as a tree. The list is empty when the document has no outline.
ValueTask<IReadOnlyList<BookmarkItem>> GetBookmarksAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the operation.
Returns
GetPageAsync(int, CancellationToken)
Gets a page object.
ValueTask<IPdfPage> GetPageAsync(int pageNumber, CancellationToken cancellationToken = default)
Parameters
pageNumberintThe page number, starting at 1.
cancellationTokenCancellationTokenCancels the operation.
Returns
Exceptions
- ArgumentOutOfRangeException
pageNumberis less than 1 or greater than PageCount.
GetPageInfoAsync(int, CancellationToken)
Gets the size and rotation of a page.
ValueTask<PageInfo> GetPageInfoAsync(int pageNumber, CancellationToken cancellationToken = default)
Parameters
pageNumberintThe page number, starting at 1.
cancellationTokenCancellationTokenCancels the operation.
Returns
Exceptions
- ArgumentOutOfRangeException
pageNumberis less than 1 or greater than PageCount.