Public Member Functions | |
PDFDoc () | |
Constructor. More... | |
PDFDoc (string path) | |
Constructor, from an existing PDF file path. More... | |
PDFDoc (global::System.IntPtr buffer, uint size) | |
Constructor, from a memory buffer. More... | |
PDFDoc (FileReaderCallback file_read, bool is_async) | |
Constructor, with a file read callback object. More... | |
PDFDoc (foxit.pdf.PDFDoc arg0) | |
Constructor, with another PDF document object. | |
int | AddIndirectObject (PDFObject pdf_object) |
Add a PDF object to current PDF document, to be an indirect object. More... | |
PDFDoc.PasswordType | CheckPassword (byte[] password) |
Check the type of a specified password. More... | |
PDFDoc.PasswordType | CheckPassword (string password) |
(Only supported in PDF 2.0) Check the type of a specified unicode password. More... | |
void | ClearRenderCache () |
Clear the cache used during rendering, to reduce the memory usage. More... | |
Bookmark | CreateRootBookmark () |
Create new bookmark root node. More... | |
void | DeleteIndirectObject (int object_number) |
Delete an indirect object by indirect object number. More... | |
bool | DoJSOpenAction () |
Perform JavaScript actions when the document is opened. More... | |
bool | ExportAnnotToFDF (Annot pdf_annot, foxit.fdf.FDFDoc fdf_doc) |
Export specified annotation to a FDF/XFDF document. More... | |
bool | ExportToFDF (foxit.fdf.FDFDoc fdf_doc, int types, Range page_range) |
Export form fields and annotations to a FDF/XFDF document. More... | |
PDFDictionary | GetCatalog () |
Get the catalog dictionary. More... | |
CertificateEncryptData | GetCertificateEncryptData () |
Get encrypt data of certificate encryption. More... | |
CustomEncryptData | GetCustomEncryptData () |
Get encrypt data of custom encryption. More... | |
PDFDoc.DisplayMode | GetDisplayMode () |
Get the display mode. More... | |
string | GetDocURI () |
Get the URI of connected PDF if current PDF is a connected PDF. More... | |
DRMEncryptData | GetDRMEncryptData () |
Get encrypt data of Foxit DRM encryption. More... | |
PDFDictionary | GetEncryptDict () |
Get the encrypt dictionary. More... | |
PDFDoc.EncryptType | GetEncryptionType () |
Get the encryption type. More... | |
string | GetEndpoint () |
Get the URL of ConnectedPDF Web services if current PDF is a connected PDF. More... | |
int | GetFileSize () |
Get file size. More... | |
int | GetFileVersion () |
Get PDF file version stored in PDF header section. More... | |
int | GetFirstAvailPageIndex () |
Get the page index of the fist available page. More... | |
Font | GetFont (int index) |
Get a font by index. More... | |
int | GetFontCount () |
Count all the PDF fonts used in current PDF document. More... | |
PDFObject | GetIndirectObject (int object_number) |
Get an indirect object by indirect object number. More... | |
PDFDictionary | GetInfo () |
Get the information dictionary. More... | |
Action | GetOpenAction () |
Get the action to be performed when the document is opened. More... | |
PDFPage | GetPage (int index) |
Get a PDF page by index. More... | |
PageBasicInfo | GetPageBasicInfo (int index) |
Get the basic information of a page specified by index. More... | |
int | GetPageCount () |
Get the count of pages. More... | |
PDFDictionary | GetPagesDict () |
Get the dictionary of "Pages". More... | |
PDFDoc.PasswordType | GetPasswordType () |
Get the type of current used password. More... | |
ReadingBookmark | GetReadingBookmark (int index) |
Get a reading bookmark by index. More... | |
int | GetReadingBookmarkCount () |
Get the count of reading bookmarks. More... | |
RMSEncryptData | GetRMSEncryptData () |
Get encrypt data of RMS encryption. More... | |
Bookmark | GetRootBookmark () |
Get bookmark root node. More... | |
SecurityHandler | GetSecurityHandler () |
Get current PDF security handler of current document. More... | |
Signature | GetSignature (int index) |
Get a signature by index. More... | |
int | GetSignatureCount () |
Get the count of signature. More... | |
StdEncryptData | GetStdEncryptData () |
Get encrypt data of standard encryption (known as password encryption). More... | |
PDFDictionary | GetTrailer () |
Get the trailer dictionary. More... | |
string | GetUserPassword (byte[] owner_password) |
Get the user password based on owner password. More... | |
int | GetUserPermissions () |
Get user access permissions. More... | |
WrapperData | GetWrapperData () |
Get wrapper data. More... | |
long | GetWrapperOffset () |
Get wrapper offset. More... | |
bool | HasForm () |
Check whether current PDF document has interactive form (also known as AcroForm). More... | |
bool | ImportFromFDF (foxit.fdf.FDFDoc fdf_doc, int types, Range page_range) |
Import form fields and annotations from a FDF/XFDF document. More... | |
PDFPage | InsertPage (int index, float width, float height) |
Insert a new blank PDF page to document, by index. More... | |
PDFPage | InsertPage (int index, PDFPage.Size size) |
Insert a new blank PDF page to document, by index. More... | |
ReadingBookmark | InsertReadingBookmark (int reading_bookmark_index, string title, int dest_page_index) |
Insert a reading bookmark to current PDF document. More... | |
bool | IsCDRM () |
Check whether the loaded document is a ConnectedPDF DRM document or not. More... | |
bool | IsCPDF () |
Check whether the loaded document is a ConnectedPDF document or not. More... | |
bool | IsEmpty () |
Check whether current object is empty or not. More... | |
bool | IsEncrypted () |
Check whether current document is an encrypted file or not. More... | |
bool | IsLinearized () |
Check if current PDF document is a linearized file. More... | |
bool | IsPortfolio () |
Check whether current PDF document is a portfolio file or not. More... | |
bool | IsTaggedPDF () |
Check if current PDF document is a Tagged PDF file. More... | |
bool | IsWrapper () |
Check whether current document is a wrapper file or not. More... | |
bool | IsXFA () |
Check whether current PDF document is an XFA document. More... | |
ErrorCode | Load (byte[] password) |
Load current document content by using a specified password. More... | |
ErrorCode | LoadW (string password) |
Load current document content by using a specified password. More... | |
bool | MovePagesTo (Range page_range, int dest_index) |
Move one or more pages (specified by index) to a new index position. More... | |
bool | MovePageTo (PDFPage page, int dest_index) |
Move a specified page to a new index position. More... | |
bool | RemoveBookmark (Bookmark bookmark) |
Remove a specified bookmark. More... | |
bool | RemoveOpenAction () |
Remove the action to be performed when the document is opened. More... | |
bool | RemovePage (int index) |
Remove a PDF page by page index. More... | |
bool | RemovePage (PDFPage page) |
Remove a specified PDF page. More... | |
bool | RemoveReadingBookmark (ReadingBookmark reading_bookmark) |
Remove a reading bookmark from current PDF document. More... | |
bool | RemoveSecurity () |
Remove the security handler from current document, so that the later saved document will be unencrypted. More... | |
void | RemoveSignature (Signature signature) |
Remove a signature. More... | |
bool | SaveAs (string file_path, int save_flags) |
Save current PDF document as another PDF file. More... | |
bool | SaveAsWrapperFile (string file_path, WrapperData wrapper_data, int user_permissions, string owner_password) |
Save current PDF document as a wrapper file. More... | |
void | SetDisplayMode (PDFDoc.DisplayMode display_mode) |
Set the display mode. More... | |
void | SetFileVersion (int version) |
Set the PDF file version which will be stored in PDF header section of the saved PDF file. More... | |
bool | SetOpenAction (Action action) |
Set the action to be performed when the document is opened. More... | |
bool | SetSecurityHandler (SecurityHandler handler) |
Set a PDF security handler for encryption, such as standard encryption(password), certificate encryption, and so on. More... | |
Progressive | StartImportPages (int dest_index, foxit.pdf.PDFDoc src_doc, int flags, string layer_name, Range page_range, PauseCallback pause) |
Start to import pages from another PDF document (via PDF document object). More... | |
Progressive | StartImportPagesFromFilePath (int dest_index, string src_file_path, byte[] password, int flags, string layer_name, Range page_range, PauseCallback pause) |
Start to import pages from another PDF document (via file path). More... | |
Progressive | StartLoad (byte[] password, bool is_cache_stream, PauseCallback pause) |
Start to loading current document content by using a specified password. More... | |
Progressive | StartLoadW (string password, bool is_cache_stream, PauseCallback pause) |
Start to loading current document content by using a specified password. More... | |
Progressive | StartSaveAs (string file_path, int save_flags, PauseCallback pause) |
Start to save current PDF document as another PDF file. More... | |
Progressive | StartSaveAs (FileWriterCallback file, int save_flags, PauseCallback pause) |
Start to save current PDF document as another PDF file. More... | |
Progressive | StartSaveAsPayloadFile (string file_path, string payload_file_path, string sub_type, string description, float version, int save_flags, PauseCallback pause) |
Start to save current PDF document as a wrapper document with a payload document (defined in PDF 2.0). More... | |
A PDF document object can be constructed with an existing PDF file from file path, memory buffer, a custom implemented ReaderCallback object and an input file stream. And then call function pdf::PDFDoc::StartLoad or pdf::PDFDoc::StartLoad to load document content. This class offers functions to retrieve different part of a PDF document. For example:
To retrieve pages, please use functions pdf::PDFDoc::GetPageCount and pdf::PDFDoc::GetPage.
To retrieve bookmark, such as function pdf::PDFDoc::GetRootBookmark, pdf::PDFDoc::CreateRootBookmark, etc.
To retrieve some document's dictionaries (in low-level), such as functions pdf::PDFDoc::GetCatalog, pdf::PDFDoc::GetTrailer, etc.
To retrieve reading bookmark, such as functions pdf::PDFDoc::GetReadingBookmarkCount, pdf::PDFDoc::GetReadingBookmark, etc.
To check if a PDF document has interactive form, please use function pdf::PDFDoc::HasForm.
This class also offers functions for features, such as saving current document as another PDF file, importing pages from another PDF file, setting security handler in order to save encrypted PDF file, and so on.
This class object can also be used to construct objects of other classes in order to access specified information in PDF document:
To access form, please construct a interform::Form object with PDF document object.
To access additional actions, please construct an actions::AdditionalAction object with PDF document object.
To access viewer preferences information, please construct a DocViewerPrefs object with PDF document object.
To access metadata information, please construct a Metadata object with PDF document object.
To manage page labels information, please construct a PageLabels object with PDF document object.
To search among a PDF file, please construct a TextSearch object with PDF document object.
To access layers, please construct a LayerTree object with PDF document object. And to render layers, please constructor a LayerContext object with PDF document object.
To construct a new FileSpec object.
To manage associated files, please construct an AssociatedFiles object with PDF document object.
To access name tree, please construct a objects::PDFNameTree object with PDF document object. Specially, for EmbeddedFiles name tree, an Attachments object can be constructed with PDF document object, for convenient use.
To do redaction, please construct a addon::Redaction object with PDF document object.
|
strong |
Enumeration for data type used to decide which object(s) will be imported from or exported to FDF/XFDF document.
Values of this enumeration can be used alone or in combination.
|
strong |
Enumeration for display mode which specifies how the document should be displayed when opened.
Values of this enumeration should be used alone.
|
strong |
Enumeration for encryption type.
Values of this enumeration should be used alone.
|
strong |
Enumeration for flags used for importing pages.
Values of this enumeration can be used alone or in combination.
|
strong |
Enumeration for the type of current used password in a PDF document.
Values of this enumeration should be used alone.
|
strong |
Enumeration for PDF document saving flags.
Values of this enumeration can be used alone or in combination.
Enumerator | |
---|---|
e_SaveFlagNormal | Save document normally, without using any special flag. This can only be used alone. |
e_SaveFlagIncremental | Save document incrementally. This can be used alone or be combined with other saving flags except e_SaveFlagNormal. Especially, if this is combined with e_SaveFlagNoOriginal, only the increment data will be saved. |
e_SaveFlagNoOriginal | Save document without original data or unchanged objects. This can be used alone or be combined with other saving flags except e_SaveFlagNormal. Especially, if this is combined with e_SaveFlagIncremental, only the increment data will be saved. |
e_SaveFlagXRefStream | Save document by using XRef stream. This can be used alone or be combined with other saving flags except e_SaveFlagNormal. |
e_SaveFlagLinearized | Save document as a linearized file. This should be used alone and cannot be used with other saving flags. This can only be used for function pdf::PDFDoc::SaveAs or pdf::PDFDoc::StartSaveAs. |
|
strong |
Enumeration for user access permissions in a PDF document.
Values of this enumeration can be used alone or in combination.
Enumerator | |
---|---|
e_PermPrint | Print PDF document with normal mode. (Bit 3 in permission value) If user wants to print a higher quality level of PDF document, please set current value with value e_PermPrintHigh together. |
e_PermModify | Modify PDF contents. (Bit 4 in permission value) If this value is set, user can modify contents of PDF document by operations other than those controlled by values e_PermAnnotForm, e_PermFillForm and e_PermAssemble. |
e_PermExtract | Extract PDF contents. (Bit 5 in permission value) If this value is set, user can copy or otherwise extract text and graphics from the document by operations other than that controlled by value e_PermExtractAccess. |
e_PermAnnotForm | Operate text annotations and fill in interactive form fields. (Bit 6 in permission value) If value e_PermModify is also set, user can create or modify interactive form fields (including signature fields). |
e_PermFillForm | Fill PDF form. (Bit 9 in permission value) If this value is set, user can fill in interactive form fields (including signature fields), even if value e_PermAnnotForm is not used. |
e_PermExtractAccess | Disabilities support. (Bit 10 in permission value) If this value is set, user can extract text and graphics in support of accessibility to users with disabilities or for other purposes. |
e_PermAssemble | Assemble PDF document. (Bit 11 in permission value) If this value is set, it enables to assemble the document (Insert, rotate, or delete pages and create bookmarks or thumbnail images), regardless if value e_PermModify is set or not. |
e_PermPrintHigh | Print PDF document with higher qualities. (Bit 12 in permission value) If this value is not set (and value e_PermPrint is set), printing is limited to a low-level representation of the appearance, possibly of degraded quality. |
|
inline |
Constructor.
This constructor is to construct a new PDF document (without any data). The file version value would be 17 (as PDF version 1.7) by default.
|
inline |
Constructor, from an existing PDF file path.
After constructing such a PDF document object, please ensure the document object has been loaded before using most functions in class pdf::PDFDoc.
path | A full path of an existing PDF file. It should not be an empty string. |
|
inline |
Constructor, from a memory buffer.
After constructing such a PDF document object, please ensure the document object has been loaded before using most functions in class pdf::PDFDoc.
buffer | A memory buffer, containing the serialized document. The PDF document data should be fully loaded in this memory buffer. It should not be null. |
size | The size of memory buffer. It should be above 0. |
|
inline |
Constructor, with a file read callback object.
After constructing such a PDF document object, please ensure the document object has been loaded before using most functions in class pdf::PDFDoc.
file_read | A ReaderCallback object which is implemented by user to load a PDF document. It should not be null. If the input callback object is a AsyncReaderCallback, and is_async is true that means the PDF document will be loaded by asynchronous method; otherwise, the document will be loaded in common way. |
is_async | Whether the input ReaderCallback object is for asynchronously loading or not. |
|
inline |
Add a PDF object to current PDF document, to be an indirect object.
If input PDF object is a direct object (whose indirect object number is 0), this functions will change it to be an indirect object and add to PDF document. Then return the new indirect object number.
If input PDF object is already an indirect object (whose indirect object number is above 0), this function will not add it into document again. The return value will be its own indirect object number.
pdf_object | A PDFObject object. It should not be null. |
|
inline |
Check the type of a specified password.
This function can be used to check the type of any password string, including the password string used for loading document content.
password | A password string to be detected. |
|
inline |
(Only supported in PDF 2.0) Check the type of a specified unicode password.
This function can be used to check the type of any password string, including the password string used for loading document content.
password | A unicode password string to be detected. |
|
inline |
Clear the cache used during rendering, to reduce the memory usage.
|
inline |
Create new bookmark root node.
If current PDF document already has the bookmark root node, this function will remove the old bookmark tree and create a new root node instead.
|
inline |
Delete an indirect object by indirect object number.
object_number | The indirect object number. It should be above 0. |
|
inline |
Perform JavaScript actions when the document is opened.
|
inline |
Export specified annotation to a FDF/XFDF document.
pdf_annot | A valid PDF annotation object to be exported to the FDF/XFDF document. |
fdf_doc | A valid FDF/XFDF document object, to which the specified annotation will be exported. |
|
inline |
Export form fields and annotations to a FDF/XFDF document.
fdf_doc | A valid FDF/XFDF document object, to which form fields and annotations will be exported. |
types | Used to decide which kind of data will be exported. Please refer to values e_XXX and this can be one or a combination of these values. |
page_range | A Range object that specifies some pages. Data (in specified types) in these pages will be exported to FDF/XFDF document. If this Range object is constructed by default constructor and not set any value, that means all the data (in specified types) of current document will be exported to FDF/XFDF document. |
|
inline |
Get the catalog dictionary.
|
inline |
Get encrypt data of certificate encryption.
This function is useful when current document is encrypted by certificate.
|
inline |
Get encrypt data of custom encryption.
This function is useful when current document is encrypted by custom.
|
inline |
Get the display mode.
Display mode specifies how the document should be displayed when opened.
|
inline |
Get the URI of connected PDF if current PDF is a connected PDF.
|
inline |
Get encrypt data of Foxit DRM encryption.
This function is useful when current document is encrypted by Foxit DRM.
|
inline |
Get the encrypt dictionary.
|
inline |
Get the encryption type.
|
inline |
Get the URL of ConnectedPDF Web services if current PDF is a connected PDF.
|
inline |
Get file size.
|
inline |
Get PDF file version stored in PDF header section.
|
inline |
Get the page index of the fist available page.
This is useful for a linearized PDF document because in a linearized PDF document the first available page may not be the first page.
This function can be used only when document is loaded successfully.
|
inline |
Get a font by index.
index | The index of PDF font. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetFontCount. |
|
inline |
Count all the PDF fonts used in current PDF document.
This function will enumerate all the font resources used for pages, annotations, and interactive form.
|
inline |
Get an indirect object by indirect object number.
object_number | The indirect object number. It should be above 0. |
|
inline |
Get the information dictionary.
Document's information dictionary contains metadata for the document.
|
inline |
Get the action to be performed when the document is opened.
|
inline |
Get a PDF page by index.
If current PDF document object is constructed with a AsyncReaderCallback which means to do asynchronous loading, this function may throw exception e_ErrDataNotReady. In this case, user should prepare data for specified range informed by callback function common::file::AsyncReaderCallback::AddDownloadHint and then call this function again.
index | The page index. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetPageCount. |
|
inline |
Get the basic information of a page specified by index.
This function can quickly get the basic information of a PDF page without getting that PDF page object. If current PDF document object is constructed with a AsyncReaderCallback which means to do asynchronous loading, this function may throw exception e_ErrDataNotReady. In this case, user should prepare data for specified range informed by callback function common::file::AsyncReaderCallback::AddDownloadHint and then call this function again.
index | The page index. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetPageCount. |
|
inline |
Get the count of pages.
|
inline |
Get the dictionary of "Pages".
|
inline |
Get the type of current used password.
This function is useful after loading a PDF document, in order to get the type of the password which was used in the loading process.
If current document is a new one (not loading from existed PDF file), this function will return e_PwdNoPassword.
If current document is constructed from an existing file but has not been loaded yet, this function will return e_PwdInvalid.
|
inline |
Get a reading bookmark by index.
index | The index of reading bookmarks. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetReadingBookmarkCount. |
|
inline |
Get the count of reading bookmarks.
|
inline |
Get encrypt data of RMS encryption.
This function is useful when current document is encrypted by RMS.
|
inline |
Get bookmark root node.
|
inline |
Get current PDF security handler of current document.
|
inline |
Get a signature by index.
index | The index of signature. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetSignatureCount. |
|
inline |
Get the count of signature.
|
inline |
Get encrypt data of standard encryption (known as password encryption).
This function is useful when current document is encrypted by password.
|
inline |
Get the trailer dictionary.
|
inline |
Get the user password based on owner password.
This function is useful when current document is encrypted by password.
owner_password | Owner password string. |
|
inline |
Get user access permissions.
|
inline |
Get wrapper data.
|
inline |
Get wrapper offset.
|
inline |
Check whether current PDF document has interactive form (also known as AcroForm).
If current PDF document object is constructed with a AsyncReaderCallback which means to do asynchronous loading, this function may throw exception e_ErrDataNotReady. In this case, user should prepare data for specified range informed by callback function common::file::AsyncReaderCallback::AddDownloadHint and then call this function again.
|
inline |
Import form fields and annotations from a FDF/XFDF document.
fdf_doc | A valid FDF/XFDF document object, from which form fields and annotations will be imported. |
types | Used to decide which kind of data will be imported. Please refer to values e_XXX and this can be one or a combination of these values. |
page_range | A Range object that specifies some pages. Data (in specified types) from FDF/XFDF document will be imported to these specified pages. range for importing. If this Range object is constructed by default constructor and not set any value, that means data (in specified types) from FDF/XFDF document will be imported to related PDF pages whose index have been defined in FDF/XFDF document. |
|
inline |
Insert a new blank PDF page to document, by index.
index | The page index for new page. If parameter index is less than 0, the new page will be inserted to the first. If parameter index is equal to or larger than current page count, the new page will be inserted to the end. |
width | Width of new page (unit is 1/72 inch). |
height | Height of new page (unit is 1/72 inch). |
|
inline |
Insert a new blank PDF page to document, by index.
index | The page index for new page. If parameter index is less than 0, the new page will be inserted to the first. If parameter index is equal to or larger than current page count, the new page will be inserted to the end. |
size | Size type of new page. Please refer to e_SizeXXX values and this should be one of its values. Default value: e_SizeLetter. |
|
inline |
Insert a reading bookmark to current PDF document.
reading_bookmark_index | A reading bookmark index. If reading_bookmark_index is less than 0, the new reading bookmark will be inserted to the first. If reading_bookmark_index is equal to or larger than the count of reading bookmarks, the new reading bookmark will be inserted to the end. |
title | Title string for new reading bookmark and should not an empty string. |
dest_page_index | The index of destination page. |
|
inline |
Check whether the loaded document is a ConnectedPDF DRM document or not.
|
inline |
Check whether the loaded document is a ConnectedPDF document or not.
|
inline |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
|
inline |
Check whether current document is an encrypted file or not.
|
inline |
Check if current PDF document is a linearized file.
If current document object is constructed with a AsyncReaderCallback object, this function can be used before or after the document is loaded successfully. Specially, if this function is called before document is loaded successfully, application should ensure the first 1024 bytes of the PDF file is available; otherwise, this function will call the callback function common::file::AsyncReaderCallback::AddDownloadHint to notify application the range of data which should be downloaded by application then, and then this function will throw exception e_ErrDataNotReady.
If current document object is constructed from other methods or with a common ReaderCallback object, this function can only be used after the document is loaded successfully; otherwise, exception e_ErrUnknownState will be thrown.
|
inline |
Check whether current PDF document is a portfolio file or not.
|
inline |
Check if current PDF document is a Tagged PDF file.
|
inline |
Check whether current document is a wrapper file or not.
|
inline |
Check whether current PDF document is an XFA document.
Currently, Foxit PDF SDK does not fully support XFA document. When loading an XFA document, Foxit PDF SDK may only load the XFA wrapper level, and cannot have access to the real XFA content. Foxit PDF SDK does not support to insert/import/remove/move pages in an XFA document yet.
|
inline |
Load current document content by using a specified password.
If current PDF document object is constructed with a AsyncReaderCallback which means to do asynchronous loading, this function may return e_ErrDataNotReady. In this case, user should prepare data for specified range informed by callback function common::file::AsyncReaderCallback::AddDownloadHint and then call this function again.
password | The password string, used to load current document content. The password can be either user password or owner password. If current document is not encrypted by password, just pass an empty string. |
|
inline |
Load current document content by using a specified password.
If current PDF document object is constructed with a AsyncReaderCallback which means to do asynchronous loading, this function may return e_ErrDataNotReady. In this case, user should prepare data for specified range informed by callback function common::file::AsyncReaderCallback::AddDownloadHint and then call this function again.
password | The password string, used to load current document content. The password can be either user password or owner password. If current document is not encrypted by password, just pass an empty string. |
|
inline |
Move one or more pages (specified by index) to a new index position.
If move only one page, this function just has the same feature as function pdf::PDFDoc::MovePageTo.
If move more than one page, these page will keep the order defined in parameter page_range and be moved to the destination index position as a whole.
After this function is successful, indexes of moved pages will be changed and indexes of the rest pages may be affected as well.
page_range | A Range object which should at least contain one valid range. All the related pages will keep the order (specified by this range) and be moved as a whole. If there exist duplicated indexes in the range, only the last occurrence will be useful. |
dest_index | Index of the destination position, based on current page array. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetPageCount. |
|
inline |
Move a specified page to a new index position.
If the specified page is successfully moved to the new index position, page index of all the pages between the new index and old index of the specified page will be changed as well.
page | A PDF page to be moved. It should be in current PDF document. |
dest_index | Index of the destination position in page array. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetPageCount. If parameter dest_index is just the same as the page index of parameter page, no change will be done and this function will return true directly. |
|
inline |
Remove a specified bookmark.
bookmark | The valid bookmark that would be deleted. |
|
inline |
Remove the action to be performed when the document is opened.
|
inline |
Remove a PDF page by page index.
index | The page index. Valid range: from 0 to (count-1). count is returned by function pdf::PDFDoc::GetPageCount. |
|
inline |
Remove a specified PDF page.
Once the specified PDF page is removed successfully, the page object cannot be used any more.
page | A PDFPage object that represents the PDF page to be removed. The page should be in current PDF document. |
|
inline |
Remove a reading bookmark from current PDF document.
reading_bookmark | A valid reading bookmark to be removed. |
|
inline |
Remove the security handler from current document, so that the later saved document will be unencrypted.
|
inline |
Remove a signature.
signature | A valid signature to be removed. |
|
inline |
Save current PDF document as another PDF file.
If current document is loaded from an existing PDF file and a different file version has been set by function pdf::PDFDoc::SetFileVersion before saving, Foxit PDF SDK will ignore e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
file_path | A full path for the new saved PDF file. It should not be an empty string. |
save_flags | Document saving flags. Please refer to e_SaveFlagXXX values and this can be one or combination of these values. |
|
inline |
Save current PDF document as a wrapper file.
PDF wrapper is an extended standard, and it helps to hint some information to viewers.
PDF wrapper consists of
wrapper type: it is an identity string,
wrapper offset: it tells the end of original data,
wrapper template: it is the content of wrapper document.
This function uses the current size of file which is specified by file_path to set wrapper offset.
file_path | A full path of a PDF file. Current PDF document will be saved into this PDF file as a wrapper file. |
wrapper_data | Wrapper data. If this is null, no wrapper data is used. |
user_permissions | User permissions for the wrapper document. Pass 0xFFFFFFFC if no special permissions is needed. Please refer to e_PermXXX values and this should be one or combination of its values. |
owner_password | Owner password. If this is an empty string, parameter user_permissions will be ignored. |
|
inline |
Set the display mode.
Display mode specifies how the document should be displayed when opened.
display_mode | Display mode value. Please refer to e_DisplayXXX values and this should be one of these values. |
|
inline |
Set the PDF file version which will be stored in PDF header section of the saved PDF file.
The new file version will not affect on current document directly, but will be used in the saved PDF file in function pdf::PDFDoc::SaveAs or pdf::PDFDoc::StartSaveAs. This function does not check whether the PDF content matches the specified version.
version | An integer specify the file version, such as 14 for 1.4, 15 for 1.5, and etc. Its value should be from 10 to 17 or 20 and be equal or greater than current version. |
|
inline |
Set the action to be performed when the document is opened.
action | A valid action to be set. Currently only support following types as the new action: e_TypeGoto, e_TypeURI, e_TypeJavaScript, e_TypeNamed, e_TypeSubmitForm, e_TypeResetForm, e_TypeHide, e_TypeImportData. |
|
inline |
Set a PDF security handler for encryption, such as standard encryption(password), certificate encryption, and so on.
handler | A PDF SecurityHandler object. |
|
inline |
Start to import pages from another PDF document (via PDF document object).
It may take a long time to importing pages, so Foxit PDF SDK uses a progressive process to do this.
Signed signatures in the pages of source PDF document will not be imported into current PDF document.
Currently, if either current PDF document or the source PDF document contains XFA, not support to do the importing.
dest_index | A page index in current PDF document. This is used to specify where the imported pages will be inserted: If parameter dest_index is less than 0, the imported pages will be inserted to the first. If parameter dest_index is equal to or larger than current page count, the imported pages will be inserted to the end. |
src_doc | A PDF document object which is the source PDF document. Pages in this document will be imported to current PDF document. Please keep this source PDF document object valid until current document will not be saved any more or is closed. |
flags | Options for importing pages. Please refer to macro definitions e_ImportFlagXXX and this can be one or a combination of these macros. |
layer_name | The name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application. If parameter flags contains e_ImportFlagWithLayers, this should not be empty and should be a valid string. If parameter flags does not contain e_ImportFlagWithLayers, this string will be ignored. If all the pages of source PDF document is to be imported to current document, all layers from source document will be grouped under a non-selectable label, and this string will be directly used as the label. If only part of pages of source PDF document is to be imported to current document, layers in the same page will be grouped under a single non-selectable label, and this string will be used as the prefix name of the label. The label will be like "layerName_Page_X". |
page_range | A Range object to specify which pages is to be inserted. If this Range object is constructed by default constructor and not set any value, all pages in the source document will be imported. |
pause | Pause object which decides if the importing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |
|
inline |
Start to import pages from another PDF document (via file path).
It may take a long time to importing pages, so Foxit PDF SDK uses a progressive process to do this.
Signed signatures in the pages of source PDF document will not be imported into current PDF document.
Currently, Foxit PDF SDK does not support to do the importing if either current PDF document or the source PDF document contains XFA.
dest_index | A page index in current PDF document. This is used to specify where the imported pages will be inserted. If parameter dest_index is less than 0, the imported pages will be inserted to the first. If parameter dest_index is equal to or larger than current page count, the imported pages will be inserted to the end. |
src_file_path | A full path of an existing PDF file as the source PDF document Some pages will be imported from this PDF file to current PDF document. |
password | A password string used to load source PDF document content. The password can be either user password or owner password. If source PDF document is not encrypted by password, just pass an empty string. |
flags | Options for importing pages. Please refer to macro definitions e_ImportFlagXXX and this can be one or a combination of these values. |
layer_name | The name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application. If parameter flags contains e_ImportFlagWithLayers, this should not be empty and should be a valid string. If parameter flags does not contain e_ImportFlagWithLayers, this string will be ignored. If all the pages of source PDF document is to be imported to current document, all layers from source document will be grouped under a non-selectable label, and this string will be directly used as the label. If only part of pages of source PDF document is to be imported to current document, layers in the same page will be grouped under a single non-selectable label, and this string will be used as the prefix name of the label. The label will be like "layerName_Page_X". |
page_range | A range object to specify which pages is to be imported. If this Range object is constructed by default constructor and not set any value, all pages in the source document will be imported. |
pause | Pause object which decides if the importing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |
|
inline |
Start to loading current document content by using a specified password.
It may take a long time to loading document content, so this function uses a progressive process to do this.
When using this function, parameter is_cache_stream can be used to decide whether to load stream content into memory or not:
Loading stream content into memory will improve performance for frequent access, however, it will also consume a lot of memory space.
Not to load stream content into memory, that means to leave stream content on file system, and read them when needed. This may reduce the performance a little bit, but greatly reduce the memory consumption, especially when the file is big.
password | A password string, used to load current document content. The password can be either user password or owner password. If current document is not encrypted by password, just pass an empty string. |
is_cache_stream | true means to load stream content into memory, and false means not to load stream content into memory and just leave stream content on file system and read them when needed. Please refer to "Details" part about the difference between these two modes. |
pause | Pause object which decides if the importing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |
|
inline |
Start to loading current document content by using a specified password.
It may take a long time to loading document content, so this function uses a progressive process to do this.
When using this function, parameter is_cache_stream can be used to decide whether to load stream content into memory or not:
Loading stream content into memory will improve performance for frequent access, however, it will also consume a lot of memory space.
Not to load stream content into memory, that means to leave stream content on file system, and read them when needed. This may reduce the performance a little bit, but greatly reduce the memory consumption, especially when the file is big.
password | A password string, used to load current document content. The password can be either user password or owner password. If current document is not encrypted by password, just pass an empty string. |
is_cache_stream | true means to load stream content into memory, and false means not to load stream content into memory and just leave stream content on file system and read them when needed. Please refer to "Details" part about the difference between these two modes. |
pause | Pause object which decides if the importing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |
|
inline |
Start to save current PDF document as another PDF file.
It may take a long time to saving PDF document, so this function uses a progressive process to do this.
If current document is loaded from an existing PDF file and a different file version has been set by function pdf::PDFDoc::SetFileVersion before saving, Foxit PDF SDK will ignore e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
file_path | A full path for the new saved PDF file. It should not be an empty string. |
save_flags | Document saving flags. Please refer to e_SaveFlagXXX values and this can be one or combination of these values. |
pause | Pause callback object which decides if the parsing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |
|
inline |
Start to save current PDF document as another PDF file.
It may take a long time to saving PDF document, so this function uses a progressive process to do this.
If current document is loaded from an existing PDF file and a different file version has been set by function pdf::PDFDoc::SetFileVersion before saving, Foxit PDF SDK will ignore e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
file | A WriterCallback object which is implemented by user to save a PDF document. |
save_flags | Document saving flags. Please refer to e_SaveFlagXXX values and this can be one or combination of these values. |
pause | Pause callback object which decides if the parsing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |
|
inline |
Start to save current PDF document as a wrapper document with a payload document (defined in PDF 2.0).
It may take a long time to saving PDF document, so this function uses a progressive process to do this.
If current document is loaded from an existing PDF file and a different file version has been set by function pdf::PDFDoc::SetFileVersion before saving, Foxit PDF SDK will ignore e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
file_path | A full path for the new saved PDF file. It should not be an empty string. |
payload_file_path | A full path of a PDF document which will be used as payload document. It should not be an empty string. |
sub_type | The name of the cryptographic filter used to encrypt the encrypted payload document. |
description | Description for wrapper file to show applications or confront users prompt information. |
version | The version number of the cryptographic filter used to encrypt the encrypted payload referenced by this dictionary. |
save_flags | Document saving flags. Please refer to e_SaveFlagXXX values and this can be one or combination of these values. |
pause | Pause callback object which decides if the parsing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user. |