Foxit PDF SDK
|
Public Member Functions | |
def | PDFDoc () |
Constructor. More... | |
def | PDFDoc (buffer, size) |
Constructor, from a memory buffer. More... | |
def | PDFDoc (file_read, is_async) |
Constructor, with a file read callback object. More... | |
def | PDFDoc (other) |
Constructor, with another PDF document object. More... | |
def | PDFDoc (path) |
Constructor, from an existing PDF file path. More... | |
def | AddHeaderFooter (headerfooter) |
Add new header-footer. More... | |
def | AddIndirectObject (pdf_object) |
Add a PDF object to current PDF document, to be an indirect object. More... | |
def | AddPageFromTemplate (template_name) |
Adds a new PDF page to document, from a named template. More... | |
def | AddPagingSealSignature (page_range, width, height) |
Add a paging seal signature to document by page range. More... | |
def | AddTableOfContents (table_of_contents_config) |
Insert page(s) as the table of contents to the front of current PDF document. More... | |
def | CheckPassword (password) |
Check the type of a specified unicode password. More... | |
def | ClearRenderCache () |
Clear the cache used during rendering, to reduce the memory usage. More... | |
def | CreateDSS () |
Create DSS information in current PDF document. More... | |
def | CreateRootBookmark () |
Create new bookmark root node. More... | |
def | DeleteIndirectObject (object_number) |
Delete an indirect object by indirect object number. More... | |
def | DoJSOpenAction () |
Perform JavaScript actions when the document is opened. More... | |
def | ExportAnnotToFDF (pdf_annot, fdf_doc) |
Export specified annotation to a FDF/XFDF document. More... | |
def | ExportFormFieldsToFDF (field_array, is_include, fdf_doc) |
Export specified form fields to a FDF/XFDF document. More... | |
def | ExportToFDF (fdf_doc, types, page_range) |
Export form fields and annotations to a FDF/XFDF document. More... | |
def | GetBookmarkLevelDepth () |
Get bookmark level depth. More... | |
def | GetCatalog () |
Get the catalog dictionary. More... | |
def | GetCertificateEncryptData () |
Get encrypt data of certificate encryption. More... | |
def | GetCustomEncryptData () |
Get encrypt data of custom encryption. More... | |
def | GetDisplayMode () |
Get the display mode. More... | |
def | GetDRMEncryptData () |
Get encrypt data of Foxit DRM encryption. More... | |
def | GetEditableHeaderFooter () |
Get the editable header footer object. More... | |
def | GetEmbeddedFontData () |
Get embedded font data. More... | |
def | GetEncryptDict () |
Get the encrypt dictionary. More... | |
def | GetEncryptionType () |
Get the encryption type. More... | |
def | GetFileSize () |
Get file size. More... | |
def | GetFileVersion () |
Get PDF file version stored in PDF header section. More... | |
def | GetFirstAvailPageIndex () |
Get the page index of the fist available page. More... | |
def | GetFont (index) |
Get a font by index. More... | |
def | GetFontCount () |
Count all the PDF fonts used in current PDF document. More... | |
def | GetHeader () |
Get PDF header identifying the version of the PDF specification to which the file conforms. More... | |
def | GetIndirectObject (object_number) |
Get an indirect object by indirect object number. More... | |
def | GetInfo () |
Get the information dictionary. More... | |
def | GetOpenAction () |
Get the action to be performed when the document is opened. More... | |
def | GetPage (index) |
Get a PDF page by index. More... | |
def | GetPageBasicInfo (index) |
Get the basic information of a page specified by index. More... | |
def | GetPageCount () |
Get the count of pages. More... | |
def | GetPagesDict () |
Get the dictionary of "Pages". More... | |
def | GetPageText (page_index) |
Get the specified PDF page text which the text is in display order. More... | |
def | GetPasswordType () |
Get the type of current used password. More... | |
def | GetPayLoadData () |
Get payload data if current document's wrapper type is FoxitPDFSDKPython2.PDFDoc.e_WrapperPDFV2 . More... | |
def | GetReadingBookmark (index) |
Get a reading bookmark by index. More... | |
def | GetReadingBookmarkCount () |
Get the count of reading bookmarks. More... | |
def | GetRMSEncryptData () |
Get encrypt data of RMS encryption. More... | |
def | GetRootBookmark () |
Get bookmark root node. More... | |
def | GetSecurityHandler () |
Get current PDF security handler of current document. More... | |
def | GetSignature (index) |
Get a signature by index. More... | |
def | GetSignatureCount () |
Get the count of signature. More... | |
def | GetStdEncryptData () |
Get encrypt data of standard encryption (known as password encryption). More... | |
def | GetTrailer () |
Get the trailer dictionary. More... | |
def | GetUserPassword (owner_password) |
Get the user password based on owner password. More... | |
def | GetUserPermissions () |
Get user access permissions. More... | |
def | GetWrapperData () |
Get wrapper data if current document's wrapper type is FoxitPDFSDKPython2.PDFDoc.e_WrapperFoxit . More... | |
def | GetWrapperOffset () |
Get wrapper offset if current document's wrapper type is FoxitPDFSDKPython2.PDFDoc.e_WrapperFoxit . More... | |
def | GetWrapperType () |
Get Wrapper type. More... | |
def | HasForm () |
Check whether current PDF document has interactive form (also known as AcroForm). More... | |
def | HasHeaderFooter () |
Check whether current document has header-footer. More... | |
def | HasLayer () |
Check whether current PDF document has layer (known as "Optional content group" in <PDF reference 1.7>) or not. More... | |
def | HidePageTemplate (template_name) |
Hide a named page. More... | |
def | ImportFromFDF (fdf_doc, types, page_range) |
Import form fields and annotations from a FDF/XFDF document. More... | |
def | InsertDocument (dest_index, src_doc, options) |
Insert another PDF document to the specified location of current PDF document. More... | |
def | InsertPage (index, size) |
Insert a new blank PDF page to document, by index. More... | |
def | InsertPage (index, width, height) |
Insert a new blank PDF page to document, by index. More... | |
def | InsertReadingBookmark (reading_bookmark_index, title, dest_page_index) |
Insert a reading bookmark to current PDF document. More... | |
def | IsEmpty () |
Check whether current object is empty or not. More... | |
def | IsEncrypted () |
Check whether current document is an encrypted file or not. More... | |
def | IsLinearized () |
Check if current PDF document is a linearized file. More... | |
def | IsOwnerPassword (password) |
Check if input password is the owner password of current PDF document. More... | |
def | IsPortfolio () |
Check whether current PDF document is a portfolio file or not. More... | |
def | IsTaggedPDF () |
Check if current PDF document is a Tagged PDF file. More... | |
def | IsUserPassword (password) |
Check if input password is the user password of current PDF document. More... | |
def | IsWrapper () |
Check whether current document is a wrapper file or not. More... | |
def | IsXFA () |
Check whether current PDF document is an XFA document. More... | |
def | Load (password) |
Load current document content by using a specified password. More... | |
def | LoadW (password) |
Load current document content by using a specified password. More... | |
def | MovePagesTo (page_range, dest_index) |
Move one or more pages (specified by index) to a new index position. More... | |
def | MovePageTo (page, dest_index) |
Move a specified page to a new index position. More... | |
def | RemoveAllHeaderFooters () |
Remove all header-footers. More... | |
def | RemoveBookmark (bookmark) |
Remove a specified bookmark. More... | |
def | RemoveOpenAction () |
Remove the action to be performed when the document is opened. More... | |
def | RemovePage (page) |
Remove a specified PDF page. More... | |
def | RemoveReadingBookmark (reading_bookmark) |
Remove a reading bookmark from current PDF document. More... | |
def | RemoveSecurity () |
Remove the security handler from current document, so that the later saved document will be unencrypted. More... | |
def | RemoveSignature (signature) |
Remove a signature. More... | |
def | SaveAs (file_path, save_flags) |
Save current PDF document as another PDF file. More... | |
def | SaveAsWrapperFile (file_path, wrapper_data, user_permissions, owner_password) |
Save current PDF document as a wrapper file. More... | |
def | SetCacheFile (file_stream, is_own_file_stream) |
Set cache file (represented by a file stream) to current PDF document. More... | |
def | SetDisplayMode (display_mode) |
Set the display mode. More... | |
def | SetFileVersion (version) |
Set the PDF file version which will be stored in PDF header section of the saved PDF file. More... | |
def | SetOpenAction (action) |
Set the action to be performed when the document is opened. More... | |
def | SetSecurityHandler (handler) |
Set a PDF security handler for encryption, such as standard encryption(password), certificate encryption, and so on. More... | |
def | StartAddTiledWatermark (page, settings, page_range, pause) |
Add page type tiled watermark to PDF pages. More... | |
def | StartEmbedAllFonts (pause) |
Start to convert all un-embeded fonts to embeded fonts. More... | |
def | StartExtractPages (file, options, page_range, pause) |
Start to extract pages from current PDF document. More... | |
def | StartExtractPages (file_path, options, page_range, pause) |
Start to extract pages from current PDF document. More... | |
def | StartGetPayloadFile (payload_file, pause) |
Start to get payload file. More... | |
def | StartImportPages (dest_index, src_doc, flags, layer_name, page_range, pause) |
Start to import pages from another PDF document (via PDF document object). More... | |
def | StartImportPagesFromFilePath (dest_index, src_file_path, password, flags, layer_name, page_range, pause) |
Start to import pages from another PDF document (via file path). More... | |
def | StartLoad (password, is_cache_stream, pause) |
Start to loading current document content by using a specified password. More... | |
def | StartLoadW (password, is_cache_stream, pause) |
Start to loading current document content by using a specified password. More... | |
def | StartRecognizeForm (pause) |
Start to recognize form in current PDF document. More... | |
def | StartSaveAs (file, save_flags, pause) |
Start to save current PDF document as another PDF file. More... | |
def | StartSaveAs (file_path, save_flags, pause) |
Start to save current PDF document as another PDF file. More... | |
def | StartSaveAsPayloadFile (file_path, payload_file_path, crypto_filter, description, version, save_flags, pause) |
Start to save current PDF document as a wrapper document with a payload document (defined in PDF 2.0). More... | |
def | UpdateHeaderFooter (headerfooter) |
Update header-footer. More... | |
Static Public Attributes | |
e_Annots = _fsdk.PDFDoc_e_Annots | |
If set, annotations (except link annotations) are to imported from or exported to FDF/XFDF document. | |
e_DisplayFullScreen = _fsdk.PDFDoc_e_DisplayFullScreen | |
When document is opened, full-screen mode, with no menu bar, window controls, or any other windows are visible. | |
e_DisplayUseAttachment = _fsdk.PDFDoc_e_DisplayUseAttachment | |
When document is opened, attachment panels are visible. | |
e_DisplayUseNone = _fsdk.PDFDoc_e_DisplayUseNone | |
When document is opened, neither document outlines nor thumbnail images are visible. | |
e_DisplayUseOC = _fsdk.PDFDoc_e_DisplayUseOC | |
When document is opened, optional content group panels are visible. | |
e_DisplayUseOutlines = _fsdk.PDFDoc_e_DisplayUseOutlines | |
When document is opened, document outlines (bookmarks) are visible. | |
e_DisplayUseThumbs = _fsdk.PDFDoc_e_DisplayUseThumbs | |
When document is opened, thumbnail images are visible. | |
e_EncryptCDRM = _fsdk.PDFDoc_e_EncryptCDRM | |
(Reserved, currently, this value is not used.) Encryption type: Foxit connected PDF DRM encryption. | |
e_EncryptCertificate = _fsdk.PDFDoc_e_EncryptCertificate | |
Encryption type: digital certificate encryption. | |
e_EncryptCustom = _fsdk.PDFDoc_e_EncryptCustom | |
Encryption type: customized encryption. | |
e_EncryptFoxitDRM = _fsdk.PDFDoc_e_EncryptFoxitDRM | |
Encryption type: Foxit DRM encryption. | |
e_EncryptNone = _fsdk.PDFDoc_e_EncryptNone | |
No encryption pattern. | |
e_EncryptPassword = _fsdk.PDFDoc_e_EncryptPassword | |
Encryption type: password, which is the standard encryption. | |
e_EncryptRMS = _fsdk.PDFDoc_e_EncryptRMS | |
Encryption type: Microsoft RMS encryption. | |
e_EncryptUnknown = _fsdk.PDFDoc_e_EncryptUnknown | |
Unknown encryption type. | |
e_ExtractPagesOptionAnnotation = _fsdk.PDFDoc_e_ExtractPagesOptionAnnotation | |
If set, that means annotations related to extracted pages will be extracted as well. | |
e_ExtractPagesOptionAttachFiles = _fsdk.PDFDoc_e_ExtractPagesOptionAttachFiles | |
If set, that means attachment files will be extracted as well. | |
e_ExtractPagesOptionJavascript = _fsdk.PDFDoc_e_ExtractPagesOptionJavascript | |
If set, that means Javascript will be extracted as well. | |
e_ExtractPagesOptionObjectStream = _fsdk.PDFDoc_e_ExtractPagesOptionObjectStream | |
If set, that means to use FoxitPDFSDKPython2.PDFDoc.e_SaveFlagXRefStream saving flag for the result file in order to reduce the size of result file. | |
e_ExtractPagesOptionOCProperties = _fsdk.PDFDoc_e_ExtractPagesOptionOCProperties | |
If set, that means OCProperties will be extracted as well. | |
e_ExtractPagesOptionStructureTree = _fsdk.PDFDoc_e_ExtractPagesOptionStructureTree | |
If set, that means structure tree will be extracted as well. | |
e_ImportFlagNormal = _fsdk.PDFDoc_e_ImportFlagNormal | |
Import pages normally. | |
e_ImportFlagShareStream = _fsdk.PDFDoc_e_ImportFlagShareStream | |
Import pages without cloning stream objects into memory. More... | |
e_ImportFlagWithLayers = _fsdk.PDFDoc_e_ImportFlagWithLayers | |
Import pages with layers. | |
e_InsertDocOptionAttachments = _fsdk.PDFDoc_e_InsertDocOptionAttachments | |
If set, that means attachments will be inserted to target document as well. | |
e_Links = _fsdk.PDFDoc_e_Links | |
(Reserved, not supported yet) If set, only link annotations are to imported from or exported to XFDF document. | |
e_PermAnnotForm = _fsdk.PDFDoc_e_PermAnnotForm | |
Operate text annotations and fill in interactive form fields. (Bit 6 in permission value) More... | |
e_PermAssemble = _fsdk.PDFDoc_e_PermAssemble | |
Assemble PDF document. (Bit 11 in permission value) More... | |
e_PermExtract = _fsdk.PDFDoc_e_PermExtract | |
Extract PDF contents. (Bit 5 in permission value) More... | |
e_PermExtractAccess = _fsdk.PDFDoc_e_PermExtractAccess | |
Disabilities support. (Bit 10 in permission value) More... | |
e_PermFillForm = _fsdk.PDFDoc_e_PermFillForm | |
Fill PDF form. (Bit 9 in permission value) More... | |
e_PermModify = _fsdk.PDFDoc_e_PermModify | |
Modify PDF contents. (Bit 4 in permission value) More... | |
e_PermPrint = _fsdk.PDFDoc_e_PermPrint | |
Print PDF document with normal mode. (Bit 3 in permission value) More... | |
e_PermPrintHigh = _fsdk.PDFDoc_e_PermPrintHigh | |
Print PDF document with higher qualities. (Bit 12 in permission value) More... | |
e_PwdInvalid = _fsdk.PDFDoc_e_PwdInvalid | |
The password is invalid. | |
e_PwdNoPassword = _fsdk.PDFDoc_e_PwdNoPassword | |
No password is used in PDF document. | |
e_PwdOwner = _fsdk.PDFDoc_e_PwdOwner | |
An owner password is used in PDF document. | |
e_PwdUser = _fsdk.PDFDoc_e_PwdUser | |
A user password is used in PDF document. | |
e_SaveFlagIncremental = _fsdk.PDFDoc_e_SaveFlagIncremental | |
Save document incrementally. More... | |
e_SaveFlagLinearized = _fsdk.PDFDoc_e_SaveFlagLinearized | |
Save document as a linearized file. More... | |
e_SaveFlagNoOriginal = _fsdk.PDFDoc_e_SaveFlagNoOriginal | |
Save document without original data or unchanged objects. More... | |
e_SaveFlagNoUpdatingMetadataDateTime = _fsdk.PDFDoc_e_SaveFlagNoUpdatingMetadataDateTime | |
Save document without updating metadata "ModDate" and "CreationDate". More... | |
e_SaveFlagRemoveRedundantObjects = _fsdk.PDFDoc_e_SaveFlagRemoveRedundantObjects | |
Save document with removing redundant PDF objects. More... | |
e_SaveFlagXRefStream = _fsdk.PDFDoc_e_SaveFlagXRefStream | |
Save document by using XRef stream. More... | |
e_WrapperFoxit = _fsdk.PDFDoc_e_WrapperFoxit | |
Foxit wrapper document. | |
e_WrapperPDFV2 = _fsdk.PDFDoc_e_WrapperPDFV2 | |
PDF 2.0 wrapper document. | |
A PDF document object can be constructed with an existing PDF file from file path, memory buffer, a custom implemented FoxitPDFSDKPython2.FileReaderCallback object and an input file stream. And then call function FoxitPDFSDKPython2.PDFDoc.Load or FoxitPDFSDKPython2.PDFDoc.StartLoad to load document content. This class offers functions to retrieve different part of a PDF document. For example:
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:
def FoxitPDFSDKPython2.PDFDoc.PDFDoc | ( | ) |
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.
def FoxitPDFSDKPython2.PDFDoc.PDFDoc | ( | path | ) |
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 PDFDoc .
[in] | path | A full path of an existing PDF file. It should not be an empty string. |
def FoxitPDFSDKPython2.PDFDoc.PDFDoc | ( | buffer, | |
size | |||
) |
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 PDFDoc .
[in] | 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. |
[in] | size | The size of memory buffer. It should be above 0. |
def FoxitPDFSDKPython2.PDFDoc.PDFDoc | ( | file_read, | |
is_async | |||
) |
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 PDFDoc .
[in] | file_read | A FoxitPDFSDKPython2.FileReaderCallback object which is implemented by user to load a PDF document. It should not be null. If the input callback object is an FoxitPDFSDKPython2.AsyncReaderCallback object, 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. |
[in] | is_async | Whether the input FoxitPDFSDKPython2.FileReaderCallback object is for asynchronously loading or not. |
def FoxitPDFSDKPython2.PDFDoc.PDFDoc | ( | other | ) |
Constructor, with another PDF document object.
[in] | other | Another PDF document object. |
def FoxitPDFSDKPython2.PDFDoc.AddHeaderFooter | ( | headerfooter | ) |
Add new header-footer.
A PDF document can be added header-footer sereral times. When a new header-footer is added, the old ones will not be removed but be covered by the new one if the old ones appear in the same place as new one.
[in] | headerfooter | A valid header-footer object to be added to current document. |
def FoxitPDFSDKPython2.PDFDoc.AddIndirectObject | ( | pdf_object | ) |
Add a PDF object to current PDF document, to be an indirect object.
[in] | pdf_object | A FoxitPDFSDKPython2.PDFObject object. It should not be null. |
def FoxitPDFSDKPython2.PDFDoc.AddPageFromTemplate | ( | template_name | ) |
Adds a new PDF page to document, from a named template.
There may exist hidden pages in a PDF document. Hidden pages are mapped to the names defined in the template name tree in the PDF document. This function can be used to add a hidden page to the end of the PDF document.
Class FoxitPDFSDKPython2.PDFNameTree (initialized with type FoxitPDFSDKPython2.PDFNameTree.e_Templates ) can be used to determine which template names are available.
After a template has been added, the name will be moved to the document's pages name tree internally.
[in] | template_name | The name of a template, whose mapping hidden page will be added to the end of current PDF document. If the template name cannot be found, exception FoxitPDFSDKPython2.e_ErrParam will be thrown. |
def FoxitPDFSDKPython2.PDFDoc.AddPagingSealSignature | ( | page_range, | |
width, | |||
height | |||
) |
Add a paging seal signature to document by page range.
This function will add a signature to the first page of page_range.
[in] | page_range | A range object that specifies some pages. These pages will be added a signature. The valid page range: from 1 to count. count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . If this range object is constructed by default constructor and not set any value, that means all the pages of current document will be added a signature. This function does not support a range with a single index or a document with a single page. |
[in] | width | The width of paging seal. The value will be used for setting rectangle of the signature on each page. |
[in] | height | The height of paging seal. The value will be used for setting rectangle of the signature on each page. |
def FoxitPDFSDKPython2.PDFDoc.AddTableOfContents | ( | table_of_contents_config | ) |
Insert page(s) as the table of contents to the front of current PDF document.
If the current document does not have any bookmark, this function will do nothing.
[in] | table_of_contents_config | A table of contents configuration object which is used for the table of contents. |
def FoxitPDFSDKPython2.PDFDoc.CheckPassword | ( | password | ) |
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.
For some PDF document, it have user password and owner password at the same time and these two passwords are same. But current function can only return one type for such password. In this case, functions FoxitPDFSDKPython2.PDFDoc.IsUserPassword and FoxitPDFSDKPython2.PDFDoc.IsOwnerPassword can help to do more check.
[in] | password | A unicode password string to be detected. |
def FoxitPDFSDKPython2.PDFDoc.ClearRenderCache | ( | ) |
Clear the cache used during rendering, to reduce the memory usage.
def FoxitPDFSDKPython2.PDFDoc.CreateDSS | ( | ) |
Create DSS information in current PDF document.
If current PDF document already has DSS information, this function will do nothing and return directly.
def FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark | ( | ) |
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.
def FoxitPDFSDKPython2.PDFDoc.DeleteIndirectObject | ( | object_number | ) |
Delete an indirect object by indirect object number.
[in] | object_number | The indirect object number. It should be above 0. |
def FoxitPDFSDKPython2.PDFDoc.DoJSOpenAction | ( | ) |
Perform JavaScript actions when the document is opened.
def FoxitPDFSDKPython2.PDFDoc.ExportAnnotToFDF | ( | pdf_annot, | |
fdf_doc | |||
) |
Export specified annotation to a FDF/XFDF document.
[in] | pdf_annot | A valid PDF annotation object to be exported to the FDF/XFDF document. |
[in] | fdf_doc | A valid FDF/XFDF document object, to which the specified annotation will be exported. |
def FoxitPDFSDKPython2.PDFDoc.ExportFormFieldsToFDF | ( | field_array, | |
is_include, | |||
fdf_doc | |||
) |
Export specified form fields to a FDF/XFDF document.
[in] | field_array | An array of form fields. Parameter is_include will decide whether data of these form fields are to exported or not. |
[in] | is_include | A boolean value used to decide whether data of specified form fields are to be exported or not: true means data of specified form fields are to be exported, while false means data of specified form fields are not to be exported. |
[in] | fdf_doc | A valid FDF/XFDF document object, to which the specified form fields will be exported. |
def FoxitPDFSDKPython2.PDFDoc.ExportToFDF | ( | fdf_doc, | |
types, | |||
page_range | |||
) |
Export form fields and annotations to a FDF/XFDF document.
For more details about the type of PDF object available for exporting, please refer to Page 22 of "XML Forms Data
Format Specification".
[in] | fdf_doc | A valid FDF/XFDF document object, to which form fields and annotations will be exported. |
[in] | types | Used to decide which kind of data will be exported. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_Forms and this can be one or a combination of these values. |
[in] | 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. This parameter is only useful when parameter types contains FoxitPDFSDKPython2.PDFDoc.e_Annots . |
def FoxitPDFSDKPython2.PDFDoc.GetBookmarkLevelDepth | ( | ) |
Get bookmark level depth.
def FoxitPDFSDKPython2.PDFDoc.GetCatalog | ( | ) |
Get the catalog dictionary.
def FoxitPDFSDKPython2.PDFDoc.GetCertificateEncryptData | ( | ) |
Get encrypt data of certificate encryption.
This function is useful when current document is encrypted by certificate.
def FoxitPDFSDKPython2.PDFDoc.GetCustomEncryptData | ( | ) |
Get encrypt data of custom encryption.
This function is useful when current document is encrypted by custom.
def FoxitPDFSDKPython2.PDFDoc.GetDisplayMode | ( | ) |
Get the display mode.
Display mode specifies how the document should be displayed when opened.
def FoxitPDFSDKPython2.PDFDoc.GetDRMEncryptData | ( | ) |
Get encrypt data of Foxit DRM encryption.
This function is useful when current document is encrypted by Foxit DRM.
def FoxitPDFSDKPython2.PDFDoc.GetEditableHeaderFooter | ( | ) |
Get the editable header footer object.
A PDF document may have been added header-footer sereral times, but only one of these header-footer can be editable. This function is to retreive the editable header-footer.
def FoxitPDFSDKPython2.PDFDoc.GetEmbeddedFontData | ( | ) |
Get embedded font data.
def FoxitPDFSDKPython2.PDFDoc.GetEncryptDict | ( | ) |
Get the encrypt dictionary.
def FoxitPDFSDKPython2.PDFDoc.GetEncryptionType | ( | ) |
Get the encryption type.
def FoxitPDFSDKPython2.PDFDoc.GetFileSize | ( | ) |
Get file size.
def FoxitPDFSDKPython2.PDFDoc.GetFileVersion | ( | ) |
Get PDF file version stored in PDF header section.
def FoxitPDFSDKPython2.PDFDoc.GetFirstAvailPageIndex | ( | ) |
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.
def FoxitPDFSDKPython2.PDFDoc.GetFont | ( | index | ) |
Get a font by index.
[in] | index | The index of PDF font. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetFontCount . |
def FoxitPDFSDKPython2.PDFDoc.GetFontCount | ( | ) |
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.
def FoxitPDFSDKPython2.PDFDoc.GetHeader | ( | ) |
Get PDF header identifying the version of the PDF specification to which the file conforms.
def FoxitPDFSDKPython2.PDFDoc.GetIndirectObject | ( | object_number | ) |
Get an indirect object by indirect object number.
[in] | object_number | The indirect object number. It should be above 0. |
def FoxitPDFSDKPython2.PDFDoc.GetInfo | ( | ) |
Get the information dictionary.
Document's information dictionary contains metadata for the document.
def FoxitPDFSDKPython2.PDFDoc.GetOpenAction | ( | ) |
Get the action to be performed when the document is opened.
def FoxitPDFSDKPython2.PDFDoc.GetPage | ( | index | ) |
Get a PDF page by index.
If current PDF document object is constructed with an AsyncReaderCallback which means to do asynchronous loading, this function may throw exception FoxitPDFSDKPython2.e_ErrDataNotReady . In this case, user should prepare data for specified range informed by callback function FoxitPDFSDKPython2.AsyncReaderCallback.AddDownloadHint and then call this function again.
[in] | index | The page index. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . |
def FoxitPDFSDKPython2.PDFDoc.GetPageBasicInfo | ( | index | ) |
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 an AsyncReaderCallback which means to do asynchronous loading, this function may throw exception FoxitPDFSDKPython2.e_ErrDataNotReady . In this case, user should prepare data for specified range informed by callback function FoxitPDFSDKPython2.AsyncReaderCallback.AddDownloadHint and then call this function again.
[in] | index | The page index. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . |
def FoxitPDFSDKPython2.PDFDoc.GetPageCount | ( | ) |
Get the count of pages.
def FoxitPDFSDKPython2.PDFDoc.GetPagesDict | ( | ) |
Get the dictionary of "Pages".
def FoxitPDFSDKPython2.PDFDoc.GetPageText | ( | page_index | ) |
Get the specified PDF page text which the text is in display order.
[in] | page_index | The page index. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . |
def FoxitPDFSDKPython2.PDFDoc.GetPasswordType | ( | ) |
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 FoxitPDFSDKPython2.PDFDoc.e_PwdNoPassword .
If current document is constructed from an existing file but has not been loaded yet, this function will return FoxitPDFSDKPython2.PDFDoc.e_PwdInvalid .
def FoxitPDFSDKPython2.PDFDoc.GetPayLoadData | ( | ) |
Get payload data if current document's wrapper type is FoxitPDFSDKPython2.PDFDoc.e_WrapperPDFV2 .
def FoxitPDFSDKPython2.PDFDoc.GetReadingBookmark | ( | index | ) |
Get a reading bookmark by index.
[in] | index | The index of reading bookmarks. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetReadingBookmarkCount . |
def FoxitPDFSDKPython2.PDFDoc.GetReadingBookmarkCount | ( | ) |
Get the count of reading bookmarks.
def FoxitPDFSDKPython2.PDFDoc.GetRMSEncryptData | ( | ) |
Get encrypt data of RMS encryption.
This function is useful when current document is encrypted by RMS.
def FoxitPDFSDKPython2.PDFDoc.GetRootBookmark | ( | ) |
Get bookmark root node.
def FoxitPDFSDKPython2.PDFDoc.GetSecurityHandler | ( | ) |
Get current PDF security handler of current document.
def FoxitPDFSDKPython2.PDFDoc.GetSignature | ( | index | ) |
Get a signature by index.
[in] | index | The index of signature. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetSignatureCount . |
def FoxitPDFSDKPython2.PDFDoc.GetSignatureCount | ( | ) |
Get the count of signature.
def FoxitPDFSDKPython2.PDFDoc.GetStdEncryptData | ( | ) |
Get encrypt data of standard encryption (known as password encryption).
This function is useful when current document is encrypted by password.
def FoxitPDFSDKPython2.PDFDoc.GetTrailer | ( | ) |
Get the trailer dictionary.
def FoxitPDFSDKPython2.PDFDoc.GetUserPassword | ( | owner_password | ) |
Get the user password based on owner password.
This function is useful when current document is encrypted by password.
[in] | owner_password | Owner password string. |
def FoxitPDFSDKPython2.PDFDoc.GetUserPermissions | ( | ) |
Get user access permissions.
def FoxitPDFSDKPython2.PDFDoc.GetWrapperData | ( | ) |
Get wrapper data if current document's wrapper type is FoxitPDFSDKPython2.PDFDoc.e_WrapperFoxit .
def FoxitPDFSDKPython2.PDFDoc.GetWrapperOffset | ( | ) |
Get wrapper offset if current document's wrapper type is FoxitPDFSDKPython2.PDFDoc.e_WrapperFoxit .
def FoxitPDFSDKPython2.PDFDoc.GetWrapperType | ( | ) |
Get Wrapper type.
def FoxitPDFSDKPython2.PDFDoc.HasForm | ( | ) |
Check whether current PDF document has interactive form (also known as AcroForm).
If current PDF document object is constructed with an AsyncReaderCallback which means to do asynchronous loading, this function may throw exception FoxitPDFSDKPython2.e_ErrDataNotReady . In this case, user should prepare data for specified range informed by callback function FoxitPDFSDKPython2.AsyncReaderCallback.AddDownloadHint and then call this function again.
def FoxitPDFSDKPython2.PDFDoc.HasHeaderFooter | ( | ) |
Check whether current document has header-footer.
def FoxitPDFSDKPython2.PDFDoc.HasLayer | ( | ) |
Check whether current PDF document has layer (known as "Optional content group" in <PDF reference 1.7>) or not.
def FoxitPDFSDKPython2.PDFDoc.HidePageTemplate | ( | template_name | ) |
Hide a named page.
Pages in a PDF document can be mapped to names defined in the pages name tree in the PDF document. This function can be used to hide these named pages.
Class FoxitPDFSDKPython2.PDFNameTree (initialized with type FoxitPDFSDKPython2.PDFNameTree.e_Pages ) can be used to determine which page names are available and to map pages to names.
After a PDF page has been hidden, the name will be moved to the document's templates name tree internally.
[in] | template_name | The name of a PDF page to be hidden. |
def FoxitPDFSDKPython2.PDFDoc.ImportFromFDF | ( | fdf_doc, | |
types, | |||
page_range | |||
) |
Import form fields and annotations from a FDF/XFDF document.
It also supports to import form fields in FDF template. The page associated with the FDF template will be inserted into the end of document. For more details about the type of PDF object available for exporting, please refer to Page 22 of "XML Forms Data Format Specification".
[in] | fdf_doc | A valid FDF/XFDF document object, from which form fields and annotations will be imported. |
[in] | types | Used to decide which kind of data will be imported. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_Forms and this can be one or a combination of these values. It does not work if fdf_doc is the fdf template. |
[in] | page_range | A range object that specifies some pages. Data (in specified types) from FDF/XFDF document will be imported to these specified pages. 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. This parameter is only useful when parameter types contains FoxitPDFSDKPython2.PDFDoc.e_Annots . It does not work if fdf_doc is the fdf template. |
def FoxitPDFSDKPython2.PDFDoc.InsertDocument | ( | dest_index, | |
src_doc, | |||
options | |||
) |
Insert another PDF document to the specified location of current PDF document.
[in] | dest_index | A page index in current PDF document. This is used to specify where to insert the pages from src_doc: If parameter dest_index is less than 0, these pages will be inserted to the first. If parameter dest_index is equal to or larger than current page count, these pages will be inserted to the end. |
[in] | src_doc | A PDF document object which represents the PDF document to be inserted to current PDF document. All the pages in this document will be inserted to current PDF document. Please keep this source PDF document object valid until current document will not be saved any more or is closed. |
[in] | options | Options for inserting a PDF document. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_InsertDocOptionAttachments and this can be one or a combination of these values. 0 means no option is used. |
def FoxitPDFSDKPython2.PDFDoc.InsertPage | ( | index, | |
size | |||
) |
Insert a new blank PDF page to document, by index.
[in] | 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. |
[in] | size | Size type of new page. Please refer to values starting from FoxitPDFSDKPython2.PDFPage.e_SizeLetter and this should be one of these values. |
def FoxitPDFSDKPython2.PDFDoc.InsertPage | ( | index, | |
width, | |||
height | |||
) |
Insert a new blank PDF page to document, by index.
[in] | 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. |
[in] | width | Width of new page (unit is 1/72 inch). |
[in] | height | Height of new page (unit is 1/72 inch). |
def FoxitPDFSDKPython2.PDFDoc.InsertReadingBookmark | ( | reading_bookmark_index, | |
title, | |||
dest_page_index | |||
) |
Insert a reading bookmark to current PDF document.
[in] | 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. |
[in] | title | Title string for new reading bookmark and should not an empty string. |
[in] | dest_page_index | The index of destination page. |
def FoxitPDFSDKPython2.PDFDoc.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
def FoxitPDFSDKPython2.PDFDoc.IsEncrypted | ( | ) |
Check whether current document is an encrypted file or not.
def FoxitPDFSDKPython2.PDFDoc.IsLinearized | ( | ) |
Check if current PDF document is a linearized file.
def FoxitPDFSDKPython2.PDFDoc.IsOwnerPassword | ( | password | ) |
Check if input password is the owner password of current PDF document.
[in] | password | A password string to be detected. |
def FoxitPDFSDKPython2.PDFDoc.IsPortfolio | ( | ) |
Check whether current PDF document is a portfolio file or not.
def FoxitPDFSDKPython2.PDFDoc.IsTaggedPDF | ( | ) |
Check if current PDF document is a Tagged PDF file.
def FoxitPDFSDKPython2.PDFDoc.IsUserPassword | ( | password | ) |
Check if input password is the user password of current PDF document.
[in] | password | A password string to be detected. |
def FoxitPDFSDKPython2.PDFDoc.IsWrapper | ( | ) |
Check whether current document is a wrapper file or not.
def FoxitPDFSDKPython2.PDFDoc.IsXFA | ( | ) |
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.
def FoxitPDFSDKPython2.PDFDoc.Load | ( | password | ) |
Load current document content by using a specified password.
If current PDF document object is constructed with an AsyncReaderCallback which means to do asynchronous loading, this function may return FoxitPDFSDKPython2.e_ErrDataNotReady . In this case, user should prepare data for specified range informed by callback function FoxitPDFSDKPython2.AsyncReaderCallback.AddDownloadHint and then call this function again.
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.LoadW | ( | password | ) |
Load current document content by using a specified password.
If current PDF document object is constructed with an AsyncReaderCallback which means to do asynchronous loading, this function may return FoxitPDFSDKPython2.e_ErrDataNotReady . In this case, user should prepare data for specified range informed by callback function FoxitPDFSDKPython2.AsyncReaderCallback.AddDownloadHint and then call this function again.
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.MovePagesTo | ( | page_range, | |
dest_index | |||
) |
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 FoxitPDFSDKPython2.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.
[in] | 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. |
[in] | dest_index | Index of the destination position, based on current page array. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . |
def FoxitPDFSDKPython2.PDFDoc.MovePageTo | ( | page, | |
dest_index | |||
) |
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.
[in] | page | A PDF page to be moved. It should be in current PDF document. |
[in] | dest_index | Index of the destination position in page array. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython2.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. |
def FoxitPDFSDKPython2.PDFDoc.RemoveAllHeaderFooters | ( | ) |
Remove all header-footers.
def FoxitPDFSDKPython2.PDFDoc.RemoveBookmark | ( | bookmark | ) |
Remove a specified bookmark.
[in] | bookmark | The valid bookmark that would be deleted. |
def FoxitPDFSDKPython2.PDFDoc.RemoveOpenAction | ( | ) |
Remove the action to be performed when the document is opened.
def FoxitPDFSDKPython2.PDFDoc.RemovePage | ( | page | ) |
Remove a specified PDF page.
Once the specified PDF page is removed successfully, the page object cannot be used any more.
[in] | page | A PDF page object that represents the PDF page to be removed. The page should be in current PDF document. |
def FoxitPDFSDKPython2.PDFDoc.RemoveReadingBookmark | ( | reading_bookmark | ) |
Remove a reading bookmark from current PDF document.
[in] | reading_bookmark | A valid reading bookmark to be removed. |
def FoxitPDFSDKPython2.PDFDoc.RemoveSecurity | ( | ) |
Remove the security handler from current document, so that the later saved document will be unencrypted.
def FoxitPDFSDKPython2.PDFDoc.RemoveSignature | ( | signature | ) |
Remove a signature.
[in] | signature | A valid signature to be removed. If this signature's type is FoxitPDFSDKPython2.Signature.e_SignatureTypePagingSeal , this function will remove all signatures related to this signature. |
def FoxitPDFSDKPython2.PDFDoc.SaveAs | ( | file_path, | |
save_flags | |||
) |
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 FoxitPDFSDKPython2.PDFDoc.SetFileVersion before saving, Foxit PDF SDK will ignore FoxitPDFSDKPython2.PDFDoc.e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
[in] | file_path | A full path for the new saved PDF file. It should not be an empty string. |
[in] | save_flags | Document saving flags. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNormal and this can be one or combination of these values. |
def FoxitPDFSDKPython2.PDFDoc.SaveAsWrapperFile | ( | file_path, | |
wrapper_data, | |||
user_permissions, | |||
owner_password | |||
) |
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
This function uses the current size of file which is specified by file_path to set wrapper offset.
[in] | file_path | A full path of a PDF file. Current PDF document will be saved into this PDF file as a wrapper file. |
[in] | wrapper_data | Wrapper data. If this is null, no wrapper data is used. |
[in] | user_permissions | User permissions for the wrapper document. Pass 0xFFFFFFFC if no special permissions is needed. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_PermPrint and this should be one or combination of these values. |
[in] | owner_password | Owner password. If this is an empty string, parameter user_permissions will be ignored. |
def FoxitPDFSDKPython2.PDFDoc.SetCacheFile | ( | file_stream, | |
is_own_file_stream | |||
) |
Set cache file (represented by a file stream) to current PDF document.
Cache file can be used to cache the large amount of data which are generated when the content stream is generated.
[in] | file_stream | A FoxitPDFSDKPython2.StreamCallback object which is implemented by user to cache data. It can be null. The origin cache file will be released if it is null. |
[in] | is_own_file_stream | Used to decide whether Foxit PDF SDK should own input stream callback object or not: true means input stream callback object will be destroyed by Foxit PDF SDK (by calling callback function StreamCallback::Release) when no need to cache data anymore for current PDF document. false means user should be responsible to destroy the stream callback object when no need to modify any content of current PDF document. |
def FoxitPDFSDKPython2.PDFDoc.SetDisplayMode | ( | display_mode | ) |
Set the display mode.
Display mode specifies how the document should be displayed when opened.
[in] | display_mode | Display mode value. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_DisplayUseNone and this should be one of these values. |
def FoxitPDFSDKPython2.PDFDoc.SetFileVersion | ( | version | ) |
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 FoxitPDFSDKPython2.PDFDoc.SaveAs or FoxitPDFSDKPython2.PDFDoc.StartSaveAs . This function does not check whether the PDF content matches the specified version.
If user wants to do compliance conversion about PDF version, please refer to module "Compliance" and use class FoxitPDFSDKPython2.PDFCompliance .
[in] | version | An integer that specifies the file version, for example value 14 means version "1.4", value 15 means "1.5", and etc. This value should be from 10 to 17 or 20 and be equal or greater than current version of current PDF file. |
def FoxitPDFSDKPython2.PDFDoc.SetOpenAction | ( | action | ) |
Set the action to be performed when the document is opened.
[in] | action | A valid action to be set. Currently only support following types as the new action: FoxitPDFSDKPython2.Action.e_TypeGoto , FoxitPDFSDKPython2.Action.e_TypeURI , FoxitPDFSDKPython2.Action.e_TypeJavaScript , FoxitPDFSDKPython2.Action.e_TypeNamed , FoxitPDFSDKPython2.Action.e_TypeSubmitForm , FoxitPDFSDKPython2.Action.e_TypeResetForm , FoxitPDFSDKPython2.Action.e_TypeHide , FoxitPDFSDKPython2.Action.e_TypeImportData . |
def FoxitPDFSDKPython2.PDFDoc.SetSecurityHandler | ( | handler | ) |
Set a PDF security handler for encryption, such as standard encryption(password), certificate encryption, and so on.
[in] | handler | A PDF security handler object. |
def FoxitPDFSDKPython2.PDFDoc.StartAddTiledWatermark | ( | page, | |
settings, | |||
page_range, | |||
pause | |||
) |
Add page type tiled watermark to PDF pages.
Add image type tiled watermark to PDF pages by image stream.
Add text type tiled watermark to PDF pages.
Add image type tiled watermark to PDF pages by image path.
If the watermark is tiled to multiple pages, these pages will keep the order defined in the parameter page_range. If the parameter page_range is initialized to empty, the watermark will be tiled to all pages of the document by default. In addition, XFA dynamic documents don't support inserting tiled watermarks.
[in] | page | A valid PDF page object, whose content will be used as the content of the tiled watermark. |
[in] | settings | Tiled watermark settings, containing layout setting. |
[in] | page_range | A range object that specifies some pages. These pages will be added tiled watermarks. The valid page range: from 0 to (count -1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . If this range object is constructed by default constructor and not set any value, that means all the pages of current document will be added tiled watermarks. |
[in] | pause | Pause callback object which decides if the recognizing process needs to be paused. This can be null which means not to pause during the recognizing process. If this is not null, it should be a valid pause object implemented by user. |
If the watermark is tiled to multiple pages, these pages will keep the order defined in the parameter page_range. If the parameter page_range is initialized to empty, the watermark will be tiled to all pages of the document by default. In addition, XFA dynamic documents don't support inserting tiled watermarks.
Image tiled watermarks support .bmp .dib .jpg .jpeg .jpe .gif .png .tif .tiff format.
[in] | src_img_file_path | Path of a image file. This should not be an empty string. |
[in] | settings | Tiled watermark settings, containing layout setting. |
[in] | page_range | A range object that specifies some pages. These pages will be added tiled watermarks. The valid page range: from 0 to (count -1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . If this range object is constructed by default constructor and not set any value, that means all the pages of current document will be added tiled watermarks. |
[in] | pause | Pause callback object which decides if the recognizing process needs to be paused. This can be null which means not to pause during the recognizing process. If this is not null, it should be a valid pause object implemented by user. |
If the watermark is tiled to multiple pages, these pages will keep the order defined in the parameter page_range. If the parameter page_range is initialized to empty, the watermark will be tiled to all pages of the document by default. In addition, XFA dynamic documents don't support inserting tiled watermarks.
[in] | text | A text string. This will be used as the content of the tiled watermark, It should not be an empty string. |
[in] | settings | Tiled watermark settings, containing layout setting. |
[in] | properties | Text properties for tiled watermark. |
[in] | page_range | A range object that specifies some pages. These pages will be added tiled watermarks. The valid page range: from 0 to (count -1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . If this range object is constructed by default constructor and not set any value, that means all the pages of current document will be added tiled watermarks. |
[in] | pause | Pause callback object which decides if the recognizing process needs to be paused. This can be null which means not to pause during the recognizing process. If this is not null, it should be a valid pause object implemented by user. |
If the watermark is tiled to multiple pages, these pages will keep the order defined in the parameter page_range. If the parameter page_range is initialized to empty, the watermark will be tiled to all pages of the document by default. In addition, XFA dynamic documents don't support inserting tiled watermark.
Image tiled watermarks support .bmp .dib .jpg .jpeg .jpe .gif .png .tif .tiff format.
[in] | src_img_stream | A FoxitPDFSDKPython2.FileReaderCallback object which is image stream by user to pass image data to Foxit PDF SDK. It must be vaild. |
[in] | settings | Tiled watermark settings, containing layout setting. |
[in] | page_range | A range object that specifies some pages. These pages will be added tiled watermarks. The valid page range: from 0 to (count -1). count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount . If this range object is constructed by default constructor and not set any value, that means all the pages of current document will be added tiled watermarks. |
[in] | pause | Pause callback object which decides if the recognizing process needs to be paused. This can be null which means not to pause during the recognizing process. If this is not null, it should be a valid pause object implemented by user. |
def FoxitPDFSDKPython2.PDFDoc.StartEmbedAllFonts | ( | pause | ) |
Start to convert all un-embeded fonts to embeded fonts.
It may take a long time to convert all un-embedded fonts to embedded fonts in current PDF document, so this function uses a progressive process to do this.
This function only works with fonts available for embedding. Whether a font is embeddable or not can be checked by function FoxitPDFSDKPython2.Font.IsSupportEmbedded .
This function will delete the original font object after embedding the font, however, the reference to the original font in the document will still exist.
[in] | pause | Pause callback object which decides if the embedding process needs to be paused. This can be null which means not to pause during the embedding process. If this is not null, it should be a valid pause object implemented by user. |
def FoxitPDFSDKPython2.PDFDoc.StartExtractPages | ( | file, | |
options, | |||
page_range, | |||
pause | |||
) |
Start to extract pages from current PDF document.
It may take a long time to extracting pages, so Foxit PDF SDK uses a progressive process to do this.
[in] | file | A FoxitPDFSDKPython2.FileWriterCallback object which is implemented by user to store the data of all the extracted pages in custom method. |
[in] | options | Options for extracting pages. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_ExtractPagesOptionAnnotation and this can be one or a combination of these values. 0 means no option is used. |
[in] | page_range | A range object to specify which pages are to be extracted. If this range object is constructed by default constructor and not set any value, all pages in the current document will be extracted. |
[in] | pause | Pause object which decides if the extracting 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. |
def FoxitPDFSDKPython2.PDFDoc.StartExtractPages | ( | file_path, | |
options, | |||
page_range, | |||
pause | |||
) |
Start to extract pages from current PDF document.
It may take a long time to extracting pages, so Foxit PDF SDK uses a progressive process to do this.
[in] | file_path | A full path for the new saved PDF file which is used to save the extracted pages. It should not be an empty string. |
[in] | options | Options for extracting pages. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_ExtractPagesOptionAnnotation and this can be one or a combination of these values. 0 means no option is used. |
[in] | page_range | A range object to specify which pages are to be extracted. If this range object is constructed by default constructor and not set any value, all pages in the current document will be extracted. |
[in] | pause | Pause object which decides if the extracting 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. |
def FoxitPDFSDKPython2.PDFDoc.StartGetPayloadFile | ( | payload_file, | |
pause | |||
) |
Start to get payload file.
It may take a long time to getting payload document, so this function uses a progressive process to do this.
[in] | payload_file | A WriterCallback callback object. User should implement the callback function in this callback object in order that this callback object can be used to save payload file. |
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.StartImportPages | ( | dest_index, | |
src_doc, | |||
flags, | |||
layer_name, | |||
page_range, | |||
pause | |||
) |
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.
If this function is used to combine two PDF files, pages are strongly recommended to be imported to the end of destination PDF file instead of to the beginning of destination PDF file.
[in] | 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. |
[in] | 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. |
[in] | flags | Options for importing pages. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_ImportFlagNormal and this can be one or a combination of these values. |
[in] | 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 FoxitPDFSDKPython2.PDFDoc.e_ImportFlagWithLayers , this should not be empty and should be a valid string. If parameter flags does not contain FoxitPDFSDKPython2.PDFDoc.e_ImportFlagWithLayers , this string will be ignored.
|
[in] | 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. |
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.StartImportPagesFromFilePath | ( | dest_index, | |
src_file_path, | |||
password, | |||
flags, | |||
layer_name, | |||
page_range, | |||
pause | |||
) |
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.
If this function is used to combine two PDF files, pages are strongly recommended to be imported to the end of destination PDF file instead of to the beginning of destination PDF file.
[in] | 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. |
[in] | 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. |
[in] | 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. |
[in] | flags | Options for importing pages. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_ImportFlagNormal and this can be one or a combination of these values. |
[in] | 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 FoxitPDFSDKPython2.PDFDoc.e_ImportFlagWithLayers , this should not be empty and should be a valid string. If parameter flags does not contain FoxitPDFSDKPython2.PDFDoc.e_ImportFlagWithLayers , this string will be ignored.
|
[in] | 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. |
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.StartLoad | ( | password, | |
is_cache_stream, | |||
pause | |||
) |
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:
[in] | 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. |
[in] | 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. |
[in] | pause | Pause object which decides if the loading 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. |
def FoxitPDFSDKPython2.PDFDoc.StartLoadW | ( | password, | |
is_cache_stream, | |||
pause | |||
) |
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:
[in] | 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. |
[in] | 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. |
[in] | pause | Pause object which decides if the loading 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. |
def FoxitPDFSDKPython2.PDFDoc.StartRecognizeForm | ( | pause | ) |
Start to recognize form in current PDF document.
It may take a long time to recognize form in PDF document, so this function uses a progressive process to do this.
For windows platform, users are strongly recommended to initialize OCR engine by calling function addon::ocr::OCREngine::Initialize before calling this function.
[in] | pause | Pause callback object which decides if the recognizing process needs to be paused. This can be null which means not to pause during the recognizing process. If this is not null, it should be a valid pause object implemented by user. |
def FoxitPDFSDKPython2.PDFDoc.StartSaveAs | ( | file, | |
save_flags, | |||
pause | |||
) |
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 FoxitPDFSDKPython2.PDFDoc.SetFileVersion before saving, Foxit PDF SDK will ignore FoxitPDFSDKPython2.PDFDoc.e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
[in] | file | A FoxitPDFSDKPython2.FileWriterCallback object which is implemented by user to save a PDF document. |
[in] | save_flags | Document saving flags. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNormal and this can be one or combination of these values. |
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.StartSaveAs | ( | file_path, | |
save_flags, | |||
pause | |||
) |
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 FoxitPDFSDKPython2.PDFDoc.SetFileVersion before saving, Foxit PDF SDK will ignore FoxitPDFSDKPython2.PDFDoc.e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
[in] | file_path | A full path for the new saved PDF file. It should not be an empty string. |
[in] | save_flags | Document saving flags. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNormal and this can be one or combination of these values. |
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.StartSaveAsPayloadFile | ( | file_path, | |
payload_file_path, | |||
crypto_filter, | |||
description, | |||
version, | |||
save_flags, | |||
pause | |||
) |
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 FoxitPDFSDKPython2.PDFDoc.SetFileVersion before saving, Foxit PDF SDK will ignore FoxitPDFSDKPython2.PDFDoc.e_SaveFlagIncremental in parameter save_flags and use the file version in saved PDF file.
[in] | file_path | A full path for the new saved PDF file. It should not be an empty string. |
[in] | payload_file_path | A full path of a PDF document which will be used as payload document. It should not be an empty string. |
[in] | crypto_filter | The name of the cryptographic filter used to encrypt the encrypted payload document. |
[in] | description | Description for wrapper file to show applications or confront users prompt information. |
[in] | version | The version number of the cryptographic filter used to encrypt the encrypted payload referenced by this dictionary. |
[in] | save_flags | Document saving flags. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNormal and this can be one or combination of these values. |
[in] | 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. |
def FoxitPDFSDKPython2.PDFDoc.UpdateHeaderFooter | ( | headerfooter | ) |
Update header-footer.
A PDF document can be added header-footer sereral times. When a header-footer is updated to the document, the old ones which appear in the same place with the new one will all be removed and then the new one will be added.
[in] | headerfooter | A valid header-footer object to be updated to current document. |
|
static |
Import pages without cloning stream objects into memory.
This flags is only useful when the source PDF document has not been encrypted. If this flag is used for importing pages, it will reduce memory overhead.
|
static |
Operate text annotations and fill in interactive form fields. (Bit 6 in permission value)
If value FoxitPDFSDKPython2.PDFDoc.e_PermModify is also set, user can create or modify interactive form fields (including signature fields).
|
static |
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 FoxitPDFSDKPython2.PDFDoc.e_PermModify is set or not.
|
static |
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 FoxitPDFSDKPython2.PDFDoc.e_PermExtractAccess .
|
static |
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.
|
static |
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 FoxitPDFSDKPython2.PDFDoc.e_PermAnnotForm is not used.
|
static |
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 FoxitPDFSDKPython2.PDFDoc.e_PermAnnotForm , FoxitPDFSDKPython2.PDFDoc.e_PermFillForm and FoxitPDFSDKPython2.PDFDoc.e_PermAssemble .
|
static |
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 FoxitPDFSDKPython2.PDFDoc.e_PermPrintHigh together.
|
static |
Print PDF document with higher qualities. (Bit 12 in permission value)
If this value is not set (and value FoxitPDFSDKPython2.PDFDoc.e_PermPrint is set), printing is limited to a low-level representation of the appearance, possibly of degraded quality.
|
static |
Save document incrementally.
This can be used alone or be combined with other saving flags except FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNormal . Especially, if this is combined with FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNoOriginal , only the increment data will be saved.
|
static |
Save document as a linearized file.
This should be used alone and cannot be used with other saving flags except FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNoUpdatingMetadataDateTime .. This can only be used for function FoxitPDFSDKPython2.PDFDoc.SaveAs or FoxitPDFSDKPython2.PDFDoc.StartSaveAs .
|
static |
Save document without original data or unchanged objects.
This can be used alone or be combined with other saving flags except FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNormal . Especially, if this is combined with FoxitPDFSDKPython2.PDFDoc.e_SaveFlagIncremental , only the increment data will be saved.
|
static |
Save document without updating metadata "ModDate" and "CreationDate".
This can be used alone or be combined with other saving flags. This can only be used for function FoxitPDFSDKPython2.PDFDoc.SaveAs and FoxitPDFSDKPython2.PDFDoc.StartSaveAs .
|
static |
Save document with removing redundant PDF objects.
This can be used alone or be combined with FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNoOriginal , FoxitPDFSDKPython2.PDFDoc.e_SaveFlagXRefStream or FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNoUpdatingMetadataDateTime . This can only be used for function FoxitPDFSDKPython2.PDFDoc.SaveAs or FoxitPDFSDKPython2.PDFDoc.StartSaveAs .
|
static |
Save document by using XRef stream.
This can be used alone or be combined with other saving flags except FoxitPDFSDKPython2.PDFDoc.e_SaveFlagNormal .