PdfDocument PdfDocument PdfDocument PdfDocument Class

Definition

Represents a Portable Document Format (PDF) document.

public : sealed class PdfDocument : IPdfDocumentpublic sealed class PdfDocument : IPdfDocumentPublic NotInheritable Class PdfDocument Implements IPdfDocument// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Methods of this class return an STG_E_READFAULT error if there is a problem in reading the Portable Document Format (PDF) document.

Properties

IsPasswordProtected IsPasswordProtected IsPasswordProtected IsPasswordProtected

Gets whether the Portable Document Format (PDF) document is password-protected.

public : PlatForm::Boolean IsPasswordProtected { get; }public bool IsPasswordProtected { get; }Public ReadOnly Property IsPasswordProtected As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the Portable Document Format (PDF) document is password-protected; otherwise, false.

PageCount PageCount PageCount PageCount

Gets the number of pages in the Portable Document Format (PDF) document.

public : unsigned int PageCount { get; }public uint PageCount { get; }Public ReadOnly Property PageCount As uint// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The number of pages in the Portable Document Format (PDF) document.

Methods

GetPage(UInt32) GetPage(UInt32) GetPage(UInt32) GetPage(UInt32)

Gets a page from a Portable Document Format (PDF) document.

public : PdfPage GetPage(unsigned int pageIndex)public PdfPage GetPage(UInt32 pageIndex)Public Function GetPage(pageIndex As UInt32) As PdfPage// You can use this method in JavaScript.
Parameters
pageIndex
unsigned int UInt32 UInt32 UInt32

The location of the Portable Document Format (PDF) page relative to its parent document.

Returns

The Portable Document Format (PDF) page.

Remarks

The first page of a Portable Document Format (PDF) document is 0 (zero).

LoadFromFileAsync(IStorageFile) LoadFromFileAsync(IStorageFile) LoadFromFileAsync(IStorageFile) LoadFromFileAsync(IStorageFile)

Outputs an asynchronous operation. When the operation completes, a PdfDocument object is returned, which represents a Portable Document Format (PDF) document.

public : static IAsyncOperation<PdfDocument> LoadFromFileAsync(IStorageFile file)public static IAsyncOperation<PdfDocument> LoadFromFileAsync(IStorageFile file)Public Static Function LoadFromFileAsync(file As IStorageFile) As IAsyncOperation( Of PdfDocument )// You can use this method in JavaScript.
Parameters
file
IStorageFile IStorageFile IStorageFile IStorageFile

The file, which represents a Portable Document Format (PDF) document.

Returns
See Also

LoadFromFileAsync(IStorageFile, String) LoadFromFileAsync(IStorageFile, String) LoadFromFileAsync(IStorageFile, String) LoadFromFileAsync(IStorageFile, String)

Outputs an asynchronous operation. When the operation completes, a PdfDocument object is returned, which represents a Portable Document Format (PDF) document. Use this method if the Portable Document Format (PDF) document is password-protected.

public : static IAsyncOperation<PdfDocument> LoadFromFileAsync(IStorageFile file, PlatForm::String password)public static IAsyncOperation<PdfDocument> LoadFromFileAsync(IStorageFile file, String password)Public Static Function LoadFromFileAsync(file As IStorageFile, password As String) As IAsyncOperation( Of PdfDocument )// You can use this method in JavaScript.
Parameters
file
IStorageFile IStorageFile IStorageFile IStorageFile

The file, which represents a Portable Document Format (PDF) document.

password
PlatForm::String String String String

The password to open the Portable Document Format (PDF) document, if it requires one.

Returns

Remarks

If the Portable Document Format (PDF) document does not require a password, this method ignores it.

This method returns an ERROR_WRONG_PASSWORD error if the wrong password is specified.

See Also

LoadFromStreamAsync(IRandomAccessStream) LoadFromStreamAsync(IRandomAccessStream) LoadFromStreamAsync(IRandomAccessStream) LoadFromStreamAsync(IRandomAccessStream)

Creates a PdfDocument object, representing a Portable Document Format (PDF) document, from a stream of data that represents a Portable Document Format (PDF) document in the file system.

public : static IAsyncOperation<PdfDocument> LoadFromStreamAsync(IRandomAccessStream inputStream)public static IAsyncOperation<PdfDocument> LoadFromStreamAsync(IRandomAccessStream inputStream)Public Static Function LoadFromStreamAsync(inputStream As IRandomAccessStream) As IAsyncOperation( Of PdfDocument )// You can use this method in JavaScript.
Parameters
inputStream
IRandomAccessStream IRandomAccessStream IRandomAccessStream IRandomAccessStream

The stream of data, which represents a Portable Document Format (PDF) document.

Returns
See Also

LoadFromStreamAsync(IRandomAccessStream, String) LoadFromStreamAsync(IRandomAccessStream, String) LoadFromStreamAsync(IRandomAccessStream, String) LoadFromStreamAsync(IRandomAccessStream, String)

Creates a PdfDocument object, representing a Portable Document Format (PDF) document, from a stream of data that represents a Portable Document Format (PDF) document in the file system. Use this method if the Portable Document Format (PDF) document is password-protected.

public : static IAsyncOperation<PdfDocument> LoadFromStreamAsync(IRandomAccessStream inputStream, PlatForm::String password)public static IAsyncOperation<PdfDocument> LoadFromStreamAsync(IRandomAccessStream inputStream, String password)Public Static Function LoadFromStreamAsync(inputStream As IRandomAccessStream, password As String) As IAsyncOperation( Of PdfDocument )// You can use this method in JavaScript.
Parameters
inputStream
IRandomAccessStream IRandomAccessStream IRandomAccessStream IRandomAccessStream

The stream of data, which represents a Portable Document Format (PDF) document.

password
PlatForm::String String String String

The password to open the Portable Document Format (PDF) document, if it requires one.

Returns

Remarks

If the Portable Document Format (PDF) document does not require a password, this method ignores it.

This method returns an ERROR_WRONG_PASSWORD error if the wrong password is specified.

See Also

See Also