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 #endif
23 #include "pdf/fs_pdfpage.h"
24 #ifndef __EMSCRIPTEN_RENDER__
25 #include "pdf/fs_readingbookmark.h"
26 #endif
28 
34 namespace foxit {
35 namespace fdf {
36 #ifndef __EMSCRIPTEN_RENDER__
37 class FDFDoc;
38 #endif
39 } // namespace fdf
40 namespace pdf {
41 // forward declaration
42 namespace actions {
43 class Action;
44 } // namespace actions
45 namespace interform {
46 class Form;
47 } // namespace interform;
48 class ReadingBookmark;
49 class SecurityHandler;
50 class StdEncryptData;
51 class CertificateEncryptData;
52 class DRMEncryptData;
53 class CustomEncryptData;
54 class RMSEncryptData;
55 
57 class WrapperData FS_FINAL : public Object {
58  public:
61  : version(0) {}
62 
72  WrapperData(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description)
73  : version(version)
74  , type(type)
75  , app_id(app_id)
76  , uri(uri)
78 
84  WrapperData(const WrapperData& wrapper_data)
85  : version(wrapper_data.version)
86  , type(wrapper_data.type)
87  , app_id(wrapper_data.app_id)
88  , uri(wrapper_data.uri)
89  , description(wrapper_data.description) {}
90 
98  WrapperData& operator = (const WrapperData& wrapper_data) {
99  version = wrapper_data.version;
100  type = wrapper_data.type;
101  app_id = wrapper_data.app_id;
102  uri = wrapper_data.uri;
103  description = wrapper_data.description;
104  return *this;
105  }
106 
118  void Set(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description) {
119  this->version = version;
120  this->type = type;
121  this->app_id = app_id;
122  this->uri = uri;
123  this->description = description;
124  }
125 
127  int version;
136 };
137 
139 class PayLoadData FS_FINAL {
140  public:
143  : version(0.0f)
144  , file_size (0){}
145 
155  PayLoadData(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
157  const wchar_t* description)
158  : version(version)
163  {}
164 
170  PayLoadData(const PayLoadData& payload_data)
171  : version(payload_data.version)
172  , crypto_filter(payload_data.crypto_filter)
173  , description(payload_data.description)
174  , file_name(payload_data.file_name)
175  , file_size(payload_data.file_size){}
176 
184  PayLoadData& operator=(const PayLoadData& payload_data) {
185  version = payload_data.version;
186  crypto_filter = payload_data.crypto_filter;
187  description = payload_data.description;
188  file_name = payload_data.file_name;
189  file_size = payload_data.file_size;
190  return *this;
191  }
192 
202  void Set(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
204  const wchar_t* description) {
205  this->version = version;
206  this->crypto_filter = crypto_filter;
207  this->file_name = file_name;
208  this->file_size = file_size;
209  this->description = description;
210  }
211 
213  float version;
222 };
223 
228 class PageBasicInfo FS_FINAL : public Object {
229  public:
239  : width(width)
240  , height(height)
241  , rotation(rotation) {}
242 
245  : width(0)
246  , height(0)
247  , rotation(CommonDefines::e_RotationUnknown) {}
253  PageBasicInfo(const PageBasicInfo& page_info)
254  : width(page_info.width)
255  , height(page_info.height)
256  , rotation(page_info.rotation) {}
265  width = page_info.width;
266  height = page_info.height;
267  rotation = page_info.rotation;
268  return *this;
269  }
280  void Set(float width, float height, common::Rotation rotation) {
281  this->width = width;
282  this->height = height;
283  this->rotation = rotation;
284  }
285 
287  float width;
289  float height;
295 };
296 
347 class PDFDoc FS_FINAL : public Base {
348  public:
354  typedef enum _PasswordType {
363  } PasswordType;
364 
370  typedef enum _EncryptType {
387  } EncryptType;
388 
394  typedef enum _UserPermissions {
400  e_PermPrint = 0x0004,
407  e_PermModify = 0x0008,
413  e_PermExtract = 0x0010,
419  e_PermAnnotForm = 0x0020,
425  e_PermFillForm = 0x0100,
438  e_PermAssemble = 0x0400,
445  } UserPermissions;
446 
451  typedef enum _SaveFlags {
485  } SaveFlags;
486 
492  typedef enum _ImportPageFlags {
503  } ImportPageFlags;
504 
510  typedef enum _ExtractPagesOptions {
527 
533  typedef enum _InsertDocOptions {
537 
543  typedef enum _DisplayMode {
559  } DisplayMode;
560 
567  typedef enum _DataType {
569  e_Forms = 0x0001,
571  e_Annots = 0x0002,
573  e_Links = 0x0004
574  } DataType;
575 
581  typedef enum _WrapperType {
588  } WrapperType;
589 
590 
597  PDFDoc();
598 
607  explicit PDFDoc(const char* path);
608 
617  explicit PDFDoc(const wchar_t* path);
618 
629  explicit PDFDoc(const void* buffer, size_t size);
630 
645  explicit PDFDoc(common::file::ReaderCallback* file_read, bool is_async = false);
646  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
647  explicit PDFDoc(FS_HANDLE handle);
649  ~PDFDoc();
650 
656  PDFDoc(const PDFDoc& other);
657 
665  PDFDoc& operator = (const PDFDoc& other);
673  bool operator == (const PDFDoc& other) const;
674 
682  bool operator != (const PDFDoc& other) const;
683 
691  bool IsEmpty() const;
692 
699 
719  bool IsLinearized() const;
720 
727  bool IsTaggedPDF() const;
728 
750  ErrorCode Load(const String& password = "");
751 
774  ErrorCode LoadW(const WString& password = WString());
775 
807  common::Progressive StartLoad(const String& password = "", bool is_cache_stream = true,
808  common::PauseCallback* pause = NULL);
840  common::Progressive StartLoadW(const WString& password = WString(), bool is_cache_stream = true,
841  common::PauseCallback* pause = NULL);
842 
852  int GetFirstAvailPageIndex() const;
853 
864  bool IsXFA() const;
865 
872  bool IsEncrypted() const;
873 
879  void ClearRenderCache();
880 
895 
903 
918  PasswordType CheckPassword(const String& password);
919 
934  PasswordType CheckPassword(const foxit::WString& password);
935 
944  bool IsUserPassword(const String& password);
945 
954  bool IsUserPassword(const foxit::WString& password);
955 
964  bool IsOwnerPassword(const String& password);
965 
974  bool IsOwnerPassword(const foxit::WString& password);
975 
985  String GetUserPassword(const String& owner_password);
986 #ifndef __EMSCRIPTEN_RENDER__
987 
995 
1004 
1013 
1022 
1035 #endif
1036 
1062  bool SaveAs(const char* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1063 
1090  bool SaveAs(const wchar_t* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1091 
1125  common::Progressive StartSaveAs(const char* file_path,
1126  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1127  common::PauseCallback* pause = NULL);
1128 
1162  common::Progressive StartSaveAs(const wchar_t* file_path,
1163  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1164  common::PauseCallback* pause = NULL);
1165 
1202 #ifndef __EMSCRIPTEN_RENDER__
1203 
1211 
1221 
1229  bool RemoveBookmark(const Bookmark& bookmark);
1230 #endif
1231 
1236  int GetPageCount() const;
1237 
1251  PDFPage GetPage(int index);
1252 
1261  DisplayMode GetDisplayMode() const;
1262 
1273  void SetDisplayMode(DisplayMode display_mode);
1274 
1281 
1288 
1297 
1304 
1311 
1320 
1338 
1346  void DeleteIndirectObject(uint32 object_number);
1347 
1354  uint32 GetUserPermissions() const;
1355 
1362  bool IsWrapper() const;
1363 
1370  WrapperType GetWrapperType() const;
1371 
1378  WrapperData GetWrapperData() const;
1379 
1386  int64 GetWrapperOffset() const;
1387 
1395 
1413 
1439  bool SaveAsWrapperFile(const wchar_t* file_path, const WrapperData* wrapper_data = NULL,
1440  uint32 user_permissions = 0xFFFFFFFC, const char* owner_password = "");
1441 
1469  common::Progressive StartSaveAsPayloadFile(const wchar_t* file_path, const wchar_t* payload_file_path,
1470  const wchar_t* crypto_filter, const wchar_t* description, float version,
1471  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1472  common::PauseCallback* pause = NULL);
1484  bool HasForm() const;
1485 
1492 #ifndef __EMSCRIPTEN_RENDER__
1493 
1502 
1516  ReadingBookmark InsertReadingBookmark(int reading_bookmark_index, const WString& title, int dest_page_index);
1517 
1525  bool RemoveReadingBookmark(const ReadingBookmark& reading_bookmark);
1526 
1532  int GetSignatureCount();
1533 
1543 
1551  void RemoveSignature(const foxit::pdf::Signature& signature);
1552 #endif
1553 
1565  PDFPage InsertPage(int index, float width, float height);
1579 
1588  bool RemovePage(int index);
1599  bool RemovePage(const foxit::pdf::PDFPage& page);
1600 
1616  bool MovePageTo(const PDFPage& page, int dest_index);
1617 
1638  bool MovePagesTo(const common::Range& page_range, int dest_index);
1639 
1693  const wchar_t* src_file_path, const String& password,
1694  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
1695  const common::Range& page_range = common::Range(),
1696  common::PauseCallback* pause = NULL);
1750  const wchar_t* src_file_path, const WString& password,
1751  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
1752  const common::Range& page_range = common::Range(),
1753  common::PauseCallback* pause = NULL);
1804  common::Progressive StartImportPages(int dest_index, const PDFDoc& src_doc,
1805  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
1806  const common::Range& page_range = common::Range(),
1807  common::PauseCallback* pause = NULL);
1808 
1831  common::Progressive StartExtractPages(const char* file_path, uint32 options, const common::Range& page_range = common::Range(),
1832  common::PauseCallback* pause = NULL);
1833 
1856  common::Progressive StartExtractPages(const wchar_t* file_path, uint32 options, const common::Range& page_range = common::Range(),
1857  common::PauseCallback* pause = NULL);
1858 
1884 
1901  void InsertDocument(int dest_index, const PDFDoc& src_doc, uint32 options);
1902 
1903 #ifndef __EMSCRIPTEN_RENDER__
1904 
1923  bool ImportFromFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
1924 
1944  bool ExportToFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
1945 
1954  bool ExportAnnotToFDF(const annots::Annot& pdf_annot,const fdf::FDFDoc& fdf_doc);
1955 #endif
1956 
1961  String GetHeader() const;
1962 
1968  int GetFileVersion();
1969 
1985  void SetFileVersion(int version);
1986 
1999  bool SetSecurityHandler(const SecurityHandler& handler);
2000 
2011 
2021  bool RemoveSecurity();
2022 
2030  int GetFontCount();
2031 
2040  common::Font GetFont(int index);
2041 
2048 
2060  bool SetOpenAction(actions::Action& action);
2061 
2067  bool RemoveOpenAction();
2068 
2074  bool DoJSOpenAction();
2075 
2081  bool IsPortfolio();
2082 
2097  PageBasicInfo GetPageBasicInfo(int index);
2098 
2099 #ifdef _SUPPORTWEBSDK_
2100  objects::PDFStream* CreateIcon(String imgStream,int width, int height);
2101 #endif
2102 
2109  void CreateDSS();
2110 
2111 };
2112 } // namespace pdf
2113 } // namespace foxit
2114 #endif // FS_PDFDOC_H_
2115 
PageBasicInfo GetPageBasicInfo(int index)
Get the basic information of a page specified by index.
ImportPageFlags
Enumeration for flags used for importing pages.
Definition: fs_pdfdoc.h:492
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.
Bookmark GetRootBookmark()
Get bookmark root node.
Operate text annotations and fill in interactive form fields. (Bit 6 in permission value)
Definition: fs_pdfdoc.h:419
Definition: fs_pdfobject.h:385
int version
Wrapper version.
Definition: fs_pdfdoc.h:127
If set, form fields are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:569
~PDFDoc()
Destructor.
int GetReadingBookmarkCount()
Get the count of reading bookmarks.
bool RemoveBookmark(const Bookmark &bookmark)
Remove a specified bookmark.
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:202
If set, annotations (except link annotations) are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:571
Bookmark CreateRootBookmark()
Create new bookmark root node.
bool SetSecurityHandler(const SecurityHandler &handler)
Set a PDF security handler for encryption, such as standard encryption(password), certificate encrypt...
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.
bool operator==(const PDFDoc &other) const
Equal operator.
Definition: fs_common.h:1157
file writing interface.
Definition: fx_stream.h:449
int GetFirstAvailPageIndex() const
Get the page index of the fist available page.
void ClearRenderCache()
Clear the cache used during rendering, to reduce the memory usage.
bool HasForm() const
Check whether current PDF document has interactive form (also known as AcroForm).
StdEncryptData GetStdEncryptData() const
Get encrypt data of standard encryption (known as password encryption).
ErrorCode Load(const String &password="")
Load current document content by using a specified password.
RMSEncryptData GetRMSEncryptData() const
Get encrypt data of RMS encryption.
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....
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
Save document normally, without using any special flag. This can only be used alone.
Definition: fs_pdfdoc.h:453
Extract PDF contents. (Bit 5 in permission value)
Definition: fs_pdfdoc.h:413
float version
The version number of the cryptographic filter used to encrypt the encrypted payload referenced by th...
Definition: fs_pdfdoc.h:213
Assemble PDF document. (Bit 11 in permission value)
Definition: fs_pdfdoc.h:438
Unknown rotation.
Definition: fs_common.h:285
Encryption type: password, which is the standard encryption.
Definition: fs_pdfdoc.h:376
bool ExportAnnotToFDF(const annots::Annot &pdf_annot, const fdf::FDFDoc &fdf_doc)
Export specified annotation to a FDF/XFDF document.
PayLoadData(const PayLoadData &payload_data)
Constructor, with another payload data object.
Definition: fs_pdfdoc.h:170
objects::PDFDictionary * GetTrailer() const
Get the trailer dictionary.
WrapperType
Enumeration for wrapper type.
Definition: fs_pdfdoc.h:581
Modify PDF contents. (Bit 4 in permission value)
Definition: fs_pdfdoc.h:407
SecurityHandler GetSecurityHandler()
Get current PDF security handler of current document.
bool SetOpenAction(actions::Action &action)
Set the action to be performed when the document is opened.
A user password is used in PDF document.
Definition: fs_pdfdoc.h:360
WString description
Description for payload file to show applications or confront users prompt information.
Definition: fs_pdfdoc.h:221
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.
PageBasicInfo()
Constructor.
Definition: fs_pdfdoc.h:244
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.
int64 GetWrapperOffset() const
Get wrapper offset if current document's wrapper type is PDFDoc::e_WrapperFoxit.
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).
bool MovePagesTo(const common::Range &page_range, int dest_index)
Move one or more pages (specified by index) to a new index position.
WString crypto_filter
The name of the cryptographic filter used to encrypt the encrypted payload document.
Definition: fs_pdfdoc.h:215
Header file for file operation related definitions and functions.
file reading interface.
Definition: fx_stream.h:555
Import pages with layers.
Definition: fs_pdfdoc.h:496
If set, that means structure tree will be extracted as well.
Definition: fs_pdfdoc.h:514
objects::PDFDictionary * GetCatalog() const
Get the catalog dictionary.
Encryption type: customized encryption.
Definition: fs_pdfdoc.h:382
WIDE STRING CLASS.
Definition: fx_string.h:1459
bool IsLinearized() const
Check if current PDF document is a linearized file.
WString description
Description for wrapper file to show applications or confront users prompt information.
Definition: fs_pdfdoc.h:135
Save document without original data or unchanged objects.
Definition: fs_pdfdoc.h:467
Save document incrementally.
Definition: fs_pdfdoc.h:460
bool IsWrapper() const
Check whether current document is a wrapper file or not.
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:221
void SetFileVersion(int version)
Set the PDF file version which will be stored in PDF header section of the saved PDF file.
int GetFileVersion()
Get PDF file version stored in PDF header section.
float height
Page height.
Definition: fs_pdfdoc.h:289
No password is used in PDF document.
Definition: fs_pdfdoc.h:358
PasswordType CheckPassword(const String &password)
Check the type of a specified password.
PasswordType GetPasswordType() const
Get the type of current used password.
FX_UINT64 uint64
Unsigned 64-bit integer.
Definition: fs_basictypes.h:194
uint32 GetUserPermissions() const
Get user access permissions.
If set, that means attachment files will be extracted as well.
Definition: fs_pdfdoc.h:525
Print PDF document with higher qualities. (Bit 12 in permission value)
Definition: fs_pdfdoc.h:444
Definition: fs_pdfdoc.h:139
Definition: fs_pdfdoc.h:347
Normal document.
Definition: fs_pdfdoc.h:583
Definition: fs_security.h:586
PayLoadData & operator=(const PayLoadData &payload_data)
Assign operator.
Definition: fs_pdfdoc.h:184
ReadingBookmark InsertReadingBookmark(int reading_bookmark_index, const WString &title, int dest_page_index)
Insert a reading bookmark to current PDF document.
bool IsEmpty() const
Check whether current object is empty or not.
int64 file_size
The payload file size.
Definition: fs_pdfdoc.h:219
(Reserved, not supported yet) If set, only link annotations are to imported from or exported to XFDF ...
Definition: fs_pdfdoc.h:573
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.
bool IsOwnerPassword(const String &password)
Check if input password is the owner password of current PDF document.
An owner password is used in PDF document.
Definition: fs_pdfdoc.h:362
ExtractPagesOptions
Enumeration for options used for extracting pages.
Definition: fs_pdfdoc.h:510
Header file for bookmark related definitions and classes.
PDFDoc()
Constructor.
Definition: fs_fdfdoc.h:51
objects::PDFDictionary * GetPagesDict() const
Get the dictionary of "Pages".
Definition: fs_security.h:973
Definition: fs_security.h:137
Import pages without cloning stream objects into memory.
Definition: fs_pdfdoc.h:502
common::Progressive StartGetPayloadFile(foxit::common::file::WriterCallback *payload_file, common::PauseCallback *pause=0)
Start to get payload file.
Header file for reading bookmark related definitions and classes.
bool DoJSOpenAction()
Perform JavaScript actions when the document is opened.
If set, that means OCProperties will be extracted as well.
Definition: fs_pdfdoc.h:518
int GetSignatureCount()
Get the count of signature.
uint64 GetFileSize()
Get file size.
Definition: fs_pdfdoc.h:228
SaveFlags
Enumeration for PDF document saving flags.
Definition: fs_pdfdoc.h:451
ErrorCode LoadW(const WString &password=WString())
Load current document content by using a specified password.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:236
PageBasicInfo(float width, float height, common::Rotation rotation)
Constructor, with parameters.
Definition: fs_pdfdoc.h:238
WString type
Wrapper type to indicate a type of the current wrapper file.
Definition: fs_pdfdoc.h:129
int GetFontCount()
Count all the PDF fonts used in current PDF document.
Import pages normally.
Definition: fs_pdfdoc.h:494
Definition: fs_pdfdoc.h:57
bool RemoveOpenAction()
Remove the action to be performed when the document is opened.
When document is opened, neither document outlines nor thumbnail images are visible.
Definition: fs_pdfdoc.h:545
DisplayMode
Enumeration for display mode which specifies how the document should be displayed when opened.
Definition: fs_pdfdoc.h:543
bool IsUserPassword(const String &password)
Check if input password is the user password of current PDF document.
float width
Page width.
Definition: fs_pdfdoc.h:287
EncryptType GetEncryptionType() const
Get the encryption type.
objects::PDFDictionary * GetEncryptDict() const
Get the encrypt dictionary.
Size
Enumeration for page size type.
Definition: fs_pdfpage.h:391
WString file_name
The payload file name.
Definition: fs_pdfdoc.h:217
Definition: fx_basic.h:3736
objects::PDFDictionary * GetInfo() const
Get the information dictionary.
bool IsXFA() const
Check whether current PDF document is an XFA document.
When document is opened, full-screen mode, with no menu bar, window controls, or any other windows ar...
Definition: fs_pdfdoc.h:554
Print PDF document with normal mode. (Bit 3 in permission value)
Definition: fs_pdfdoc.h:400
(Reserved, currently, this value is not used.) Encryption type: Foxit connected PDF DRM encryption.
Definition: fs_pdfdoc.h:386
Save document as a linearized file.
Definition: fs_pdfdoc.h:478
When document is opened, document outlines (bookmarks) are visible.
Definition: fs_pdfdoc.h:547
bool IsPortfolio()
Check whether current PDF document is a portfolio file or not.
PasswordType
Enumeration for the type of current used password in a PDF document.
Definition: fs_pdfdoc.h:354
When document is opened, optional content group panels are visible.
Definition: fs_pdfdoc.h:556
Definition: fs_common.h:465
FX_INT64 int64
Signed 64-bit integer.
Definition: fs_basictypes.h:192
CustomEncryptData GetCustomEncryptData() const
Get encrypt data of custom encryption.
If set, that means annotations related to extracted pages will be extracted as well.
Definition: fs_pdfdoc.h:512
InsertDocOptions
Enumeration for options used for inserting a PDF document to another.
Definition: fs_pdfdoc.h:533
Disabilities support. (Bit 10 in permission value)
Definition: fs_pdfdoc.h:431
DataType
Enumeration for data type used to decide which object(s) will be imported from or exported to FDF/XFD...
Definition: fs_pdfdoc.h:567
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
void SetDisplayMode(DisplayMode display_mode)
Set the display mode.
Save document with removing redundant PDF objects.
Definition: fs_pdfdoc.h:484
bool operator!=(const PDFDoc &other) const
Not equal operator.
Definition: fs_pdfpage.h:313
bool RemoveReadingBookmark(const ReadingBookmark &reading_bookmark)
Remove a reading bookmark from current PDF document.
Encryption type: digital certificate encryption.
Definition: fs_pdfdoc.h:378
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
WrapperType GetWrapperType() const
Get Wrapper type.
Header file for common definitions and classes.
When document is opened, attachment panels are visible.
Definition: fs_pdfdoc.h:558
ReadingBookmark GetReadingBookmark(int index)
Get a reading bookmark by index.
No encryption pattern.
Definition: fs_pdfdoc.h:374
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:118
The password is invalid.
Definition: fs_pdfdoc.h:356
PDFDoc & operator=(const PDFDoc &other)
Assign operator.
void DeleteIndirectObject(uint32 object_number)
Delete an indirect object by indirect object number.
Definition: fs_security.h:833
objects::PDFObject * GetIndirectObject(uint32 object_number)
Get an indirect object by indirect object number.
WString uri
The URI for consumers to get more information.
Definition: fs_pdfdoc.h:133
Header file for PDF object related definitions and classes.
Encryption type: Microsoft RMS encryption.
Definition: fs_pdfdoc.h:384
Definition: fs_basictypes.h:375
If set, that means attachments will be inserted to target document as well.
Definition: fs_pdfdoc.h:535
DisplayMode GetDisplayMode() const
Get the display mode.
String GetHeader() const
Get PDF header identifying the version of the PDF specification to which the file conforms.
common::Font GetFont(int index)
Get a font by index.
Fill PDF form. (Bit 9 in permission value)
Definition: fs_pdfdoc.h:425
int GetPageCount() const
Get the count of pages.
Header file for PDF page related definitions and classes.
PDFPage GetPage(int index)
Get a PDF page by index.
bool RemoveSecurity()
Remove the security handler from current document, so that the later saved document will be unencrypt...
CertificateEncryptData GetCertificateEncryptData() const
Get encrypt data of certificate encryption.
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:72
Definition: fs_annot.h:749
PDFPage InsertPage(int index, float width, float height)
Insert a new blank PDF page to document, by index.
Save document by using XRef stream.
Definition: fs_pdfdoc.h:472
Definition: fs_security.h:56
Definition: fs_common.h:1312
Definition: fs_pdfobject.h:763
bool IsEncrypted() const
Check whether current document is an encrypted file or not.
String GetUserPassword(const String &owner_password)
Get the user password based on owner password.
If set, that means to use PDFDoc::e_SaveFlagXRefStream saving flag for the result file in order to re...
Definition: fs_pdfdoc.h:523
actions::Action GetOpenAction()
Get the action to be performed when the document is opened.
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:155
bool SaveAs(const char *file_path, uint32 save_flags=PDFDoc::e_SaveFlagNormal)
Save current PDF document as another PDF file.
Rotation
Enumeration for rotation.
Definition: fs_common.h:275
Foxit namespace.
Definition: fs_compare.h:27
Definition: fs_pdfobject.h:55
WrapperData & operator=(const WrapperData &wrapper_data)
Assign operator.
Definition: fs_pdfdoc.h:98
DRMEncryptData GetDRMEncryptData() const
Get encrypt data of Foxit DRM encryption.
Definition: fs_action.h:418
WString app_id
Application identity to indicate applications to open this wrapper data.
Definition: fs_pdfdoc.h:131
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.
If set, that means Javascript will be extracted as well.
Definition: fs_pdfdoc.h:516
BYTE STRING CLASS.
Definition: fx_string.h:317
Unknown encryption type.
Definition: fs_pdfdoc.h:372
EncryptType
Enumeration for encryption type.
Definition: fs_pdfdoc.h:370
void CreateDSS()
Create DSS information in current PDF document.
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.
bool IsTaggedPDF() const
Check if current PDF document is a Tagged PDF file.
PDF 2.0 wrapper document.
Definition: fs_pdfdoc.h:587
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:294
When document is opened, thumbnail images are visible.
Definition: fs_pdfdoc.h:549
void InsertDocument(int dest_index, const PDFDoc &src_doc, uint32 options)
Insert another PDF document to the specified location of current PDF document.
#define NULL
The null-pointer value.
Definition: fx_system.h:771
Definition: fs_signature.h:93
Page size: letter.
Definition: fs_pdfpage.h:393
void RemoveSignature(const foxit::pdf::Signature &signature)
Remove a signature.
PayLoadData()
Constructor.
Definition: fs_pdfdoc.h:142
Encryption type: Foxit DRM encryption.
Definition: fs_pdfdoc.h:380
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).
WrapperData GetWrapperData() const
Get wrapper data if current document's wrapper type is PDFDoc::e_WrapperFoxit.
PageBasicInfo & operator=(const PageBasicInfo &page_info)
Assign operator.
Definition: fs_pdfdoc.h:264
PageBasicInfo(const PageBasicInfo &page_info)
Constructor, with another page basic information object.
Definition: fs_pdfdoc.h:253
foxit::pdf::Signature GetSignature(int index)
Get a signature by index.
Definition: fs_security.h:368
bool RemovePage(int index)
Remove a PDF page by page index.
WrapperData()
Constructor.
Definition: fs_pdfdoc.h:60
Definition: fs_bookmark.h:58
void Set(float width, float height, common::Rotation rotation)
Set value.
Definition: fs_pdfdoc.h:280
Definition: fs_readingbookmark.h:43
UserPermissions
Enumeration for user access permissions in a PDF document.
Definition: fs_pdfdoc.h:394
WrapperData(const WrapperData &wrapper_data)
Constructor, with another wrapper data object.
Definition: fs_pdfdoc.h:84
Foxit wrapper document.
Definition: fs_pdfdoc.h:585
PayLoadData GetPayLoadData()
Get payload data if current document's wrapper type is PDFDoc::e_WrapperPDFV2.
uint32 AddIndirectObject(objects::PDFObject *pdf_object)
Add a PDF object to current PDF document, to be an indirect object.
bool MovePageTo(const PDFPage &page, int dest_index)
Move a specified page to a new index position.