Foxit PDF SDK
fs_pdfdoc.h
Go to the documentation of this file.
1 
15 #ifndef FS_PDFDOC_H_
16 #define FS_PDFDOC_H_
17 
18 #include "common/fs_common.h"
19 #include "common/file/fs_file.h"
20 #ifndef __EMSCRIPTEN_RENDER__
21 #include "pdf/fs_bookmark.h"
22 #include "pdf/fs_headerfooter.h"
23 #endif
24 #include "pdf/fs_pdfpage.h"
25 #ifndef __EMSCRIPTEN_RENDER__
26 #include "pdf/fs_readingbookmark.h"
27 #endif
29 
35 namespace foxit {
36 namespace fdf {
37 #ifndef __EMSCRIPTEN_RENDER__
38 class FDFDoc;
39 #endif
40 } // namespace fdf
41 namespace pdf {
42 // forward declaration
43 namespace actions {
44 class Action;
45 } // namespace actions
46 namespace interform {
47 class Form;
48 } // namespace interform;
49 class ReadingBookmark;
50 class SecurityHandler;
51 class StdEncryptData;
52 class CertificateEncryptData;
53 class DRMEncryptData;
54 class CustomEncryptData;
55 class RMSEncryptData;
56 
58 class WrapperData FS_FINAL : public Object {
59  public:
62  : version(0) {}
63 
73  WrapperData(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description)
74  : version(version)
75  , type(type)
76  , app_id(app_id)
77  , uri(uri)
79 
85  WrapperData(const WrapperData& wrapper_data)
86  : version(wrapper_data.version)
87  , type(wrapper_data.type)
88  , app_id(wrapper_data.app_id)
89  , uri(wrapper_data.uri)
90  , description(wrapper_data.description) {}
91 
99  WrapperData& operator = (const WrapperData& wrapper_data) {
100  version = wrapper_data.version;
101  type = wrapper_data.type;
102  app_id = wrapper_data.app_id;
103  uri = wrapper_data.uri;
104  description = wrapper_data.description;
105  return *this;
106  }
107 
119  void Set(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description) {
120  this->version = version;
121  this->type = type;
122  this->app_id = app_id;
123  this->uri = uri;
124  this->description = description;
125  }
126 
128  int version;
137 };
138 
140 class PayLoadData FS_FINAL {
141  public:
144  : version(0.0f)
145  , file_size (0){}
146 
156  PayLoadData(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
158  const wchar_t* description)
159  : version(version)
164  {}
165 
171  PayLoadData(const PayLoadData& payload_data)
172  : version(payload_data.version)
173  , crypto_filter(payload_data.crypto_filter)
174  , file_name(payload_data.file_name)
175  , file_size(payload_data.file_size)
176  , description(payload_data.description)
177  {}
178 
186  PayLoadData& operator=(const PayLoadData& payload_data) {
187  version = payload_data.version;
188  crypto_filter = payload_data.crypto_filter;
189  description = payload_data.description;
190  file_name = payload_data.file_name;
191  file_size = payload_data.file_size;
192  return *this;
193  }
194 
204  void Set(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
206  const wchar_t* description) {
207  this->version = version;
208  this->crypto_filter = crypto_filter;
209  this->file_name = file_name;
210  this->file_size = file_size;
211  this->description = description;
212  }
213 
215  float version;
224 };
225 
230 class PageBasicInfo FS_FINAL : public Object {
231  public:
241  : width(width)
242  , height(height)
243  , rotation(rotation) {}
244 
247  : width(0)
248  , height(0)
249  , rotation(CommonDefines::e_RotationUnknown) {}
255  PageBasicInfo(const PageBasicInfo& page_info)
256  : width(page_info.width)
257  , height(page_info.height)
258  , rotation(page_info.rotation) {}
267  width = page_info.width;
268  height = page_info.height;
269  rotation = page_info.rotation;
270  return *this;
271  }
282  void Set(float width, float height, common::Rotation rotation) {
283  this->width = width;
284  this->height = height;
285  this->rotation = rotation;
286  }
287 
289  float width;
291  float height;
297 };
298 
303 class EmbeddedFontData FS_FINAL : public Object {
304  public:
307 
316 
327  return *this;
328  }
329 
334 };
335 
389 class PDFDoc FS_FINAL : public Base {
390  public:
396  typedef enum _PasswordType {
405  } PasswordType;
406 
412  typedef enum _EncryptType {
429  } EncryptType;
430 
436  typedef enum _UserPermissions {
442  e_PermPrint = 0x0004,
449  e_PermModify = 0x0008,
455  e_PermExtract = 0x0010,
461  e_PermAnnotForm = 0x0020,
467  e_PermFillForm = 0x0100,
480  e_PermAssemble = 0x0400,
487  } UserPermissions;
488 
493  typedef enum _SaveFlags {
527  } SaveFlags;
528 
534  typedef enum _ImportPageFlags {
545  } ImportPageFlags;
546 
552  typedef enum _ExtractPagesOptions {
569 
575  typedef enum _InsertDocOptions {
579 
585  typedef enum _DisplayMode {
601  } DisplayMode;
602 
609  typedef enum _DataType {
611  e_Forms = 0x0001,
613  e_Annots = 0x0002,
615  e_Links = 0x0004
616  } DataType;
617 
623  typedef enum _WrapperType {
630  } WrapperType;
631 
632 
639  PDFDoc();
640 
649  explicit PDFDoc(const char* path);
650 
659  explicit PDFDoc(const wchar_t* path);
660 
671  explicit PDFDoc(const void* buffer, size_t size);
672 
687  explicit PDFDoc(common::file::ReaderCallback* file_read, bool is_async = false);
688  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
689  explicit PDFDoc(FS_HANDLE handle);
691  ~PDFDoc();
692 
698  PDFDoc(const PDFDoc& other);
699 
707  PDFDoc& operator = (const PDFDoc& other);
715  bool operator == (const PDFDoc& other) const;
716 
724  bool operator != (const PDFDoc& other) const;
725 
733  bool IsEmpty() const;
734 
741 
761  bool IsLinearized() const;
762 
769  bool IsTaggedPDF() const;
770 
792  ErrorCode Load(const String& password = "");
793 
816  ErrorCode LoadW(const WString& password = WString());
817 
849  common::Progressive StartLoad(const String& password = "", bool is_cache_stream = true,
850  common::PauseCallback* pause = NULL);
882  common::Progressive StartLoadW(const WString& password = WString(), bool is_cache_stream = true,
883  common::PauseCallback* pause = NULL);
884 
894  int GetFirstAvailPageIndex() const;
895 
906  bool IsXFA() const;
907 
914  bool IsEncrypted() const;
915 
921  void ClearRenderCache();
922 
937 
945 
960  PasswordType CheckPassword(const String& password);
961 
976  PasswordType CheckPassword(const foxit::WString& password);
977 
986  bool IsUserPassword(const String& password);
987 
996  bool IsUserPassword(const foxit::WString& password);
997 
1006  bool IsOwnerPassword(const String& password);
1007 
1016  bool IsOwnerPassword(const foxit::WString& password);
1017 
1027  String GetUserPassword(const String& owner_password);
1028 #ifndef __EMSCRIPTEN_RENDER__
1029 
1037 
1046 
1055 
1064 
1077 #endif
1078 
1104  bool SaveAs(const char* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1105 
1132  bool SaveAs(const wchar_t* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1133 
1167  common::Progressive StartSaveAs(const char* file_path,
1168  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1169  common::PauseCallback* pause = NULL);
1170 
1204  common::Progressive StartSaveAs(const wchar_t* file_path,
1205  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1206  common::PauseCallback* pause = NULL);
1207 
1244 #ifndef __EMSCRIPTEN_RENDER__
1245 
1253 
1263 
1271  bool RemoveBookmark(const Bookmark& bookmark);
1272 
1279  bool HasLayer() const;
1280 
1287  bool HasHeaderFooter();
1288 
1298 
1309  void AddHeaderFooter(const HeaderFooter& headerfooter);
1310 
1321  void UpdateHeaderFooter(const HeaderFooter& headerfooter);
1322 
1328  bool RemoveAllHeaderFooters();
1329 #endif
1330 
1335  int GetPageCount() const;
1336 
1350  PDFPage GetPage(int index);
1351 
1360  DisplayMode GetDisplayMode() const;
1361 
1372  void SetDisplayMode(DisplayMode display_mode);
1373 
1380 
1387 
1396 
1403 
1410 
1419 
1437 
1445  void DeleteIndirectObject(uint32 object_number);
1446 
1453  uint32 GetUserPermissions() const;
1454 
1461  bool IsWrapper() const;
1462 
1469  WrapperType GetWrapperType() const;
1470 
1477  WrapperData GetWrapperData() const;
1478 
1485  int64 GetWrapperOffset() const;
1486 
1494 
1512 
1538  bool SaveAsWrapperFile(const wchar_t* file_path, const WrapperData* wrapper_data = NULL,
1539  uint32 user_permissions = 0xFFFFFFFC, const char* owner_password = "");
1540 
1568  common::Progressive StartSaveAsPayloadFile(const wchar_t* file_path, const wchar_t* payload_file_path,
1569  const wchar_t* crypto_filter, const wchar_t* description, float version,
1570  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1571  common::PauseCallback* pause = NULL);
1583  bool HasForm() const;
1584 
1591 #ifndef __EMSCRIPTEN_RENDER__
1592 
1601 
1615  ReadingBookmark InsertReadingBookmark(int reading_bookmark_index, const WString& title, int dest_page_index);
1616 
1624  bool RemoveReadingBookmark(const ReadingBookmark& reading_bookmark);
1625 
1631  int GetSignatureCount();
1632 
1642 
1650  void RemoveSignature(const foxit::pdf::Signature& signature);
1651 #endif
1652 
1664  PDFPage InsertPage(int index, float width, float height);
1678 
1687  bool RemovePage(int index);
1698  bool RemovePage(const foxit::pdf::PDFPage& page);
1699 
1715  bool MovePageTo(const PDFPage& page, int dest_index);
1716 
1737  bool MovePagesTo(const common::Range& page_range, int dest_index);
1738 
1792  const wchar_t* src_file_path, const String& password,
1793  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
1794  const common::Range& page_range = common::Range(),
1795  common::PauseCallback* pause = NULL);
1849  const wchar_t* src_file_path, const WString& password,
1850  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
1851  const common::Range& page_range = common::Range(),
1852  common::PauseCallback* pause = NULL);
1903  common::Progressive StartImportPages(int dest_index, const PDFDoc& src_doc,
1904  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
1905  const common::Range& page_range = common::Range(),
1906  common::PauseCallback* pause = NULL);
1907 
1930  common::Progressive StartExtractPages(const char* file_path, uint32 options, const common::Range& page_range = common::Range(),
1931  common::PauseCallback* pause = NULL);
1932 
1955  common::Progressive StartExtractPages(const wchar_t* file_path, uint32 options, const common::Range& page_range = common::Range(),
1956  common::PauseCallback* pause = NULL);
1957 
1983 
2000  void InsertDocument(int dest_index, const PDFDoc& src_doc, uint32 options);
2001 
2002 #ifndef __EMSCRIPTEN_RENDER__
2003 
2022  bool ImportFromFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
2023 
2043  bool ExportToFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
2044 
2053  bool ExportAnnotToFDF(const annots::Annot& pdf_annot,const fdf::FDFDoc& fdf_doc);
2054 #endif
2055 
2060  String GetHeader() const;
2061 
2067  int GetFileVersion();
2068 
2084  void SetFileVersion(int version);
2085 
2098  bool SetSecurityHandler(const SecurityHandler& handler);
2099 
2110 
2120  bool RemoveSecurity();
2121 
2129  int GetFontCount();
2130 
2139  common::Font GetFont(int index);
2140 
2147 
2159  bool SetOpenAction(actions::Action& action);
2160 
2166  bool RemoveOpenAction();
2167 
2173  bool DoJSOpenAction();
2174 
2180  bool IsPortfolio();
2181 
2196  PageBasicInfo GetPageBasicInfo(int index);
2197 
2204 
2205 #ifdef _SUPPORTWEBSDK_
2206  objects::PDFStream* CreateIcon(String imgStream,int width, int height);
2207 #endif
2208 
2215  void CreateDSS();
2216 
2217 };
2218 } // namespace pdf
2219 } // namespace foxit
2220 #endif // FS_PDFDOC_H_
2221 
FX_INT64 int64
Signed 64-bit integer.
Definition: fs_basictypes.h:192
When document is opened, full-screen mode, with no menu bar, window controls, or any other windows ar...
Definition: fs_pdfdoc.h:596
int GetFileVersion()
Get PDF file version stored in PDF header section.
bool ImportFromFDF(const fdf::FDFDoc &fdf_doc, int types=pdf::PDFDoc::e_Forms|pdf::PDFDoc::e_Annots, const common::Range &page_range=common::Range())
Import form fields and annotations from a FDF/XFDF document.
int GetReadingBookmarkCount()
Get the count of reading bookmarks.
PasswordType GetPasswordType() const
Get the type of current used password.
File writing interface.
Definition: fx_stream.h:451
void SetDisplayMode(DisplayMode display_mode)
Set the display mode.
bool RemoveReadingBookmark(const ReadingBookmark &reading_bookmark)
Remove a reading bookmark from current PDF document.
bool IsTaggedPDF() const
Check if current PDF document is a Tagged PDF file.
objects::PDFDictionary * GetEncryptDict() const
Get the encrypt dictionary.
SaveFlags
Enumeration for PDF document saving flags.
Definition: fs_pdfdoc.h:493
bool RemoveOpenAction()
Remove the action to be performed when the document is opened.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
If set, that means OCProperties will be extracted as well.
Definition: fs_pdfdoc.h:560
objects::PDFDictionary * GetCatalog() const
Get the catalog dictionary.
bool operator==(const PDFDoc &other) const
Equal operator.
WrapperData()
Constructor.
Definition: fs_pdfdoc.h:61
WString description
Description for wrapper file to show applications or confront users prompt information.
Definition: fs_pdfdoc.h:136
int64 GetWrapperOffset() const
Get wrapper offset if current document's wrapper type is PDFDoc::e_WrapperFoxit.
A user password is used in PDF document.
Definition: fs_pdfdoc.h:402
UserPermissions
Enumeration for user access permissions in a PDF document.
Definition: fs_pdfdoc.h:436
Definition: fs_action.h:418
void UpdateHeaderFooter(const HeaderFooter &headerfooter)
Update header-footer.
PDF 2.0 wrapper document.
Definition: fs_pdfdoc.h:629
Definition: fs_annot.h:754
bool DoJSOpenAction()
Perform JavaScript actions when the document is opened.
uint32 GetUserPermissions() const
Get user access permissions.
bool MovePageTo(const PDFPage &page, int dest_index)
Move a specified page to a new index position.
foxit::pdf::Signature GetSignature(int index)
Get a signature by index.
String GetHeader() const
Get PDF header identifying the version of the PDF specification to which the file conforms.
Definition: fs_pdfdoc.h:140
Definition: fs_pdfdoc.h:58
Size
Enumeration for page size type.
Definition: fs_pdfpage.h:420
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
WString file_name
The payload file name.
Definition: fs_pdfdoc.h:219
SecurityHandler GetSecurityHandler()
Get current PDF security handler of current document.
Definition: fs_common.h:568
Definition: fs_security.h:368
int version
Wrapper version.
Definition: fs_pdfdoc.h:128
PayLoadData(float version, const wchar_t *crypto_filter, const wchar_t *file_name, foxit::int64 file_size, const wchar_t *description)
Constructor, with parameters.
Definition: fs_pdfdoc.h:156
EmbeddedFontData(const EmbeddedFontData &other)
Constructor, with another embedded font data object.
Definition: fs_pdfdoc.h:313
bool ExportAnnotToFDF(const annots::Annot &pdf_annot, const fdf::FDFDoc &fdf_doc)
Export specified annotation to a FDF/XFDF document.
bool IsLinearized() const
Check if current PDF document is a linearized file.
bool ExportToFDF(const fdf::FDFDoc &fdf_doc, int types=pdf::PDFDoc::e_Forms|pdf::PDFDoc::e_Annots, const common::Range &page_range=common::Range())
Export form fields and annotations to a FDF/XFDF document.
EmbeddedFontData()
Constructor.
Definition: fs_pdfdoc.h:306
WrapperType
Enumeration for wrapper type.
Definition: fs_pdfdoc.h:623
common::Progressive StartLoadW(const WString &password=WString(), bool is_cache_stream=true, common::PauseCallback *pause=0)
Start to loading current document content by using a specified password.
bool RemoveSecurity()
Remove the security handler from current document, so that the later saved document will be unencrypt...
PDFDoc()
Constructor.
Header file for common definitions and classes.
bool SaveAsWrapperFile(const wchar_t *file_path, const WrapperData *wrapper_data=0, uint32 user_permissions=0xFFFFFFFC, const char *owner_password="")
Save current PDF document as a wrapper file.
bool RemoveAllHeaderFooters()
Remove all header-footers.
DisplayMode
Enumeration for display mode which specifies how the document should be displayed when opened.
Definition: fs_pdfdoc.h:585
If set, that means Javascript will be extracted as well.
Definition: fs_pdfdoc.h:558
When document is opened, thumbnail images are visible.
Definition: fs_pdfdoc.h:591
No encryption pattern.
Definition: fs_pdfdoc.h:416
Save document without original data or unchanged objects.
Definition: fs_pdfdoc.h:509
bool RemoveBookmark(const Bookmark &bookmark)
Remove a specified bookmark.
File reading interface.
Definition: fx_stream.h:566
objects::PDFObject * GetIndirectObject(uint32 object_number)
Get an indirect object by indirect object number.
void CreateDSS()
Create DSS information in current PDF document.
Header file for file operation related definitions and functions.
StdEncryptData GetStdEncryptData() const
Get encrypt data of standard encryption (known as password encryption).
Definition: fs_security.h:973
objects::PDFDictionary * GetInfo() const
Get the information dictionary.
void SetFileVersion(int version)
Set the PDF file version which will be stored in PDF header section of the saved PDF file.
bool operator !=(const PDFDoc &other) const
Not equal operator.
WString description
Description for payload file to show applications or confront users prompt information.
Definition: fs_pdfdoc.h:223
String GetUserPassword(const String &owner_password)
Get the user password based on owner password.
EmbeddedFontData & operator=(const EmbeddedFontData &other)
Assign operator.
Definition: fs_pdfdoc.h:324
WrapperData GetWrapperData() const
Get wrapper data if current document's wrapper type is PDFDoc::e_WrapperFoxit.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:236
Encryption type: Foxit DRM encryption.
Definition: fs_pdfdoc.h:422
Import pages normally.
Definition: fs_pdfdoc.h:536
int GetSignatureCount()
Get the count of signature.
common::Progressive StartExtractPages(const char *file_path, uint32 options, const common::Range &page_range=common::Range(), common::PauseCallback *pause=0)
Start to extract pages from current PDF document.
Definition: fs_pdfobject.h:55
common::Font GetFont(int index)
Get a font by index.
void ClearRenderCache()
Clear the cache used during rendering, to reduce the memory usage.
Encryption type: password, which is the standard encryption.
Definition: fs_pdfdoc.h:418
bool IsPortfolio()
Check whether current PDF document is a portfolio file or not.
bool RemovePage(int index)
Remove a PDF page by page index.
ReadingBookmark GetReadingBookmark(int index)
Get a reading bookmark by index.
Assemble PDF document. (Bit 11 in permission value)
Definition: fs_pdfdoc.h:480
DisplayMode GetDisplayMode() const
Get the display mode.
When document is opened, optional content group panels are visible.
Definition: fs_pdfdoc.h:598
bool HasLayer() const
Check whether current PDF document has layer (known as "Optional content group" in <PDF reference 1....
PDFPage GetPage(int index)
Get a PDF page by index.
(Reserved, not supported yet) If set, only link annotations are to imported from or exported to XFDF ...
Definition: fs_pdfdoc.h:615
uint64 GetFileSize()
Get file size.
Save document with removing redundant PDF objects.
Definition: fs_pdfdoc.h:526
When document is opened, attachment panels are visible.
Definition: fs_pdfdoc.h:600
DataType
Enumeration for data type used to decide which object(s) will be imported from or exported to FDF/XFD...
Definition: fs_pdfdoc.h:609
If set, form fields are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:611
Definition: fs_security.h:833
WStringArray nonstandard_font_name_array
Font name array of embedded fonts which cannot be replaced by system fonts if they are to be unembede...
Definition: fs_pdfdoc.h:331
ExtractPagesOptions
Enumeration for options used for extracting pages.
Definition: fs_pdfdoc.h:552
PDFPage InsertPage(int index, float width, float height)
Insert a new blank PDF page to document, by index.
RMSEncryptData GetRMSEncryptData() const
Get encrypt data of RMS encryption.
(Reserved, currently, this value is not used.) Encryption type: Foxit connected PDF DRM encryption.
Definition: fs_pdfdoc.h:428
BYTE STRING CLASS.
Definition: fx_string.h:317
actions::Action GetOpenAction()
Get the action to be performed when the document is opened.
PageBasicInfo(float width, float height, common::Rotation rotation)
Constructor, with parameters.
Definition: fs_pdfdoc.h:240
When document is opened, neither document outlines nor thumbnail images are visible.
Definition: fs_pdfdoc.h:587
Encryption type: Microsoft RMS encryption.
Definition: fs_pdfdoc.h:426
bool MovePagesTo(const common::Range &page_range, int dest_index)
Move one or more pages (specified by index) to a new index position.
bool HasHeaderFooter()
Check whether current document has header-footer.
PageBasicInfo()
Constructor.
Definition: fs_pdfdoc.h:246
Unknown encryption type.
Definition: fs_pdfdoc.h:414
Header file for header-footer related definitions and classes.
WString type
Wrapper type to indicate a type of the current wrapper file.
Definition: fs_pdfdoc.h:130
Definition: fs_signature.h:93
int GetFirstAvailPageIndex() const
Get the page index of the fist available page.
Definition: fs_security.h:137
WString uri
The URI for consumers to get more information.
Definition: fs_pdfdoc.h:134
Rotation
Enumeration for rotation.
Definition: fs_common.h:344
bool IsUserPassword(const String &password)
Check if input password is the user password of current PDF document.
Unknown rotation.
Definition: fs_common.h:354
When document is opened, document outlines (bookmarks) are visible.
Definition: fs_pdfdoc.h:589
common::Progressive StartImportPages(int dest_index, const PDFDoc &src_doc, uint32 flags=PDFDoc::e_ImportFlagNormal, const char *layer_name="", const common::Range &page_range=common::Range(), common::PauseCallback *pause=0)
Start to import pages from another PDF document (via PDF document object).
common::Progressive StartSaveAs(const char *file_path, uint32 save_flags=PDFDoc::e_SaveFlagNormal, common::PauseCallback *pause=0)
Start to save current PDF document as another PDF file.
common::Progressive StartLoad(const String &password="", bool is_cache_stream=true, common::PauseCallback *pause=0)
Start to loading current document content by using a specified password.
PDFDoc & operator=(const PDFDoc &other)
Assign operator.
Header file for PDF object related definitions and classes.
Definition: fs_pdfdoc.h:230
int GetPageCount() const
Get the count of pages.
Header file for PDF page related definitions and classes.
PayLoadData & operator=(const PayLoadData &payload_data)
Assign operator.
Definition: fs_pdfdoc.h:186
Fill PDF form. (Bit 9 in permission value)
Definition: fs_pdfdoc.h:467
bool SaveAs(const char *file_path, uint32 save_flags=PDFDoc::e_SaveFlagNormal)
Save current PDF document as another PDF file.
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:221
EncryptType
Enumeration for encryption type.
Definition: fs_pdfdoc.h:412
PageBasicInfo & operator=(const PageBasicInfo &page_info)
Assign operator.
Definition: fs_pdfdoc.h:266
WrapperData(int version, const wchar_t *type, const wchar_t *app_id, const wchar_t *uri, const wchar_t *description)
Constructor, with parameters.
Definition: fs_pdfdoc.h:73
Foxit namespace.
Definition: fs_compare.h:27
Definition: fs_security.h:56
PayLoadData()
Constructor.
Definition: fs_pdfdoc.h:143
uint32 AddIndirectObject(objects::PDFObject *pdf_object)
Add a PDF object to current PDF document, to be an indirect object.
Definition: fs_bookmark.h:58
void InsertDocument(int dest_index, const PDFDoc &src_doc, uint32 options)
Insert another PDF document to the specified location of current PDF document.
PageBasicInfo GetPageBasicInfo(int index)
Get the basic information of a page specified by index.
void RemoveSignature(const foxit::pdf::Signature &signature)
Remove a signature.
Save document incrementally.
Definition: fs_pdfdoc.h:502
Definition: fs_readingbookmark.h:43
If set, that means attachment files will be extracted as well.
Definition: fs_pdfdoc.h:567
If set, annotations (except link annotations) are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:613
Definition: fx_basic.h:3752
ErrorCode LoadW(const WString &password=WString())
Load current document content by using a specified password.
Encryption type: digital certificate encryption.
Definition: fs_pdfdoc.h:420
Definition: fs_pdfobject.h:763
int GetFontCount()
Count all the PDF fonts used in current PDF document.
void AddHeaderFooter(const HeaderFooter &headerfooter)
Add new header-footer.
bool HasForm() const
Check whether current PDF document has interactive form (also known as AcroForm).
void Set(float width, float height, common::Rotation rotation)
Set value.
Definition: fs_pdfdoc.h:282
Import pages with layers.
Definition: fs_pdfdoc.h:538
Operate text annotations and fill in interactive form fields. (Bit 6 in permission value)
Definition: fs_pdfdoc.h:461
common::Progressive StartImportPagesFromFilePath(int dest_index, const wchar_t *src_file_path, const String &password, uint32 flags=PDFDoc::e_ImportFlagNormal, const char *layer_name="", const common::Range &page_range=common::Range(), common::PauseCallback *pause=0)
Start to import pages from another PDF document (via file path).
void Set(float version, const wchar_t *crypto_filter, const wchar_t *file_name, int64 file_size, const wchar_t *description)
Set value.
Definition: fs_pdfdoc.h:204
void Set(int version, const wchar_t *type, const wchar_t *app_id, const wchar_t *uri, const wchar_t *description)
Set value.
Definition: fs_pdfdoc.h:119
If set, that means structure tree will be extracted as well.
Definition: fs_pdfdoc.h:556
ReadingBookmark InsertReadingBookmark(int reading_bookmark_index, const WString &title, int dest_page_index)
Insert a reading bookmark to current PDF document.
PasswordType CheckPassword(const String &password)
Check the type of a specified password.
InsertDocOptions
Enumeration for options used for inserting a PDF document to another.
Definition: fs_pdfdoc.h:575
objects::PDFDictionary * GetTrailer() const
Get the trailer dictionary.
ImportPageFlags
Enumeration for flags used for importing pages.
Definition: fs_pdfdoc.h:534
bool SetOpenAction(actions::Action &action)
Set the action to be performed when the document is opened.
If set, that means annotations related to extracted pages will be extracted as well.
Definition: fs_pdfdoc.h:554
#define NULL
The null-pointer value.
Definition: fx_system.h:767
common::Progressive StartGetPayloadFile(foxit::common::file::WriterCallback *payload_file, common::PauseCallback *pause=0)
Start to get payload file.
WrapperData & operator=(const WrapperData &wrapper_data)
Assign operator.
Definition: fs_pdfdoc.h:99
Save document normally, without using any special flag. This can only be used alone.
Definition: fs_pdfdoc.h:495
~PDFDoc()
Destructor.
Definition: fs_pdfdoc.h:389
WString crypto_filter
The name of the cryptographic filter used to encrypt the encrypted payload document.
Definition: fs_pdfdoc.h:217
WString app_id
Application identity to indicate applications to open this wrapper data.
Definition: fs_pdfdoc.h:132
Definition: fs_pdfpage.h:342
If set, that means to use PDFDoc::e_SaveFlagXRefStream saving flag for the result file in order to re...
Definition: fs_pdfdoc.h:565
EncryptType GetEncryptionType() const
Get the encryption type.
bool IsOwnerPassword(const String &password)
Check if input password is the owner password of current PDF document.
Definition: fs_fdfdoc.h:51
float height
Page height.
Definition: fs_pdfdoc.h:291
Bookmark CreateRootBookmark()
Create new bookmark root node.
Import pages without cloning stream objects into memory.
Definition: fs_pdfdoc.h:544
bool SetSecurityHandler(const SecurityHandler &handler)
Set a PDF security handler for encryption, such as standard encryption(password), certificate encrypt...
Definition: fs_security.h:586
bool IsEncrypted() const
Check whether current document is an encrypted file or not.
float version
The version number of the cryptographic filter used to encrypt the encrypted payload referenced by th...
Definition: fs_pdfdoc.h:215
EmbeddedFontData GetEmbeddedFontData()
Get embedded font data.
Print PDF document with higher qualities. (Bit 12 in permission value)
Definition: fs_pdfdoc.h:486
Definition: fs_basictypes.h:226
WrapperData(const WrapperData &wrapper_data)
Constructor, with another wrapper data object.
Definition: fs_pdfdoc.h:85
int64 file_size
The payload file size.
Definition: fs_pdfdoc.h:221
bool IsWrapper() const
Check whether current document is a wrapper file or not.
Definition: fs_common.h:1418
Encryption type: customized encryption.
Definition: fs_pdfdoc.h:424
An owner password is used in PDF document.
Definition: fs_pdfdoc.h:404
PageBasicInfo(const PageBasicInfo &page_info)
Constructor, with another page basic information object.
Definition: fs_pdfdoc.h:255
Modify PDF contents. (Bit 4 in permission value)
Definition: fs_pdfdoc.h:449
bool IsXFA() const
Check whether current PDF document is an XFA document.
common::Rotation rotation
Page rotation. Please refer to values starting from common::e_Rotation0 and this should be one of the...
Definition: fs_pdfdoc.h:296
WrapperType GetWrapperType() const
Get Wrapper type.
CustomEncryptData GetCustomEncryptData() const
Get encrypt data of custom encryption.
CertificateEncryptData GetCertificateEncryptData() const
Get encrypt data of certificate encryption.
Definition: fs_pdfdoc.h:303
WStringArray standard_font_name_array
Font name array of embedded fonts which are standard fonts and can be replaced by system fonts if the...
Definition: fs_pdfdoc.h:333
float width
Page width.
Definition: fs_pdfdoc.h:289
PayLoadData(const PayLoadData &payload_data)
Constructor, with another payload data object.
Definition: fs_pdfdoc.h:171
Definition: fs_pdfobject.h:385
objects::PDFDictionary * GetPagesDict() const
Get the dictionary of "Pages".
WIDE STRING CLASS.
Definition: fx_string.h:1452
Header file for bookmark related definitions and classes.
Definition: fs_common.h:1263
Normal document.
Definition: fs_pdfdoc.h:625
DRMEncryptData GetDRMEncryptData() const
Get encrypt data of Foxit DRM encryption.
If set, that means attachments will be inserted to target document as well.
Definition: fs_pdfdoc.h:577
bool IsEmpty() const
Check whether current object is empty or not.
PayLoadData GetPayLoadData()
Get payload data if current document's wrapper type is PDFDoc::e_WrapperPDFV2.
Bookmark GetRootBookmark()
Get bookmark root node.
Header file for reading bookmark related definitions and classes.
void DeleteIndirectObject(uint32 object_number)
Delete an indirect object by indirect object number.
Foxit wrapper document.
Definition: fs_pdfdoc.h:627
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
HeaderFooter GetEditableHeaderFooter()
Get the editable header footer object.
Save document by using XRef stream.
Definition: fs_pdfdoc.h:514
Print PDF document with normal mode. (Bit 3 in permission value)
Definition: fs_pdfdoc.h:442
The password is invalid.
Definition: fs_pdfdoc.h:398
Extract PDF contents. (Bit 5 in permission value)
Definition: fs_pdfdoc.h:455
ErrorCode Load(const String &password="")
Load current document content by using a specified password.
No password is used in PDF document.
Definition: fs_pdfdoc.h:400
FX_UINT64 uint64
Unsigned 64-bit integer.
Definition: fs_basictypes.h:194
Definition: fs_basictypes.h:399
Page size: letter.
Definition: fs_pdfpage.h:422
Disabilities support. (Bit 10 in permission value)
Definition: fs_pdfdoc.h:473
Save document as a linearized file.
Definition: fs_pdfdoc.h:520
PasswordType
Enumeration for the type of current used password in a PDF document.
Definition: fs_pdfdoc.h:396
common::Progressive StartSaveAsPayloadFile(const wchar_t *file_path, const wchar_t *payload_file_path, const wchar_t *crypto_filter, const wchar_t *description, float version, uint32 save_flags=PDFDoc::e_SaveFlagNormal, common::PauseCallback *pause=0)
Start to save current PDF document as a wrapper document with a payload document (defined in PDF 2....