Class to access PDF document. More...
Public Member Functions | |
IAsyncOperation< Boolean >^ | LoadAsync (StorageFile^ storageFile, String^ password, uint32 loadFlag) |
Load a PDF file asynchronously. More... | |
IAsyncOperation< Boolean >^ | LoadFromStreamAsync (IRandomAccessStream^ stream, String^ password, uint32 loadFlag) |
Load a PDF file asynchronously, from a stream of data that represents a PDF document in the file system. More... | |
IAsyncOperation< Boolean >^ | SaveAsAsync (StorageFile^ storageFile, uint32 saveFlags, Pause^ pause) |
Saving a PDF document to another file asynchronously. More... | |
void | Close () |
Close the loaded PDF document. More... | |
int32 | CountPages () |
Get page count. More... | |
PageInfo^ | GetPageInfo (int32 index) |
Quickly get page information by index without loading a page. More... | |
IAsyncOperation< Page^ >^ | LoadPageAsync (int32 index, uint32 loadFlag, Pause^ pause) |
Get and parse a PDF page asynchronously. More... | |
Bookmark^ | GetBookmarkRoot () |
Get the root bookmark of the whole bookmark tree. More... | |
Bookmark^ | FindBookmark (Bookmark^ startBookmark, String^ title, uint32 flags) |
Find a bookmark with specific title from a specific bookmark. More... | |
int32 | CountAttachment () |
Get the count of attachments. More... | |
Attachment^ | GetAttachment (int32 index) |
Get a specific attachment. More... | |
Attachment^ | CreateAttachment (StorageFile^ storageFile, int32 index, Boolean isEmbedded) |
Create an attachment object and insert it into current document. More... | |
Boolean | RemoveAttachment (Attachment^ attachment) |
Remove an attachment. More... | |
int32 | CountSignatures () |
Count signatures. More... | |
Signature^ | GetSignature (int32 index) |
Get a signature object by index. More... | |
Signature^ | AddSignature (Page^ page, RectF^ rectangle, uint32 contentsLength) |
Add an unsigned signature object (without appearance) to a specific position in a PDF page. More... | |
Boolean | RemoveSignature (Signature^ signature) |
Remove a signature object. More... | |
Properties | |
int64 | pointer |
Pointer to a handle of PDF document object. This pointer is not useful outside this SDK. The application should not access the pointer to the handle of the PDF document object directly. | |
Class to access PDF document.
PDF document can be loaded by function Document::LoadAsync or Document::LoadFromStreamAsync. After loading a PDF document, user can get a PDF page, or access the PDF bookmarks. Function Document::Close should be called to close the loaded PDF document when there is no need to access it any more.
Signature ^ Foxit::PDF::Document::AddSignature | ( | Page^ | page, |
RectF^ | rectangle, | ||
uint32 | contentsLength | ||
) |
Add an unsigned signature object (without appearance) to a specific position in a PDF page.
[in] | page | A PDF::Page object that specifies the PDF page to add a new unsigned signature object. |
[in] | rectangle | A Foxit::RectF object that specifies the position in the PDF page to add the signature object, in PDF page coordinate system. It should be valid. |
[in] | contentsLength | The content length of the signature value, in bytes. It should be a even number and should not be less than 8196. If this value is less than 8196, Foxit PDF SDK would set the length to 8196 by default. |
void Foxit::PDF::Document::Close | ( | ) |
Close the loaded PDF document.
int32 Foxit::PDF::Document::CountAttachment | ( | ) |
Get the count of attachments.
int32 Foxit::PDF::Document::CountPages | ( | ) |
Get page count.
int32 Foxit::PDF::Document::CountSignatures | ( | ) |
Count signatures.
Attachment ^ Foxit::PDF::Document::CreateAttachment | ( | StorageFile^ | storageFile, |
int32 | index, | ||
Boolean | isEmbedded | ||
) |
Create an attachment object and insert it into current document.
[in] | storageFile | A StorageFile object that specifies the file to be set to current attachment. |
[in] | index | Index of attachment which will be inserted into document. Range: 0 to attachmentCount. attachmentCount is returned by function Document::CountAttachment. |
[in] | isEmbedded | A boolean value which indicates whether the newly created attachment object is an embedded one or a non-embedded one. |
Bookmark ^ Foxit::PDF::Document::FindBookmark | ( | Bookmark^ | startBookmark, |
String^ | title, | ||
uint32 | flags | ||
) |
Find a bookmark with specific title from a specific bookmark.
[in] | startBookmark | A PDF::Bookmark object that specifies a bookmark, from which the searching will start. But this bookmark will not be compared. User can input root bookmark, a founded bookmark in a previous calling of this function or any other bookmark to this parameter, to start a finding process. |
[in] | title | A String object that specifies the title of bookmark to be found. |
[in] | flags | Indicate the find options. 0 means no special finding options. And this flag can be one or combination of the followings:
|
Attachment ^ Foxit::PDF::Document::GetAttachment | ( | int32 | index | ) |
Get a specific attachment.
[in] | index | Index of attachment. Range: 0 to (attachmentcount-1). attachmentcount is returned by function Document::CountAttachment. |
Bookmark ^ Foxit::PDF::Document::GetBookmarkRoot | ( | ) |
Get the root bookmark of the whole bookmark tree.
Please note that "root bookmark" is an abstract object. It can only have some child bookmarks, but no next sibling bookmarks or data (including bookmark data, destination data, and action data).
PageInfo ^ Foxit::PDF::Document::GetPageInfo | ( | int32 | index | ) |
Quickly get page information by index without loading a page.
[in] | index | Index of PDF page. Range: 0 to (pagecount-1). pagecount is returned by function Document::CountPages. |
Signature ^ Foxit::PDF::Document::GetSignature | ( | int32 | index | ) |
Get a signature object by index.
[in] | index | A zero-based index of annotation to be got. Range: 0 to (sigCount-1). sigCount is returned by function SignatureManager::CountSignatures. |
IAsyncOperation<Boolean> ^ Foxit::PDF::Document::LoadAsync | ( | StorageFile^ | storageFile, |
String^ | password, | ||
uint32 | loadFlag | ||
) |
Load a PDF file asynchronously.
It might take a long time to load a document, especially when a file is corrupted, and this function will try to recover the document contents by scanning the whole file.
[in] | storageFile | A StorageFile object that specifies the PDF document to be loaded. |
[in] | password | A String object that specifies the password, which can be either user password or owner password. Just set nullptr for no password. |
[in] | loadFlag | Indicate the loading options. It should be one of the following values:
|
IAsyncOperation<Boolean> ^ Foxit::PDF::Document::LoadFromStreamAsync | ( | IRandomAccessStream^ | stream, |
String^ | password, | ||
uint32 | loadFlag | ||
) |
Load a PDF file asynchronously, from a stream of data that represents a PDF document in the file system.
It might take a long time to load a document, especially when a file is corrupted, and this function will try to recover the document contents by scanning the whole file.
[in] | stream | An IRandomAccessStream object that specifies the PDF document stream to be loaded. |
[in] | password | A String object that specifies the password, which can be either user password or owner password. Just set nullptr for no password. |
[in] | loadFlag | Indicate the loading options. It should be one of the following values:
|
IAsyncOperation<Page^> ^ Foxit::PDF::Document::LoadPageAsync | ( | int32 | index, |
uint32 | loadFlag, | ||
Pause^ | pause | ||
) |
Get and parse a PDF page asynchronously.
[in] | index | Index of PDF page. Range: 0 to (pageCount-1). pageCount is returned by function Document::CountPages. |
[in] | loadFlag | Page loading flags. It should be one of the following values:
|
[in] | pause | (Reserved, should be nullptr currently) A Foxit::Pause object that specifies the pause control for loading a page in progressive process. |
Boolean Foxit::PDF::Document::RemoveAttachment | ( | Attachment^ | attachment | ) |
Remove an attachment.
[in] | attachment | A PDF::Attachment object which will be removed. |
Boolean Foxit::PDF::Document::RemoveSignature | ( | Signature^ | signature | ) |
Remove a signature object.
[in] | signature | A PDF::Signature object that specifies the signature object to be removed. |
IAsyncOperation<Boolean> ^ Foxit::PDF::Document::SaveAsAsync | ( | StorageFile^ | storageFile, |
uint32 | saveFlags, | ||
Pause^ | pause | ||
) |
Saving a PDF document to another file asynchronously.
It will take a long time to save a document with complex or large content.
[in] | storageFile | A StorageFile object that specifies the PDF document to be saved. |
[in] | saveFlags | A saving PDF document flag. Please refer to enumeration PDF::SaveFlags and it should be one or a combination of these flags. |
[in] | pause | (Reserved, should be nullptr currently) A Foxit::Pause object that specifies the pause control for saving a PDF document in progressive process. |