Class to access PDF document. More...
Public Member Functions | |
Boolean | Load (Stream^ stream, String^ password, UInt32 loadFlag) |
Load a PDF file. More... | |
Boolean | SaveAs (Stream^ stream, UInt32 saveFlags, Pause^ pause) |
Saving a PDF document to another file. 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... | |
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 (FileInfo^ fileInfo, 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... | |
Boolean | SaveToFile (String^ filePath, UInt32 saveFlags, Pause^ pause) |
Saving a PDF document to a specific file path. More... | |
Boolean | LoadFromFilePath (String^ filePath, String^ password, UInt32 loadFlag) |
Load a PDF file with the extra flags from a specific file path. More... | |
Page^ | LoadPage (Int32 index, UInt32 loadFlag, Pause^ pause) |
Get and parse a PDF page. 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::Load or Document::LoadFromFilePath. 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 | ( | FileInfo^ | fileInfo, |
Int32 | index, | ||
Boolean | isEmbedded | ||
) |
Create an attachment object and insert it into current document.
[in] | fileInfo | A FileInfo 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. |
Boolean Foxit::PDF::Document::Load | ( | Stream^ | stream, |
String^ | password, | ||
UInt32 | loadFlag | ||
) |
Load a PDF file.
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 | A Stream object that specifies the PDF document to be loaded. Currently, only support FileStream. User should ensure this stream can be read. |
[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:
|
Boolean Foxit::PDF::Document::LoadFromFilePath | ( | String^ | filePath, |
String^ | password, | ||
UInt32 | loadFlag | ||
) |
Load a PDF file with the extra flags from a specific file path.
[in] | filePath | String to a UTF-8 encoded string that specifies a path of file. |
[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:
|
Get and parse a PDF page.
[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. |
Boolean Foxit::PDF::Document::SaveAs | ( | Stream^ | stream, |
UInt32 | saveFlags, | ||
Pause^ | pause | ||
) |
Saving a PDF document to another file.
It will take a long time to save a document with complex or large content.
[in] | stream | A Stream object that specifies the PDF document to be saved. Currently, only support FileStream. User should ensure this stream can be written and should close this stream after saving process is finished. |
[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. |
Boolean Foxit::PDF::Document::SaveToFile | ( | String^ | filePath, |
UInt32 | saveFlags, | ||
Pause^ | pause | ||
) |
Saving a PDF document to a specific file path.
[in] | filePath | A String object that specifies the path of save file. |
[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. |