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:
66  typedef enum _Flags {
70  e_FlagAsAnnot = 0x0001,
72  e_FlagOnTop = 0x0002,
74  e_FlagNoPrint = 0x0004,
76  e_FlagInvisible = 0x0008
77  } Flags;
78 
94  explicit TiledWatermarkSettings(float row_space, float col_space, float rotation, int opacity ,int scale, uint32 flags)
98  , opacity(opacity)
99  , scale(scale)
100  , flags(flags){}
101 
110  : row_space(2.0)
111  , col_space(2.0)
112  , rotation(0)
113  , opacity(100)
114  , scale(100)
115  , flags(0){}
116 
123  : row_space(settings.row_space)
124  , col_space(settings.col_space)
125  , rotation(settings.rotation)
126  , opacity(settings.opacity)
127  , scale(settings.scale)
128  , flags(settings.flags){}
129 
138  row_space = settings.row_space;
139  col_space = settings.col_space;
140  rotation = settings.rotation;
141  opacity = settings.opacity;
142  scale = settings.scale;
143  flags = settings.flags;
144  return *this;
145  }
146 
164  void Set(float row_space, float col_space, float rotation, int opacity, int scale, uint32 flags) {
165  this->row_space = row_space;
166  this->col_space = col_space;
167  this->rotation = rotation;
168  this->opacity = opacity;
169  this->scale = scale;
170  this->flags = flags;
171  }
172 
174  float row_space;
176  float col_space;
178  float rotation;
183  int opacity;
188  int scale;
189 
198 
199 };
201 class WrapperData FS_FINAL : public Object {
202  public:
205  : version(0) {}
206 
216  WrapperData(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description)
217  : version(version)
218  , type(type)
219  , app_id(app_id)
220  , uri(uri)
222 
228  WrapperData(const WrapperData& wrapper_data)
229  : version(wrapper_data.version)
230  , type(wrapper_data.type)
231  , app_id(wrapper_data.app_id)
232  , uri(wrapper_data.uri)
233  , description(wrapper_data.description) {}
234 
242  WrapperData& operator = (const WrapperData& wrapper_data) {
243  version = wrapper_data.version;
244  type = wrapper_data.type;
245  app_id = wrapper_data.app_id;
246  uri = wrapper_data.uri;
247  description = wrapper_data.description;
248  return *this;
249  }
250 
262  void Set(int version, const wchar_t* type, const wchar_t* app_id, const wchar_t* uri, const wchar_t* description) {
263  this->version = version;
264  this->type = type;
265  this->app_id = app_id;
266  this->uri = uri;
267  this->description = description;
268  }
269 
271  int version;
280 };
281 
283 class PayLoadData FS_FINAL {
284  public:
287  : version(0.0f)
288  , file_size (0){}
289 
299  PayLoadData(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
301  const wchar_t* description)
302  : version(version)
307  {}
308 
314  PayLoadData(const PayLoadData& payload_data)
315  : version(payload_data.version)
316  , crypto_filter(payload_data.crypto_filter)
317  , file_name(payload_data.file_name)
318  , file_size(payload_data.file_size)
319  , description(payload_data.description)
320  {}
321 
329  PayLoadData& operator=(const PayLoadData& payload_data) {
330  version = payload_data.version;
331  crypto_filter = payload_data.crypto_filter;
332  description = payload_data.description;
333  file_name = payload_data.file_name;
334  file_size = payload_data.file_size;
335  return *this;
336  }
337 
347  void Set(float version, const wchar_t* crypto_filter, const wchar_t* file_name,
349  const wchar_t* description) {
350  this->version = version;
351  this->crypto_filter = crypto_filter;
352  this->file_name = file_name;
353  this->file_size = file_size;
354  this->description = description;
355  }
356 
358  float version;
367 };
368 
370 class HiddenInfoSettingData FS_FINAL: public Object{
371  public:
376  : enable_remove_metadata(true)
378  , enable_remove_bookmark(true)
380  , enable_remove_comment(true)
384  , enable_remove_content(true)
385  , enable_remove_link(true)
386  , enable_remove_overlaping(true) { }
387 
407  return *this;
408  }
409 
416 
423 
430 
437 
444 
451 
458 
465 
472 
479 
486 };
487 
492 class PageBasicInfo FS_FINAL : public Object {
493  public:
503  : width(width)
504  , height(height)
505  , rotation(rotation) {}
506 
509  : width(0)
510  , height(0)
511  , rotation(CommonDefines::e_RotationUnknown) {}
517  PageBasicInfo(const PageBasicInfo& page_info)
518  : width(page_info.width)
519  , height(page_info.height)
520  , rotation(page_info.rotation) {}
529  width = page_info.width;
530  height = page_info.height;
531  rotation = page_info.rotation;
532  return *this;
533  }
544  void Set(float width, float height, common::Rotation rotation) {
545  this->width = width;
546  this->height = height;
547  this->rotation = rotation;
548  }
549 
551  float width;
552 
554  float height;
560 };
561 
564 
565 
569 class EmbeddedFontData FS_FINAL : public Object {
570  public:
573 
580  : nonstandard_font_name_array(other.nonstandard_font_name_array)
581  , standard_font_name_array(other.standard_font_name_array) {}
582 
591  nonstandard_font_name_array = other.nonstandard_font_name_array;
592  standard_font_name_array = other.standard_font_name_array;
593  return *this;
594  }
595 
600 };
601 
603 class TableOfContentsConfig FS_FINAL : public Object{
604  public:
615  : title(title)
619 
622  : title(L"")
624  , is_show_serial_number(false)
625  , include_toc_pages(false){}
626 
635  this->title = other.title;
638  this->include_toc_pages = other.include_toc_pages;
639  return *this;
640  }
641 
649  bool operator == (const TableOfContentsConfig& other) const {
650  if (this->title == other.title && this->is_show_serial_number == other.is_show_serial_number && this->include_toc_pages == other.include_toc_pages) {
652  return false;
653  for (int i = 0; i < this->bookmark_level_array.GetSize(); i++) {
654  if (this->bookmark_level_array.GetAt(i) != other.bookmark_level_array.GetAt(i))
655  return false;
656  }
657  return true;
658  }
659  return false;
660  }
661 
669  bool operator != (const TableOfContentsConfig& other) const {
670  if (this->title != other.title || this->is_show_serial_number != other.is_show_serial_number || this->include_toc_pages != other.include_toc_pages)
671  return true;
673  return true;
674  for (int i = 0; i < this->bookmark_level_array.GetSize(); i++) {
675  if (this->bookmark_level_array.GetAt(i) != other.bookmark_level_array.GetAt(i))
676  return true;
677  }
678  return false;
679  }
680 
693  this->title = title;
694  this->bookmark_level_array = bookmark_level_array;
695  this->is_show_serial_number = is_show_serial_number;
696  this->include_toc_pages = include_toc_pages;
697  }
698 
701 
709 
717 };
718 
772 class PDFDoc FS_FINAL : public Base {
773  public:
779  typedef enum _PasswordType {
788  } PasswordType;
789 
795  typedef enum _EncryptType {
812  } EncryptType;
813 
819  typedef enum _UserPermissions {
825  e_PermPrint = 0x0004,
832  e_PermModify = 0x0008,
838  e_PermExtract = 0x0010,
844  e_PermAnnotForm = 0x0020,
850  e_PermFillForm = 0x0100,
863  e_PermAssemble = 0x0400,
870  } UserPermissions;
871 
876  typedef enum _SaveFlags {
925  } SaveFlags;
926 
932  typedef enum _ImportPageFlags {
943  } ImportPageFlags;
944 
950  typedef enum _ExtractPagesOptions {
971 
977  typedef enum _InsertDocOptions {
983 
989  typedef enum _DisplayMode {
1005  } DisplayMode;
1006 
1013  typedef enum _DataType {
1015  e_Forms = 0x0001,
1017  e_Annots = 0x0002,
1019  e_Links = 0x0004
1020  } DataType;
1021 
1027  typedef enum _WrapperType {
1034  } WrapperType;
1035 
1036 
1043  PDFDoc();
1044 
1053  explicit PDFDoc(const char* path);
1054 
1063  explicit PDFDoc(const wchar_t* path);
1064 
1075  explicit PDFDoc(const void* buffer, size_t size);
1076 
1091  explicit PDFDoc(common::file::ReaderCallback* file_read, bool is_async = false);
1092  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1093  explicit PDFDoc(FS_HANDLE handle);
1095  ~PDFDoc();
1096 
1102  PDFDoc(const PDFDoc& other);
1103 
1111  PDFDoc& operator = (const PDFDoc& other);
1119  bool operator == (const PDFDoc& other) const;
1120 
1128  bool operator != (const PDFDoc& other) const;
1129 
1137  bool IsEmpty() const;
1138 
1144  uint64 GetFileSize();
1145 
1165  bool IsLinearized() const;
1166 
1175  bool IsTaggedPDF() const;
1176 
1198  ErrorCode Load(const String& password = "");
1199 
1222  ErrorCode LoadW(const WString& password = WString());
1223 
1255  common::Progressive StartLoad(const String& password = "", bool is_cache_stream = true,
1256  common::PauseCallback* pause = NULL);
1288  common::Progressive StartLoadW(const WString& password = WString(), bool is_cache_stream = true,
1289  common::PauseCallback* pause = NULL);
1290 
1300  int GetFirstAvailPageIndex() const;
1301 
1312  bool IsXFA() const;
1313 
1320  bool IsEncrypted() const;
1321 
1327  void ClearRenderCache();
1328 
1342  PasswordType GetPasswordType() const;
1343 
1351 
1366  PasswordType CheckPassword(const String& password);
1367 
1382  PasswordType CheckPassword(const foxit::WString& password);
1383 
1392  bool IsUserPassword(const String& password);
1393 
1402  bool IsUserPassword(const foxit::WString& password);
1403 
1412  bool IsOwnerPassword(const String& password);
1413 
1422  bool IsOwnerPassword(const foxit::WString& password);
1423 
1433  String GetUserPassword(const String& owner_password);
1434 #ifndef __EMSCRIPTEN_RENDER__
1435 
1443 
1452 
1461 
1470 
1483 #endif
1484 
1510  bool SaveAs(const char* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1511 
1538  bool SaveAs(const wchar_t* file_path, uint32 save_flags = PDFDoc::e_SaveFlagNormal);
1539 
1573  common::Progressive StartSaveAs(const char* file_path,
1574  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1575  common::PauseCallback* pause = NULL);
1576 
1610  common::Progressive StartSaveAs(const wchar_t* file_path,
1611  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1612  common::PauseCallback* pause = NULL);
1613 
1650 
1651 #ifndef __EMSCRIPTEN_RENDER__
1652 
1660 
1670 
1677  int GetBookmarkLevelDepth();
1678 
1686  bool RemoveBookmark(const Bookmark& bookmark);
1687 
1694  bool HasLayer() const;
1695 
1702  bool HasHeaderFooter();
1703 
1713 
1724  void AddHeaderFooter(const HeaderFooter& headerfooter);
1725 
1736  void UpdateHeaderFooter(const HeaderFooter& headerfooter);
1737 
1743  bool RemoveAllHeaderFooters();
1744 #endif
1745 
1750  int GetPageCount() const;
1751 
1765  PDFPage GetPage(int index);
1766 
1775  DisplayMode GetDisplayMode() const;
1776 
1787  void SetDisplayMode(DisplayMode display_mode);
1788 
1796 
1804 
1814 
1822 
1830 
1839 
1857 
1865  void DeleteIndirectObject(uint32 object_number);
1866 
1873  uint32 GetUserPermissions() const;
1874 
1881  bool IsWrapper() const;
1882 
1889  WrapperType GetWrapperType() const;
1890 
1897  WrapperData GetWrapperData() const;
1898 
1905  int64 GetWrapperOffset() const;
1906 
1914 
1932 
1958  bool SaveAsWrapperFile(const wchar_t* file_path, const WrapperData* wrapper_data = NULL,
1959  uint32 user_permissions = 0xFFFFFFFC, const char* owner_password = "");
1960 
1988  common::Progressive StartSaveAsPayloadFile(const wchar_t* file_path, const wchar_t* payload_file_path,
1989  const wchar_t* crypto_filter, const wchar_t* description, float version,
1990  uint32 save_flags = PDFDoc::e_SaveFlagNormal,
1991  common::PauseCallback* pause = NULL);
2003  bool HasForm() const;
2004 
2011 #ifndef __EMSCRIPTEN_RENDER__
2012 
2021 
2035  ReadingBookmark InsertReadingBookmark(int reading_bookmark_index, const WString& title, int dest_page_index);
2036 
2044  bool RemoveReadingBookmark(const ReadingBookmark& reading_bookmark);
2045 
2051  int GetSignatureCount();
2052 
2062 
2072  void RemoveSignature(const foxit::pdf::Signature& signature);
2073 #endif
2074 
2087  PDFPage InsertPage(int index, float width, float height);
2101 
2120  PDFPage AddPageFromTemplate(const wchar_t* template_name);
2121 
2137  bool HidePageTemplate(const wchar_t* template_name);
2138 
2147  bool RemovePage(int index);
2148 
2159  bool RemovePage(const foxit::pdf::PDFPage& page);
2160 
2176  bool MovePageTo(const PDFPage& page, int dest_index);
2177 
2198  bool MovePagesTo(const common::Range& page_range, int dest_index);
2199 
2253  const wchar_t* src_file_path, const String& password,
2254  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
2255  const common::Range& page_range = common::Range(),
2256  common::PauseCallback* pause = NULL);
2309  const wchar_t* src_file_path, const WString& password,
2310  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
2311  const common::Range& page_range = common::Range(),
2312  common::PauseCallback* pause = NULL);
2362  common::Progressive StartImportPages(int dest_index, const PDFDoc& src_doc,
2363  uint32 flags = PDFDoc::e_ImportFlagNormal, const char* layer_name = "",
2364  const common::Range& page_range = common::Range(),
2365  common::PauseCallback* pause = NULL);
2366 
2389  common::Progressive StartExtractPages(const char* file_path, uint32 options, const common::Range& page_range = common::Range(),
2390  common::PauseCallback* pause = NULL);
2391 
2414  common::Progressive StartExtractPages(const wchar_t* file_path, uint32 options, const common::Range& page_range = common::Range(),
2415  common::PauseCallback* pause = NULL);
2416 
2442 
2459  void InsertDocument(int dest_index, const PDFDoc& src_doc, uint32 options);
2460 
2478  void InsertDocument(int dest_index, const PDFDoc& src_doc, uint32 options, const wchar_t* bookmark_title);
2479 
2489  void Sanitize();
2490 
2502  void RemoveHiddenInfo(const HiddenInfoSettingData& hidden_data_setting);
2503 
2504 #ifndef __EMSCRIPTEN_RENDER__
2505 
2528  bool ImportFromFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
2529 
2549  bool ExportToFDF(const fdf::FDFDoc& fdf_doc, int types = pdf::PDFDoc::e_Forms | pdf::PDFDoc::e_Annots, const common::Range& page_range = common::Range());
2550 
2559  bool ExportAnnotToFDF(const annots::Annot& pdf_annot,const fdf::FDFDoc& fdf_doc);
2560 
2573  bool ExportFormFieldsToFDF(const pdf::interform::FieldArray& field_array, bool is_include, const fdf::FDFDoc& fdf_doc);
2574 #endif
2575 
2580  String GetHeader() const;
2581 
2587  int GetFileVersion();
2588 
2604  void SetFileVersion(int version);
2605 
2618  bool SetSecurityHandler(const SecurityHandler& handler);
2619 
2630 
2640  bool RemoveSecurity();
2641 
2649  int GetFontCount();
2650 
2659  common::Font GetFont(int index);
2660 
2667 
2679  bool SetOpenAction(actions::Action& action);
2680 
2686  bool RemoveOpenAction();
2687 
2693  bool DoJSOpenAction();
2694 
2700  bool IsPortfolio();
2701 
2716  PageBasicInfo GetPageBasicInfo(int index);
2717 
2731 
2740 #ifdef _SUPPORTWEBSDK_
2741  objects::PDFStream* CreateIcon(String imgStream,int width, int height);
2742 #endif
2743 
2750  void CreateDSS();
2751 
2767  void AddTableOfContents(const wchar_t* title, Int32Array bookmark_level_array);
2768 
2778  void AddTableOfContents(const TableOfContentsConfig& table_of_contents_config);
2779 
2796  void SetCacheFile(foxit::common::file::StreamCallback* file_stream, bool is_own_file_stream);
2797 
2814 
2831  common::Progressive StartRecognizeForm(bool is_set_tool_tips, common::PauseCallback* pause = NULL);
2832 
2841  WString GetPageText(int page_index) const;
2842 
2863  PagingSealSignature AddPagingSealSignature(const common::Range& page_range, float width, float height, bool to_check_permission = true);
2864 
2913  common::Progressive StartAddTiledWatermark(const wchar_t* text, const TiledWatermarkSettings& settings, const WatermarkTextProperties& properties, const common::Range& page_range, common::PauseCallback* pause = NULL);
2941  common::Progressive StartAddTiledWatermark(const wchar_t* src_img_file_path, const TiledWatermarkSettings& settings, const common::Range& page_range, common::PauseCallback* pause = NULL);
2942 
2999 
3007  annots::AnnotArray GetAnnotsByIdArray(const WStringArray& unique_id_arr);
3008 
3009 };
3010 } // namespace pdf
3011 } // namespace foxit
3012 #endif // FS_PDFDOC_H_
3013 
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:716
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:932
TiledWatermarkSettings(const TiledWatermarkSettings &settings)
Constructor, with another tiled watermark settings object.
Definition: fs_pdfdoc.h:122
bool enable_remove_form_fields
A boolean value indicating whether to remove interactive form fields.
Definition: fs_pdfdoc.h:450
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:844
Flags
Enumeration for tiled watermark setting flags.
Definition: fs_pdfdoc.h:66
Definition: fs_pdfobject.h:448
int version
Wrapper version.
Definition: fs_pdfdoc.h:271
If set, form fields are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:1015
~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:599
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:347
If set, annotations (except link annotations) are to imported from or exported to FDF/XFDF document.
Definition: fs_pdfdoc.h:1017
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:109
Definition: fs_common.h:1348
File writing interface.
Definition: fx_stream.h:470
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).
bool enable_remove_fileattachment
A boolean value indicating whether to remove embedded file attachments.
Definition: fs_pdfdoc.h:422
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:614
If set, do not display a watermark.
Definition: fs_pdfdoc.h:76
bool enable_remove_link
A boolean value indicating whether to remove hyperlink annotations.
Definition: fs_pdfdoc.h:478
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:711
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:221
Save document normally, without using any special flag.
Definition: fs_pdfdoc.h:882
Extract PDF contents. (Bit 5 in permission value)
Definition: fs_pdfdoc.h:838
Definition: fs_annot.h:1657
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:358
Assemble PDF document. (Bit 11 in permission value)
Definition: fs_pdfdoc.h:863
bool enable_remove_metadata
A boolean value indicating whether to remove document metadata.
Definition: fs_pdfdoc.h:415
Unknown rotation.
Definition: fs_common.h:67
Encryption type: password, which is the standard encryption.
Definition: fs_pdfdoc.h:801
Header file for header-footer related definitions and classes.
bool operator==(const TableOfContentsConfig &other) const
Equal operator.
Definition: fs_pdfdoc.h:649
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:314
objects::PDFDictionary * GetTrailer() const
Get the trailer dictionary.
WrapperType
Enumeration for wrapper type.
Definition: fs_pdfdoc.h:1027
If set, the watermark will be a part of page content when inserted to a PDF page.
Definition: fs_pdfdoc.h:68
Modify PDF contents. (Bit 4 in permission value)
Definition: fs_pdfdoc.h:832
PagingSealSignature AddPagingSealSignature(const common::Range &page_range, float width, float height, bool to_check_permission=true)
Add a paging seal signature to document by page range.
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:708
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:174
bool enable_remove_hidden_text
A boolean value indicating whether to remove hidden text.
Definition: fs_pdfdoc.h:457
Definition: fs_basictypes.h:228
bool SetOpenAction(actions::Action &action)
Set the action to be performed when the document is opened.
Definition: fs_pdfdoc.h:569
TiledWatermarkSettings(float row_space, float col_space, float rotation, int opacity, int scale, uint32 flags)
Constructor, with parameters.
Definition: fs_pdfdoc.h:94
A user password is used in PDF document.
Definition: fs_pdfdoc.h:785
WString description
Description for payload file to show applications or confront users prompt information.
Definition: fs_pdfdoc.h:366
Save document without updating metadata "ModDate" and "CreationDate".
Definition: fs_pdfdoc.h:924
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.
annots::AnnotArray GetAnnotsByIdArray(const WStringArray &unique_id_arr)
Get annotations by the unique ID array.
PageBasicInfo()
Constructor.
Definition: fs_pdfdoc.h:508
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:360
Header file for file operation related definitions and functions.
bool operator !=(const TableOfContentsConfig &other) const
Not equal operator.
Definition: fs_pdfdoc.h:669
File reading interface.
Definition: fx_stream.h:587
void UpdateHeaderFooter(const HeaderFooter &headerfooter)
Update header-footer.
Import pages with layers.
Definition: fs_pdfdoc.h:936
If set, that means structure tree will be extracted as well.
Definition: fs_pdfdoc.h:954
objects::PDFDictionary * GetCatalog() const
Get the catalog dictionary.
Encryption type: customized encryption.
Definition: fs_pdfdoc.h:807
WIDE STRING CLASS.
Definition: fx_string.h:1461
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:279
Save document without original data or unchanged objects.
Definition: fs_pdfdoc.h:898
Save document incrementally.
Definition: fs_pdfdoc.h:890
bool IsWrapper() const
Check whether current document is a wrapper file or not.
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:223
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:554
No password is used in PDF document.
Definition: fs_pdfdoc.h:783
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:965
Print PDF document with higher qualities. (Bit 12 in permission value)
Definition: fs_pdfdoc.h:869
Definition: fs_pdfdoc.h:283
Definition: fs_pdfdoc.h:772
Configuration settings for removing hidden or sensitive data from a PDF document.
Definition: fs_pdfdoc.h:370
Normal document.
Definition: fs_pdfdoc.h:1029
Definition: fs_security.h:579
PayLoadData & operator=(const PayLoadData &payload_data)
Assign operator.
Definition: fs_pdfdoc.h:329
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.
bool RemoveAllHeaderFooters()
Remove all header-footers.
int64 file_size
The payload file size.
Definition: fs_pdfdoc.h:364
(Reserved, not supported yet) If set, only link annotations are to imported from or exported to XFDF ...
Definition: fs_pdfdoc.h:1019
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:787
If set, show watermark above other page content.
Definition: fs_pdfdoc.h:72
ExtractPagesOptions
Enumeration for options used for extracting pages.
Definition: fs_pdfdoc.h:950
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:960
EmbeddedFontData(const EmbeddedFontData &other)
Constructor, with another embedded font data object.
Definition: fs_pdfdoc.h:579
Definition: fs_security.h:137
Import pages without cloning stream objects into memory.
Definition: fs_pdfdoc.h:942
Definition: fs_pdfdoc.h:563
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:958
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:597
Definition: fs_signature.h:2091
Definition: fs_pdfdoc.h:492
SaveFlags
Enumeration for PDF document saving flags.
Definition: fs_pdfdoc.h:876
ErrorCode LoadW(const WString &password=WString())
Load current document content by using a specified password.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:237
PageBasicInfo(float width, float height, common::Rotation rotation)
Constructor, with parameters.
Definition: fs_pdfdoc.h:502
WString type
Wrapper type to indicate a type of the current wrapper file.
Definition: fs_pdfdoc.h:273
int scale
The image or page scale in percents. Valid range: from 0 to 100. 0 means not displayed,...
Definition: fs_pdfdoc.h:188
EmbeddedFontData & operator=(const EmbeddedFontData &other)
Assign operator.
Definition: fs_pdfdoc.h:590
EmbeddedFontData()
Constructor.
Definition: fs_pdfdoc.h:572
void Sanitize()
Removes all hidden or potentially sensitive information from the current PDF document using default s...
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:934
Definition: fs_pdfdoc.h:201
File stream interface, reading & writing.
Definition: fx_stream.h:692
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:991
DisplayMode
Enumeration for display mode which specifies how the document should be displayed when opened.
Definition: fs_pdfdoc.h:989
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:551
TiledWatermarkSettings & operator=(const TiledWatermarkSettings &settings)
Assign operator.
Definition: fs_pdfdoc.h:137
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:692
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:490
WString file_name
The payload file name.
Definition: fs_pdfdoc.h:362
Definition: fx_basic.h:3758
If set, that means signature will be extracted as well. It must be combined with PDFDoc:e_ExtractPage...
Definition: fs_pdfdoc.h:969
objects::PDFDictionary * GetInfo() const
Get the information dictionary.
bool IsXFA() const
Check whether current PDF document is an XFA document.
If set, do not print a watermark.
Definition: fs_pdfdoc.h:74
float rotation
Rotation angle in degrees.
Definition: fs_pdfdoc.h:178
When document is opened, full-screen mode, with no menu bar, window controls, or any other windows ar...
Definition: fs_pdfdoc.h:1000
Print PDF document with normal mode. (Bit 3 in permission value)
Definition: fs_pdfdoc.h:825
PageBasicInfoArray GetAllPageBasicInfo()
Get the basic information of all page.
(Reserved, currently, this value is not used.) Encryption type: Foxit connected PDF DRM encryption.
Definition: fs_pdfdoc.h:811
Save document as a linearized file.
Definition: fs_pdfdoc.h:910
When document is opened, document outlines (bookmarks) are visible.
Definition: fs_pdfdoc.h:993
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:779
When document is opened, optional content group panels are visible.
Definition: fs_pdfdoc.h:1002
Definition: fs_common.h:373
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:952
InsertDocOptions
Enumeration for options used for inserting a PDF document to another.
Definition: fs_pdfdoc.h:977
Disabilities support. (Bit 10 in permission value)
Definition: fs_pdfdoc.h:856
DataType
Enumeration for data type used to decide which object(s) will be imported from or exported to FDF/XFD...
Definition: fs_pdfdoc.h:1013
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:917
Definition: fs_pdfpage.h:412
bool RemoveReadingBookmark(const ReadingBookmark &reading_bookmark)
Remove a reading bookmark from current PDF document.
Encryption type: digital certificate encryption.
Definition: fs_pdfdoc.h:803
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
WrapperType GetWrapperType() const
Get Wrapper type.
EmbeddedFontData GetEmbeddedFontData()
Get embedded font data.
If set, that means bookmark will be inserted to target document as well.
Definition: fs_pdfdoc.h:981
Header file for common definitions and classes.
When document is opened, attachment panels are visible.
Definition: fs_pdfdoc.h:1004
HiddenInfoSettingData & operator=(const HiddenInfoSettingData &data)
Assign operator.
Definition: fs_pdfdoc.h:395
ReadingBookmark GetReadingBookmark(int index)
Get a reading bookmark by index.
No encryption pattern.
Definition: fs_pdfdoc.h:799
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:262
The password is invalid.
Definition: fs_pdfdoc.h:781
PDFDoc & operator=(const PDFDoc &other)
Assign operator.
If set, that means bookmark will be extracted as well.
Definition: fs_pdfdoc.h:967
void DeleteIndirectObject(uint32 object_number)
Delete an indirect object by indirect object number.
bool enable_remove_searchIndex
A boolean value indicating whether to remove the search index.
Definition: fs_pdfdoc.h:436
Definition: fs_security.h:823
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:277
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:176
Header file for PDF object related definitions and classes.
Encryption type: Microsoft RMS encryption.
Definition: fs_pdfdoc.h:809
Definition: fs_basictypes.h:449
If set, that means attachments will be inserted to target document as well.
Definition: fs_pdfdoc.h:979
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:850
int GetPageCount() const
Get the count of pages.
bool enable_remove_comment
A boolean value indicating whether to remove comments and annotations.
Definition: fs_pdfdoc.h:443
bool enable_remove_overlaping
A boolean value indicating whether to remove overlapping objects.
Definition: fs_pdfdoc.h:485
void RemoveHiddenInfo(const HiddenInfoSettingData &hidden_data_setting)
Removes specified types of hidden information from the current PDF document based on user-defined set...
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:216
Definition: fs_annot.h:997
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:903
Definition: fs_security.h:56
Definition: fs_common.h:1503
Definition: fs_pdfobject.h:850
bool IsEncrypted() const
Check whether current document is an encrypted file or not.
void Set(float row_space, float col_space, float rotation, int opacity, int scale, uint32 flags)
Set value.
Definition: fs_pdfdoc.h:164
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:963
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:299
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_pdf3d.h:27
Definition: fs_pdfobject.h:55
WrapperData & operator=(const WrapperData &wrapper_data)
Assign operator.
Definition: fs_pdfdoc.h:242
DRMEncryptData GetDRMEncryptData() const
Get encrypt data of Foxit DRM encryption.
Definition: fs_action.h:418
bool enable_remove_bookmark
A boolean value indicating whether to remove bookmarks.
Definition: fs_pdfdoc.h:429
WString app_id
Application identity to indicate applications to open this wrapper data.
Definition: fs_pdfdoc.h:275
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:956
If set, the watermark will be an annotation when inserted to a PDF page, and the watermark will be sh...
Definition: fs_pdfdoc.h:70
BYTE STRING CLASS.
Definition: fx_string.h:317
Unknown encryption type.
Definition: fs_pdfdoc.h:797
EncryptType
Enumeration for encryption type.
Definition: fs_pdfdoc.h:795
int opacity
Opacity in percents. Valid range: from 0 to 100. 0 for fully transparent and 100 for fully opaque.
Definition: fs_pdfdoc.h:183
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:1033
bool enable_remove_content
A boolean value indicating whether to remove invisible or obscured content.
Definition: fs_pdfdoc.h:471
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:559
uint32 flags
Watermark flags.
Definition: fs_pdfdoc.h:197
TableOfContentsConfig & operator=(const TableOfContentsConfig &other)
Assign operator.
Definition: fs_pdfdoc.h:634
When document is opened, thumbnail images are visible.
Definition: fs_pdfdoc.h:995
bool enable_remove_hidden_layer
A boolean value indicating whether to remove hidden layers (Optional Content Groups).
Definition: fs_pdfdoc.h:464
HiddenInfoSettingData()
Constructs a HiddenDataSetting object with all removal options enabled by default.
Definition: fs_pdfdoc.h:375
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:621
#define NULL
The null-pointer value.
Definition: fx_system.h:792
Definition: fs_signature.h:99
Page size: letter.
Definition: fs_pdfpage.h:492
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:700
PayLoadData()
Constructor.
Definition: fs_pdfdoc.h:286
Encryption type: Foxit DRM encryption.
Definition: fs_pdfdoc.h:805
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:528
PageBasicInfo(const PageBasicInfo &page_info)
Constructor, with another page basic information object.
Definition: fs_pdfdoc.h:517
void AddHeaderFooter(const HeaderFooter &headerfooter)
Add new header-footer.
foxit::pdf::Signature GetSignature(int index)
Get a signature by index.
Definition: fs_security.h:365
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:603
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:204
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:544
Definition: fs_readingbookmark.h:43
UserPermissions
Enumeration for user access permissions in a PDF document.
Definition: fs_pdfdoc.h:819
WrapperData(const WrapperData &wrapper_data)
Constructor, with another wrapper data object.
Definition: fs_pdfdoc.h:228
Foxit wrapper document.
Definition: fs_pdfdoc.h:1031
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.