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 class PagingSealSignature;
57 class WatermarkTextProperties;
59 class TiledWatermarkSettings FS_FINAL : public Object{
60  public:
74  explicit TiledWatermarkSettings(float row_space, float col_space, float rotation, int opacity ,int scale)
78  , opacity(opacity)
79  , scale(scale) {}
80 
89  : row_space(2.0)
90  , col_space(2.0)
91  , rotation(0)
92  , opacity(100)
93  , scale(100) {}
94 
101  : row_space(settings.row_space)
102  , col_space(settings.col_space)
103  , rotation(settings.rotation)
104  , opacity(settings.opacity)
105  , scale(settings.scale) {}
106 
115  row_space = settings.row_space;
116  col_space = settings.col_space;
117  rotation = settings.rotation;
118  opacity = settings.opacity;
119  scale = settings.scale;
120  return *this;
121  }
122 
137  void Set(float row_space, float col_space, float rotation, int opacity, int scale) {
138  this->row_space = row_space;
139  this->col_space = col_space;
140  this->rotation = rotation;
141  this->opacity = opacity;
142  this->scale = scale;
143  }
144 
146  float row_space;
148  float col_space;
150  float rotation;
155  int opacity;
160  int scale;
161 };
163 class WrapperData FS_FINAL : public Object {
164  public:
167  : version(0) {}
168 
178  WrapperData(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description)
179  : version(version)
180  , type(type)
181  , app_id(app_id)
182  , uri(uri)
184 
190  WrapperData(const WrapperData& wrapper_data)
191  : version(wrapper_data.version)
192  , type(wrapper_data.type)
193  , app_id(wrapper_data.app_id)
194  , uri(wrapper_data.uri)
195  , description(wrapper_data.description) {}
196 
204  WrapperData& operator = (const WrapperData& wrapper_data) {
205  version = wrapper_data.version;
206  type = wrapper_data.type;
207  app_id = wrapper_data.app_id;
208  uri = wrapper_data.uri;
209  description = wrapper_data.description;
210  return *this;
211  }
212 
224  void Set(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description) {
225  this->version = version;
226  this->type = type;
227  this->app_id = app_id;
228  this->uri = uri;
229  this->description = description;
230  }
231 
233  int version;
242 };
243 
245 class PayLoadData FS_FINAL {
246  public:
249  : version(0.0f)
250  , file_size (0){}
251 
261  PayLoadData(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
263  const wchar_t* description)
264  : version(version)
269  {}
270 
276  PayLoadData(const PayLoadData& payload_data)
277  : version(payload_data.version)
278  , crypto_filter(payload_data.crypto_filter)
279  , file_name(payload_data.file_name)
280  , file_size(payload_data.file_size)
281  , description(payload_data.description)
282  {}
283 
291  PayLoadData& operator=(const PayLoadData& payload_data) {
292  version = payload_data.version;
293  crypto_filter = payload_data.crypto_filter;
294  description = payload_data.description;
295  file_name = payload_data.file_name;
296  file_size = payload_data.file_size;
297  return *this;
298  }
299 
309  void Set(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
311  const wchar_t* description) {
312  this->version = version;
313  this->crypto_filter = crypto_filter;
314  this->file_name = file_name;
315  this->file_size = file_size;
316  this->description = description;
317  }
318 
320  float version;
329 };
330 
335 class PageBasicInfo FS_FINAL : public Object {
336  public:
346  : width(width)
347  , height(height)
348  , rotation(rotation) {}
349 
352  : width(0)
353  , height(0)
354  , rotation(CommonDefines::e_RotationUnknown) {}
360  PageBasicInfo(const PageBasicInfo& page_info)
361  : width(page_info.width)
362  , height(page_info.height)
363  , rotation(page_info.rotation) {}
372  width = page_info.width;
373  height = page_info.height;
374  rotation = page_info.rotation;
375  return *this;
376  }
387  void Set(float width, float height, common::Rotation rotation) {
388  this->width = width;
389  this->height = height;
390  this->rotation = rotation;
391  }
392 
394  float width;
395 
397  float height;
403 };
404 
409 class EmbeddedFontData FS_FINAL : public Object {
410  public:
413 
422 
433  return *this;
434  }
435 
440 };
441 
443 class TableOfContentsConfig FS_FINAL : public Object{
444  public:
455  : title(title)
459 
462  : title(L"")
464  , is_show_serial_number(false)
465  , include_toc_pages(false){}
466 
469 
478  this->title = other.title;
481  this->include_toc_pages = other.include_toc_pages;
482  return *this;
483  }
484 
492  bool operator == (const TableOfContentsConfig& other) const {
493  if (this->title == other.title && this->is_show_serial_number == other.is_show_serial_number && this->include_toc_pages == other.include_toc_pages) {
495  return false;
496  for (int i = 0; i < this->bookmark_level_array.GetSize(); i++) {
497  if (this->bookmark_level_array.GetAt(i) != other.bookmark_level_array.GetAt(i))
498  return false;
499  }
500  return true;
501  }
502  return false;
503  }
504 
512  bool operator != (const TableOfContentsConfig& other) const {
513  if (this->title != other.title || this->is_show_serial_number != other.is_show_serial_number || this->include_toc_pages != other.include_toc_pages)
514  return true;
516  return true;
517  for (int i = 0; i < this->bookmark_level_array.GetSize(); i++) {
518  if (this->bookmark_level_array.GetAt(i) != other.bookmark_level_array.GetAt(i))
519  return true;
520  }
521  return false;
522  }
523 
536  this->title = title;
537  this->bookmark_level_array = bookmark_level_array;
538  this->is_show_serial_number = is_show_serial_number;
539  this->include_toc_pages = include_toc_pages;
540  }
541 
558 };
559 
613 class PDFDoc FS_FINAL : public Base {
614  public:
620  typedef enum _PasswordType {
629  } PasswordType;
630 
636  typedef enum _EncryptType {
653  } EncryptType;
654 
660  typedef enum _UserPermissions {
666  e_PermPrint = 0x0004,
673  e_PermModify = 0x0008,
679  e_PermExtract = 0x0010,
685  e_PermAnnotForm = 0x0020,
691  e_PermFillForm = 0x0100,
704  e_PermAssemble = 0x0400,
711  } UserPermissions;
712 
717  typedef enum _SaveFlags {
765  } SaveFlags;
766 
772  typedef enum _ImportPageFlags {
783  } ImportPageFlags;
784 
790  typedef enum _ExtractPagesOptions {
807 
813  typedef enum _InsertDocOptions {
817 
823  typedef enum _DisplayMode {
839  } DisplayMode;
840 
847  typedef enum _DataType {
849  e_Forms = 0x0001,
851  e_Annots = 0x0002,
853  e_Links = 0x0004
854  } DataType;
855 
861  typedef enum _WrapperType {
868  } WrapperType;
869 
870 
877  PDFDoc();
878 
887  explicit PDFDoc(const char* path);
888 
897  explicit PDFDoc(const wchar_t* path);
898 
909  explicit PDFDoc(const void* buffer, size_t size);
910 
925  explicit PDFDoc(common::file::ReaderCallback* file_read, bool is_async = false);
926  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
927  explicit PDFDoc(FS_HANDLE handle);
929  ~PDFDoc();
930 
936  PDFDoc(const PDFDoc& other);
937 
945  PDFDoc& operator = (const PDFDoc& other);
953  bool operator == (const PDFDoc& other) const;
954 
962  bool operator != (const PDFDoc& other) const;
963 
971  bool IsEmpty() const;
972 
979 
999  bool IsLinearized() const;
1000 
1007  bool IsTaggedPDF() const;
1008 
1030  ErrorCode Load(const String& password = "");
1031 
1054  ErrorCode LoadW(const WString& password = WString());
1055 
1087  common::Progressive StartLoad(const String& password = "", bool is_cache_stream = true,
1088  common::PauseCallback* pause = NULL);
1120  common::Progressive StartLoadW(const WString& password = WString(), bool is_cache_stream = true,
1121  common::PauseCallback* pause = NULL);
1122 
1132  int GetFirstAvailPageIndex() const;
1133 
1144  bool IsXFA() const;
1145 
1152  bool IsEncrypted() const;
1153 
1159  void ClearRenderCache();
1160 
1174  PasswordType GetPasswordType() const;
1175 
1183 
1198  PasswordType CheckPassword(const String& password);
1199 
1214  PasswordType CheckPassword(const foxit::WString& password);
1215 
1224  bool IsUserPassword(const String& password);
1225 
1234  bool IsUserPassword(const foxit::WString& password);
1235 
1244  bool IsOwnerPassword(const String& password);
1245 
1254  bool IsOwnerPassword(const foxit::WString& password);
1255 
1265  String GetUserPassword(const String& owner_password);
1266 #ifndef __EMSCRIPTEN_RENDER__
1267 
1275 
1284 
1293 
1302 
1315 #endif
1316 
1342  bool SaveAs(const char* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1343 
1370  bool SaveAs(const wchar_t* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1371 
1405  common::Progressive StartSaveAs(const char* file_path,
1406  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1407  common::PauseCallback* pause = NULL);
1408 
1442  common::Progressive StartSaveAs(const wchar_t* file_path,
1443  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1444  common::PauseCallback* pause = NULL);
1445 
1482 #ifndef __EMSCRIPTEN_RENDER__
1483 
1491 
1501 
1508  int GetBookmarkLevelDepth();
1509 
1517  bool RemoveBookmark(const Bookmark& bookmark);
1518 
1525  bool HasLayer() const;
1526 
1533  bool HasHeaderFooter();
1534 
1544 
1555  void AddHeaderFooter(const HeaderFooter& headerfooter);
1556 
1567  void UpdateHeaderFooter(const HeaderFooter& headerfooter);
1568 
1574  bool RemoveAllHeaderFooters();
1575 #endif
1576 
1581  int GetPageCount() const;
1582 
1596  PDFPage GetPage(int index);
1597 
1606  DisplayMode GetDisplayMode() const;
1607 
1618  void SetDisplayMode(DisplayMode display_mode);
1619 
1627 
1635 
1645 
1653 
1661 
1670 
1688 
1696  void DeleteIndirectObject(uint32 object_number);
1697 
1704  uint32 GetUserPermissions() const;
1705 
1712  bool IsWrapper() const;
1713 
1720  WrapperType GetWrapperType() const;
1721 
1728  WrapperData GetWrapperData() const;
1729 
1736  int64 GetWrapperOffset() const;
1737 
1745 
1763 
1789  bool SaveAsWrapperFile(const wchar_t* file_path, const WrapperData* wrapper_data = NULL,
1790  uint32 user_permissions = 0xFFFFFFFC, const char* owner_password = "");
1791 
1819  common::Progressive StartSaveAsPayloadFile(const wchar_t* file_path, const wchar_t* payload_file_path,
1820  const wchar_t* crypto_filter, const wchar_t* description, float version,
1821  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1822  common::PauseCallback* pause = NULL);
1834  bool HasForm() const;
1835 
1842 #ifndef __EMSCRIPTEN_RENDER__
1843 
1852 
1866  ReadingBookmark InsertReadingBookmark(int reading_bookmark_index, const WString& title, int dest_page_index);
1867 
1875  bool RemoveReadingBookmark(const ReadingBookmark& reading_bookmark);
1876 
1882  int GetSignatureCount();
1883 
1893 
1903  void RemoveSignature(const foxit::pdf::Signature& signature);
1904 #endif
1905 
1917  PDFPage InsertPage(int index, float width, float height);
1931 
1950  PDFPage AddPageFromTemplate(const wchar_t* template_name);
1951 
1967  bool HidePageTemplate(const wchar_t* template_name);
1968 
1977  bool RemovePage(int index);
1988  bool RemovePage(const foxit::pdf::PDFPage& page);
1989 
2005  bool MovePageTo(const PDFPage& page, int dest_index);
2006 
2027  bool MovePagesTo(const common::Range& page_range, int dest_index);
2028 
2082  const wchar_t* src_file_path, const String& password,
2083  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
2084  const common::Range& page_range = common::Range(),
2085  common::PauseCallback* pause = NULL);
2138  const wchar_t* src_file_path, const WString& password,
2139  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
2140  const common::Range& page_range = common::Range(),
2141  common::PauseCallback* pause = NULL);
2191  common::Progressive StartImportPages(int dest_index, const PDFDoc& src_doc,
2192  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
2193  const common::Range& page_range = common::Range(),
2194  common::PauseCallback* pause = NULL);
2195 
2218  common::Progressive StartExtractPages(const char* file_path, uint32 options, const common::Range& page_range = common::Range(),
2219  common::PauseCallback* pause = NULL);
2220 
2243  common::Progressive StartExtractPages(const wchar_t* file_path, uint32 options, const common::Range& page_range = common::Range(),
2244  common::PauseCallback* pause = NULL);
2245 
2271 
2288  void InsertDocument(int dest_index, const PDFDoc& src_doc, uint32 options);
2289 
2290 #ifndef __EMSCRIPTEN_RENDER__
2291 
2314  bool ImportFromFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
2315 
2335  bool ExportToFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
2336 
2345  bool ExportAnnotToFDF(const annots::Annot& pdf_annot,const fdf::FDFDoc& fdf_doc);
2346 
2359  bool ExportFormFieldsToFDF(const pdf::interform::FieldArray& field_array, bool is_include, const fdf::FDFDoc& fdf_doc);
2360 #endif
2361 
2366  String GetHeader() const;
2367 
2373  int GetFileVersion();
2374 
2390  void SetFileVersion(int version);
2391 
2404  bool SetSecurityHandler(const SecurityHandler& handler);
2405 
2416 
2426  bool RemoveSecurity();
2427 
2435  int GetFontCount();
2436 
2445  common::Font GetFont(int index);
2446 
2453 
2465  bool SetOpenAction(actions::Action& action);
2466 
2472  bool RemoveOpenAction();
2473 
2479  bool DoJSOpenAction();
2480 
2486  bool IsPortfolio();
2487 
2502  PageBasicInfo GetPageBasicInfo(int index);
2503 
2510 
2511 #ifdef _SUPPORTWEBSDK_
2512  objects::PDFStream* CreateIcon(String imgStream,int width, int height);
2513 #endif
2514 
2521  void CreateDSS();
2522 
2538  void AddTableOfContents(const wchar_t* title, Int32Array bookmark_level_array);
2539 
2549  void AddTableOfContents(const TableOfContentsConfig& table_of_contents_config);
2550 
2567  void SetCacheFile(foxit::common::file::StreamCallback* file_stream, bool is_own_file_stream);
2568 
2585 
2594  WString GetPageText(int page_index) const;
2595 
2611  PagingSealSignature AddPagingSealSignature(const common::Range& page_range, float width, float height);
2612 
2661  common::Progressive StartAddTiledWatermark(const wchar_t* text, const TiledWatermarkSettings& settings, const WatermarkTextProperties& properties, const common::Range& page_range, common::PauseCallback* pause = NULL);
2689  common::Progressive StartAddTiledWatermark(const wchar_t* src_img_file_path, const TiledWatermarkSettings& settings, const common::Range& page_range, common::PauseCallback* pause = NULL);
2690 
2747 
2748 };
2749 } // namespace pdf
2750 } // namespace foxit
2751 #endif // FS_PDFDOC_H_
2752 
bool include_toc_pages
true means to include catalog page(s) in the calculation of pages number in the table of contents,...
Definition: fs_pdfdoc.h:557
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:772
TiledWatermarkSettings(const TiledWatermarkSettings &settings)
Constructor, with another tiled watermark settings object.
Definition: fs_pdfdoc.h:100
common::Progressive StartRecognizeForm(common::PauseCallback *pause=0)
Start to recognize form in current PDF document.
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:685
Definition: fs_pdfobject.h:422
int version
Wrapper version.
Definition: fs_pdfdoc.h:233
If set, form fields are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:849
~PDFDoc()
Destructor.
int GetReadingBookmarkCount()
Get the count of reading bookmarks.
bool RemoveBookmark(const Bookmark &bookmark)
Remove a specified bookmark.
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:439
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:309
If set, annotations (except link annotations) are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:851
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.
TiledWatermarkSettings()
Constructor and set the default value.
Definition: fs_pdfdoc.h:88
Definition: fs_common.h:1189
File writing interface.
Definition: fx_stream.h:451
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).
TableOfContentsConfig(const wchar_t *title, Int32Array bookmark_level_array, bool is_show_serial_number, bool include_toc_pages)
Constructor, with parameter.
Definition: fs_pdfdoc.h:454
ErrorCode Load(const String &password="")
Load current document content by using a specified password.
Definition: fs_pdfdoc.h:59
bool is_show_serial_number
true means to show the serial number in the table of contents, while false means not to show the seri...
Definition: fs_pdfdoc.h:552
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:217
Save document normally, without using any special flag.
Definition: fs_pdfdoc.h:722
Extract PDF contents. (Bit 5 in permission value)
Definition: fs_pdfdoc.h:679
TiledWatermarkSettings(float row_space, float col_space, float rotation, int opacity, int scale)
Constructor, with parameters.
Definition: fs_pdfdoc.h:74
bool HidePageTemplate(const wchar_t *template_name)
Hide a named page.
float version
The version number of the cryptographic filter used to encrypt the encrypted payload referenced by th...
Definition: fs_pdfdoc.h:320
Assemble PDF document. (Bit 11 in permission value)
Definition: fs_pdfdoc.h:704
Unknown rotation.
Definition: fs_common.h:67
Encryption type: password, which is the standard encryption.
Definition: fs_pdfdoc.h:642
Header file for header-footer related definitions and classes.
bool operator==(const TableOfContentsConfig &other) const
Equal operator.
Definition: fs_pdfdoc.h:492
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:276
objects::PDFDictionary * GetTrailer() const
Get the trailer dictionary.
WrapperType
Enumeration for wrapper type.
Definition: fs_pdfdoc.h:861
Modify PDF contents. (Bit 4 in permission value)
Definition: fs_pdfdoc.h:673
SecurityHandler GetSecurityHandler()
Get current PDF security handler of current document.
Int32Array bookmark_level_array
A bookmark level array which is used to specify bookmarks to be used to generate "Table of Contents"....
Definition: fs_pdfdoc.h:550
float row_space
The row spacing for multiple lines of tiled watermark. Its unit is inch and it can't be a negative nu...
Definition: fs_pdfdoc.h:146
Definition: fs_basictypes.h:224
bool SetOpenAction(actions::Action &action)
Set the action to be performed when the document is opened.
Definition: fs_pdfdoc.h:409
A user password is used in PDF document.
Definition: fs_pdfdoc.h:626
WString description
Description for payload file to show applications or confront users prompt information.
Definition: fs_pdfdoc.h:328
Save document without updating metadata "ModDate" and "CreationDate".
Definition: fs_pdfdoc.h:764
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:351
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.
int GetSize() const
Get the number of elements in the array.
Definition: fx_basic.h:1360
WString crypto_filter
The name of the cryptographic filter used to encrypt the encrypted payload document.
Definition: fs_pdfdoc.h:322
Header file for file operation related definitions and functions.
bool operator !=(const TableOfContentsConfig &other) const
Not equal operator.
Definition: fs_pdfdoc.h:512
File reading interface.
Definition: fx_stream.h:566
void UpdateHeaderFooter(const HeaderFooter &headerfooter)
Update header-footer.
Import pages with layers.
Definition: fs_pdfdoc.h:776
If set, that means structure tree will be extracted as well.
Definition: fs_pdfdoc.h:794
objects::PDFDictionary * GetCatalog() const
Get the catalog dictionary.
Encryption type: customized encryption.
Definition: fs_pdfdoc.h:648
WIDE STRING CLASS.
Definition: fx_string.h:1452
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:241
Save document without original data or unchanged objects.
Definition: fs_pdfdoc.h:738
Save document incrementally.
Definition: fs_pdfdoc.h:730
bool IsWrapper() const
Check whether current document is a wrapper file or not.
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:219
void SetFileVersion(int version)
Set the PDF file version which will be stored in PDF header section of the saved PDF file.
bool ExportFormFieldsToFDF(const pdf::interform::FieldArray &field_array, bool is_include, const fdf::FDFDoc &fdf_doc)
Export specified form fields to a FDF/XFDF document.
int GetFileVersion()
Get PDF file version stored in PDF header section.
float height
Page height (unit is 1/72 inch).
Definition: fs_pdfdoc.h:397
No password is used in PDF document.
Definition: fs_pdfdoc.h:624
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:192
uint32 GetUserPermissions() const
Get user access permissions.
HeaderFooter GetEditableHeaderFooter()
Get the editable header footer object.
If set, that means attachment files will be extracted as well.
Definition: fs_pdfdoc.h:805
Print PDF document with higher qualities. (Bit 12 in permission value)
Definition: fs_pdfdoc.h:710
Definition: fs_pdfdoc.h:245
Definition: fs_pdfdoc.h:613
Normal document.
Definition: fs_pdfdoc.h:863
Definition: fs_security.h:586
PayLoadData & operator=(const PayLoadData &payload_data)
Assign operator.
Definition: fs_pdfdoc.h:291
ReadingBookmark InsertReadingBookmark(int reading_bookmark_index, const WString &title, int dest_page_index)
Insert a reading bookmark to current PDF document.
int GetBookmarkLevelDepth()
Get bookmark level depth.
bool IsEmpty() const
Check whether current object is empty or not.
~TableOfContentsConfig()
Destructor.
Definition: fs_pdfdoc.h:468
bool RemoveAllHeaderFooters()
Remove all header-footers.
int64 file_size
The payload file size.
Definition: fs_pdfdoc.h:326
(Reserved, not supported yet) If set, only link annotations are to imported from or exported to XFDF ...
Definition: fs_pdfdoc.h:853
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.
Definition: fs_watermark.h:333
An owner password is used in PDF document.
Definition: fs_pdfdoc.h:628
ExtractPagesOptions
Enumeration for options used for extracting pages.
Definition: fs_pdfdoc.h:790
Header file for bookmark related definitions and classes.
PDFDoc()
Constructor.
Definition: fs_fdfdoc.h:51
objects::PDFDictionary * GetPagesDict() const
Get the dictionary of "Pages".
PagingSealSignature AddPagingSealSignature(const common::Range &page_range, float width, float height)
Add a paging seal signature to document by page range.
Definition: fs_security.h:973
EmbeddedFontData(const EmbeddedFontData &other)
Constructor, with another embedded font data object.
Definition: fs_pdfdoc.h:419
Definition: fs_security.h:137
Import pages without cloning stream objects into memory.
Definition: fs_pdfdoc.h:782
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:798
int GetSignatureCount()
Get the count of signature.
uint64 GetFileSize()
Get file size.
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:437
Definition: fs_signature.h:2072
Definition: fs_pdfdoc.h:335
SaveFlags
Enumeration for PDF document saving flags.
Definition: fs_pdfdoc.h:717
ErrorCode LoadW(const WString &password=WString())
Load current document content by using a specified password.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:233
PageBasicInfo(float width, float height, common::Rotation rotation)
Constructor, with parameters.
Definition: fs_pdfdoc.h:345
WString type
Wrapper type to indicate a type of the current wrapper file.
Definition: fs_pdfdoc.h:235
int scale
The image or page scale in percents. Valid range: from 0 to 100. 0 means not displayed,...
Definition: fs_pdfdoc.h:160
EmbeddedFontData & operator=(const EmbeddedFontData &other)
Assign operator.
Definition: fs_pdfdoc.h:430
EmbeddedFontData()
Constructor.
Definition: fs_pdfdoc.h:412
int GetFontCount()
Count all the PDF fonts used in current PDF document.
common::Progressive StartAddTiledWatermark(const wchar_t *text, const TiledWatermarkSettings &settings, const WatermarkTextProperties &properties, const common::Range &page_range, common::PauseCallback *pause=0)
Add text type tiled watermark to PDF pages.
Import pages normally.
Definition: fs_pdfdoc.h:774
Definition: fs_pdfdoc.h:163
File stream interface, reading & writing.
Definition: fx_stream.h:669
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:825
DisplayMode
Enumeration for display mode which specifies how the document should be displayed when opened.
Definition: fs_pdfdoc.h:823
bool IsUserPassword(const String &password)
Check if input password is the user password of current PDF document.
float width
Page width (unit is 1/72 inch).
Definition: fs_pdfdoc.h:394
TiledWatermarkSettings & operator=(const TiledWatermarkSettings &settings)
Assign operator.
Definition: fs_pdfdoc.h:114
void Set(const wchar_t *title, Int32Array bookmark_level_array, bool is_show_serial_number, bool include_toc_pages)
Set value.
Definition: fs_pdfdoc.h:535
EncryptType GetEncryptionType() const
Get the encryption type.
bool HasLayer() const
Check whether current PDF document has layer (known as "Optional content group" in <PDF reference 1....
objects::PDFDictionary * GetEncryptDict() const
Get the encrypt dictionary.
common::Progressive StartEmbedAllFonts(common::PauseCallback *pause=0)
Start to convert all un-embeded fonts to embeded fonts.
WString GetPageText(int page_index) const
Get the specified PDF page text which the text is in display order.
Size
Enumeration for page size type.
Definition: fs_pdfpage.h:489
WString file_name
The payload file name.
Definition: fs_pdfdoc.h:324
Definition: fx_basic.h:3761
objects::PDFDictionary * GetInfo() const
Get the information dictionary.
bool IsXFA() const
Check whether current PDF document is an XFA document.
float rotation
Rotation angle in degrees.
Definition: fs_pdfdoc.h:150
When document is opened, full-screen mode, with no menu bar, window controls, or any other windows ar...
Definition: fs_pdfdoc.h:834
Print PDF document with normal mode. (Bit 3 in permission value)
Definition: fs_pdfdoc.h:666
(Reserved, currently, this value is not used.) Encryption type: Foxit connected PDF DRM encryption.
Definition: fs_pdfdoc.h:652
Save document as a linearized file.
Definition: fs_pdfdoc.h:750
When document is opened, document outlines (bookmarks) are visible.
Definition: fs_pdfdoc.h:827
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:620
When document is opened, optional content group panels are visible.
Definition: fs_pdfdoc.h:836
Definition: fs_common.h:342
PDFPage AddPageFromTemplate(const wchar_t *template_name)
Adds a new PDF page to document, from a named template.
FX_INT64 int64
Signed 64-bit integer.
Definition: fs_basictypes.h:190
const TYPE GetAt(int nIndex) const
This method retrieves an element specified by an index number.
Definition: fx_basic.h:1396
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:792
InsertDocOptions
Enumeration for options used for inserting a PDF document to another.
Definition: fs_pdfdoc.h:813
Disabilities support. (Bit 10 in permission value)
Definition: fs_pdfdoc.h:697
DataType
Enumeration for data type used to decide which object(s) will be imported from or exported to FDF/XFD...
Definition: fs_pdfdoc.h:847
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:196
void SetDisplayMode(DisplayMode display_mode)
Set the display mode.
Save document with removing redundant PDF objects.
Definition: fs_pdfdoc.h:757
Definition: fs_pdfpage.h:411
bool RemoveReadingBookmark(const ReadingBookmark &reading_bookmark)
Remove a reading bookmark from current PDF document.
Encryption type: digital certificate encryption.
Definition: fs_pdfdoc.h:644
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
WrapperType GetWrapperType() const
Get Wrapper type.
EmbeddedFontData GetEmbeddedFontData()
Get embedded font data.
Header file for common definitions and classes.
When document is opened, attachment panels are visible.
Definition: fs_pdfdoc.h:838
ReadingBookmark GetReadingBookmark(int index)
Get a reading bookmark by index.
No encryption pattern.
Definition: fs_pdfdoc.h:640
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:224
The password is invalid.
Definition: fs_pdfdoc.h:622
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
bool operator !=(const PDFDoc &other) const
Not equal operator.
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:239
float col_space
The column spacing for multiple lines of tiled watermark. Its unit is inch and it can't be a negative...
Definition: fs_pdfdoc.h:148
Header file for PDF object related definitions and classes.
Encryption type: Microsoft RMS encryption.
Definition: fs_pdfdoc.h:650
Definition: fs_basictypes.h:419
If set, that means attachments will be inserted to target document as well.
Definition: fs_pdfdoc.h:815
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:691
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:178
Definition: fs_annot.h:965
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:743
Definition: fs_security.h:56
Definition: fs_common.h:1344
Definition: fs_pdfobject.h:809
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:803
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:261
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:57
Foxit namespace.
Definition: fs_taggedpdf.h:27
Definition: fs_pdfobject.h:55
WrapperData & operator=(const WrapperData &wrapper_data)
Assign operator.
Definition: fs_pdfdoc.h:204
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:237
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:796
BYTE STRING CLASS.
Definition: fx_string.h:317
Unknown encryption type.
Definition: fs_pdfdoc.h:638
EncryptType
Enumeration for encryption type.
Definition: fs_pdfdoc.h:636
int opacity
Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.
Definition: fs_pdfdoc.h:155
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:867
Definition: fs_pdfform.h:44
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:402
TableOfContentsConfig & operator=(const TableOfContentsConfig &other)
Assign operator.
Definition: fs_pdfdoc.h:477
When document is opened, thumbnail images are visible.
Definition: fs_pdfdoc.h:829
void InsertDocument(int dest_index, const PDFDoc &src_doc, uint32 options)
Insert another PDF document to the specified location of current PDF document.
TableOfContentsConfig()
Constructor.
Definition: fs_pdfdoc.h:461
#define NULL
The null-pointer value.
Definition: fx_system.h:780
Definition: fs_signature.h:99
Page size: letter.
Definition: fs_pdfpage.h:491
void RemoveSignature(const foxit::pdf::Signature &signature)
Remove a signature.
WString title
Title for the table of contents. If this is an empty string, the default value "Table of Contents" wi...
Definition: fs_pdfdoc.h:543
PayLoadData()
Constructor.
Definition: fs_pdfdoc.h:248
Encryption type: Foxit DRM encryption.
Definition: fs_pdfdoc.h:646
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:371
PageBasicInfo(const PageBasicInfo &page_info)
Constructor, with another page basic information object.
Definition: fs_pdfdoc.h:360
void AddHeaderFooter(const HeaderFooter &headerfooter)
Add new header-footer.
foxit::pdf::Signature GetSignature(int index)
Get a signature by index.
Definition: fs_security.h:368
void AddTableOfContents(const wchar_t *title, Int32Array bookmark_level_array)
Insert page(s) as the table of contents to the front of current PDF document.
Definition: fs_pdfdoc.h:443
bool RemovePage(int index)
Remove a PDF page by page index.
void SetCacheFile(foxit::common::file::StreamCallback *file_stream, bool is_own_file_stream)
Set cache file (represented by a file stream) to current PDF document.
WrapperData()
Constructor.
Definition: fs_pdfdoc.h:166
Definition: fs_bookmark.h:58
bool HasHeaderFooter()
Check whether current document has header-footer.
void Set(float width, float height, common::Rotation rotation)
Set value.
Definition: fs_pdfdoc.h:387
Definition: fs_readingbookmark.h:43
UserPermissions
Enumeration for user access permissions in a PDF document.
Definition: fs_pdfdoc.h:660
void Set(float row_space, float col_space, float rotation, int opacity, int scale)
Set value.
Definition: fs_pdfdoc.h:137
WrapperData(const WrapperData &wrapper_data)
Constructor, with another wrapper data object.
Definition: fs_pdfdoc.h:190
Foxit wrapper document.
Definition: fs_pdfdoc.h:865
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.