Foxit PDF SDK
fs_common.h
Go to the documentation of this file.
1 
15 #ifndef FS_COMMON_H_
16 #define FS_COMMON_H_
17 
18 #include "common/fs_basictypes.h"
19 #include "common/file/fs_file.h"
20 
26 namespace foxit {
27 class ActionCallback;
28 namespace common {
29 class DocEventCallback;
30 class FontMapperCallback;
31 } // namespace common
32 namespace pdf {
33 namespace annots {
35 } // namespace annots
36 class PDFDoc;
37 class SignatureCallback;
38 class SecurityCallback;
39 } // namespace pdf
40 namespace addon {
41 namespace xfa {
42 class AppProviderCallback;
43 } // namespace xfa
44 } // namespace addon
45 
49 namespace common {
50 #if defined(_SWIG_ANDROID_) || defined(_SWIG_JAVA_)
51 
52 class Constants {
53  public:
59  typedef enum _Rotation {
61  e_Rotation0 = 0,
63  e_Rotation90 = 1,
65  e_Rotation180 = 2,
67  e_Rotation270 = 3,
70  } Rotation;
71 
77  typedef enum _Alignment {
79  e_AlignmentLeft = 0,
84  } Alignment;
85 
91  typedef enum _FillMode {
93  e_FillModeNone = 0,
104  } FillMode;
105 
111  typedef enum _Position {
113  e_PosTopLeft = 0,
115  e_PosTopCenter = 1,
117  e_PosTopRight = 2,
119  e_PosCenterLeft = 3,
121  e_PosCenter = 4,
123  e_PosCenterRight = 5,
125  e_PosBottomLeft = 6,
127  e_PosBottomCenter = 7,
129  e_PosBottomRight = 8
130  } Position;
131 
137  typedef enum _ModuleName {
141  e_ModuleNameXFA = 2,
145  e_ModuleNameRMS = 4,
147  e_ModuleNameOCR = 5,
156  } ModuleName;
157 
158 };
159 #else
160 #if defined(__ANDROID__) || defined(_JAVA_)
161 
162 class Constants {
163  public:
169  typedef enum _Rotation {
171  e_Rotation0 = 0,
173  e_Rotation90 = 1,
175  e_Rotation180 = 2,
177  e_Rotation270 = 3,
180  } Rotation;
181 
187  typedef enum _Alignment {
189  e_AlignmentLeft = 0,
191  e_AlignmentCenter = 1,
193  e_AlignmentRight = 2
194  } Alignment;
195 
201  typedef enum _FillMode {
203  e_FillModeNone = 0,
214  } FillMode;
215 
221  typedef enum _Position {
223  e_PosTopLeft = 0,
225  e_PosTopCenter = 1,
227  e_PosTopRight = 2,
229  e_PosCenterLeft = 3,
231  e_PosCenter = 4,
233  e_PosCenterRight = 5,
235  e_PosBottomLeft = 6,
237  e_PosBottomCenter = 7,
239  e_PosBottomRight = 8
240  } Position;
241 
247  typedef enum _ModuleName {
251  e_ModuleNameXFA = 2,
255  e_ModuleNameRMS = 4,
257  e_ModuleNameOCR = 5,
266  } ModuleName;
267 
268 };
269 #endif
270 
275 typedef enum _Rotation {
286 } Rotation;
287 
293 typedef enum _Alignment {
300 } Alignment;
301 
307 typedef enum _FillMode {
320 } FillMode;
321 
327 typedef enum _Position {
346 } Position;
347 
353 typedef enum _ModuleName {
372 } ModuleName;
373 
374 #endif
375 
376 #define CommonDefines foxit::common
377 
383 class Codec FS_FINAL : public Base {
384  public:
393  static String Base64Encode(const void* data_buffer, size_t length);
394 
403  static String Base64Decode(const void* encoded_data_buffer, size_t length);
404 
413  static String FlateCompress(const void* data_buffer, size_t length);
414 
423  static String FlateDecompress(const void* compressed_data_buffer, size_t length);
424 };
425 
435  public:
441  virtual void Release() = 0;
442 
455  virtual void OnOutOfMemory() = 0;
456 
457  protected:
458  ~NotifierCallback() {}
459 };
460 
465 class Progressive FS_FINAL : public Base {
466  public:
472  typedef enum _State {
474  e_Error = 0,
479  } State;
480 
486  Progressive(const Progressive& other);
488  ~Progressive();
489 
497  Progressive& operator = (const Progressive& other);
498 
507  State Continue();
508 
515  int GetRateOfProgress();
516 
517  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
518  explicit Progressive(FS_HANDLE handle = NULL);
519 };
520 
531 class Library FS_FINAL : public Object {
532  public:
546  static ErrorCode Initialize(const char* sn, const char* key);
547 
556  static ErrorCode Reinitialize();
557 
567  static void Release();
568 
583  static bool HasModuleLicenseRight(common::ModuleName module_name);
584 
590  static String GetVersion();
591 
603  static bool SetCacheSize(uint32 size);
604 
616  static bool EnableJavaScript(bool enable_javascript);
617 
618 #ifndef __EMSCRIPTEN_RENDER__
619 
641  static bool SetAnnotIconProviderCallback(pdf::annots::IconProviderCallback* annot_icon_provider);
642 #endif
643 
654  static bool SetNotifierCallback(NotifierCallback* notifier);
655 
670  static bool SetActionCallback(ActionCallback* action_callback);
671 
680  static bool SetDocEventCallback(DocEventCallback* callback);
681 
714  static bool RegisterSignatureCallback(const char* filter, const char* sub_filter,
715  pdf::SignatureCallback* signature_callback);
716 
751  static bool RegisterSecurityCallback(const char* filter, pdf::SecurityCallback* callback);
752 
771  static bool UnregisterSecurityCallback(const char* filter);
772 
773  #if defined(__ANDROID__) || defined(FS_IOS_) || defined(_SWIG_ANDROID_) || defined(_SWIG_IOS_)
774 
782  static bool IsFipsMode();
783  #endif
784 
785  #ifndef _FX_NO_XFA_
786 
804  #endif
805 
815  static void SetRenderTextGamma(float gamma);
816 
827  static void* Alloc(size_t size);
828 
836  static void Free(void* ptr);
837 
849  static void* Realloc(void* ptr, size_t new_size);
850 
861  static void SetLogFile(const char* log_file_path);
862 
873  static void SetLogFile(const wchar_t* log_file_path);
874 
886  static bool SetFontMapperCallback(FontMapperCallback* callback);
887 
888  private:
889  Library(const Library&);
890  Library& operator = (const Library&);
891 };
893 class GraphState FS_FINAL : public Object {
894  public:
901  typedef enum _LineCapStyle {
917  } LineCapStyle;
918 
925  typedef enum _LineJoinStyle {
943  } LineJoinStyle;
944 
945 
961  this->line_width = line_width;
962  this->line_join = line_join;
963  this->miter_limit = miter_limit;
964  this->line_cap = line_cap;
965  this->dash_phase = dash_phase;
966  this->dashes = dashes;
967  }
968 
971  : line_width(1.0f)
973  , miter_limit(10*1.0f)
975  , dash_phase(0) {}
976 
979 
985  GraphState(const GraphState& state) {
986  this->line_width = state.line_width;
987  this->line_join = state.line_join;
988  this->miter_limit = state.miter_limit;
989  this->line_cap = state.line_cap;
990  this->dash_phase = state.dash_phase;
991  this->dashes = state.dashes;
992  }
993 
1002  this->line_width = state.line_width;
1003  this->line_join = state.line_join;
1004  this->miter_limit = state.miter_limit;
1005  this->line_cap = state.line_cap;
1006  this->dash_phase = state.dash_phase;
1007  this->dashes = state.dashes;
1008  return *this;
1009  }
1010 
1027  const FloatArray& dashes) {
1028  this->line_width = line_width;
1029  this->line_join = line_join;
1030  this->miter_limit = miter_limit;
1031  this->line_cap = line_cap;
1032  this->dash_phase = dash_phase;
1033  this->dashes = dashes;
1034  }
1035 
1042  float line_width;
1069 
1071  float dash_phase;
1072 
1077 };
1078 
1085 
1092  public:
1098  virtual void Release() = 0;
1099 
1105  virtual void OnDocWillOpen() {}
1106 
1117  virtual void OnDocOpened(const pdf::PDFDoc& document, ErrorCode error_code) {}
1118 
1126  virtual void OnDocWillDestroy(const pdf::PDFDoc& document) {}
1127 
1135  virtual void OnDocWillSave(const pdf::PDFDoc& document) {}
1136 
1147  virtual void OnDocSaved(const pdf::PDFDoc& document, ErrorCode error_code) {}
1148 
1149  protected:
1150  ~DocEventCallback() {}
1151 };
1152 
1160 class Range FS_FINAL : public Base {
1161  public:
1167  typedef enum _Filter {
1169  e_All = 0,
1171  e_Even = 1,
1173  e_Odd = 2
1174  } Filter;
1175 
1177  Range();
1178 
1184  explicit Range(int index);
1185 
1198  explicit Range(int start_index, int end_index, Filter filter = e_All);
1199 
1205  Range(const Range& other);
1206 
1208  ~Range();
1209 
1217  Range& operator = (const Range& other);
1218 
1226  bool operator == (const Range& other) const;
1227 
1235  bool operator != (const Range& other) const;
1236 
1244  bool IsEmpty() const;
1245 
1251  void AddSingle( int index );
1252 
1267  void AddSegment( int start_index, int end_index, Filter filter = e_All );
1268 
1274  int GetSegmentCount() const;
1275 
1284  int GetSegmentStart(int segment_index) const;
1285 
1294  int GetSegmentEnd(int segment_index) const;
1295 
1301  void RemoveAll();
1302 
1303  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1304  explicit Range(FS_HANDLE handle);
1305 };
1306 
1315 class Font FS_FINAL : public Base {
1316  public:
1322  typedef enum _Styles {
1326  e_StyleSerif = 0x0002,
1330  e_StyleScript = 0x0008,
1334  e_StyleItalic = 0x0040,
1336  e_StyleAllCap = 0x10000,
1338  e_StylesSmallCap = 0x20000,
1340  e_StylesBold = 0x40000
1341  } Styles;
1342 
1348  typedef enum _Charset {
1379  } Charset;
1380 
1386  typedef enum _CIDCharset {
1399  } CIDCharset;
1400 
1406  typedef enum _StandardID {
1435  } StandardID;
1436 
1442  typedef enum _FontTypes {
1451  } FontTypes;
1452 
1465  Font(const wchar_t* name, uint32 styles, Charset charset, int weight = 0);
1466 
1473  explicit Font(StandardID font_id);
1474 
1484  Font(const char* font_file_path, int face_index, Charset charset);
1485 
1495  Font(const wchar_t* font_file_path, int face_index, Charset charset);
1496 
1497  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1498  explicit Font(FS_HANDLE handle = NULL);
1499 
1505  Font(const Font& other);
1506 
1514  Font& operator = (const Font& other);
1515 
1523  bool operator == (const Font& other) const;
1524 
1532  bool operator != (const Font& other) const;
1533 
1541  bool IsEmpty() const;
1542 
1544  ~Font();
1545 
1551  WString GetName();
1552 
1559 
1565  bool IsBold() const;
1566 
1572  bool IsItalic() const;
1573 
1581  bool IsEmbedded(const pdf::PDFDoc& document);
1582 
1591  bool IsSupportEmbedded(const pdf::PDFDoc& document);
1592 
1600  Font Embed(pdf::PDFDoc document);
1601 
1602 #ifdef _FONT_GETWOFFDATA_
1603 
1610  String GetWoffData(pdf::PDFDoc document);
1611 #endif
1612 
1618  int GetAscent() const;
1619 
1625  int GetDescent() const;
1626 
1634  RectI GetCharBBox(uint32 unicode) const;
1635 
1643  float GetCharWidth(uint32 unicode) const;
1644 
1653  RectI GetCharBBox(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1654 
1663  float GetCharWidth(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1664 
1673  foxit::uint32 GetStyles(const pdf::PDFDoc& document);
1674 
1686  CIDCharset GetCIDCharset(const pdf::PDFDoc& document);
1687 
1695  bool IsStandardFont(const pdf::PDFDoc& document);
1696 
1708  StandardID GetStandard14Font(const pdf::PDFDoc& document);
1709 
1718  FontTypes GetFontType(const pdf::PDFDoc& document);
1719 
1727  String GetBaseFontName(const pdf::PDFDoc& document);
1728 };
1729 
1734 class FontMapResult FS_FINAL : public Object {
1735  public:
1738 
1753  this->file_read = file_read;
1754  this->face_index = face_index;
1755  }
1756 
1763  this->file_read = other.file_read;
1764  this->face_index = other.face_index;
1765  }
1766 
1775  this->file_read = other.file_read;
1776  this->face_index = other.face_index;
1777  return *this;
1778  }
1779 
1787  bool operator == (const FontMapResult& other) const {
1788  if (this->file_read != other.file_read || this->face_index != other.face_index)
1789  return false;
1790  return true;
1791  }
1792 
1800  bool operator != (const FontMapResult& other) const {
1801  return !(*this == other);
1802  }
1803 
1818  this->file_read = file_read;
1819  this->face_index = face_index;
1820  }
1821 
1837 };
1838 
1848  public:
1854  virtual void Release() = 0;
1855 
1871  virtual FontMapResult MapFont(const char* font_name, bool is_truetype, uint32 styles,
1872  int weight, int italic_angle, Font::Charset charset) = 0;
1873 
1874  protected:
1875  ~FontMapperCallback() {}
1876 };
1877 
1879 class Path FS_FINAL : public Base {
1880  public:
1886  typedef enum _PointType {
1905  } PointType;
1906 
1908  Path();
1910  ~Path();
1916  Path(const Path& other);
1924  Path& operator=(const Path& other);
1932  bool operator ==(const Path& other) const;
1940  bool operator != (const Path& other) const;
1941 
1949  bool IsEmpty() const;
1950 
1956  int GetPointCount();
1957 
1966  PointF GetPoint(int index);
1967 
1977  PointType GetPointType(int index);
1978 
1990  bool SetPoint(int index, const PointF& point, PointType type);
1991 
2002  bool MoveTo(const PointF& point);
2003 
2013  bool LineTo(const PointF& point);
2014 
2027  bool CubicBezierTo(const PointF& point1, const PointF& point2, const PointF& point3);
2028 
2048  bool CloseFigure();
2049 
2058  bool RemovePoint(int index);
2059 
2067  bool AppendRect(const RectF& rect);
2068 
2076  bool AppendEllipse(const RectF& rect);
2077 
2085  void Transform(const Matrix& matrix);
2091  void Clear();
2092 
2105  void IncreasePointCount(int count);
2106 
2107  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2108  explicit Path(FS_HANDLE handle);
2109 };
2110 } // namespace common
2111 } // namespace foxit
2112 
2113 #endif // FS_COMMON_H_
2114 
CID Font charset: Adobe-CNS1.
Definition: fs_common.h:1392
Definition: fs_annot.h:1449
Font style: non-symbolic.
Definition: fs_common.h:1332
FontMapResult()
Constructor.
Definition: fs_common.h:1737
Indicates that a line is drawn from the previous point to this point, and this point will also be con...
Definition: fs_common.h:1896
Miter line join type.
Definition: fs_common.h:930
Name for module "Optimizer".
Definition: fs_common.h:369
Styles
Enumeration for font styles.
Definition: fs_common.h:1322
LineCapStyle line_cap
Line cap style.
Definition: fs_common.h:1068
Standard font: Helvetica-Bold.
Definition: fs_common.h:1418
Font charset: Korean (Wansung).
Definition: fs_common.h:1358
Bevel line join type.
Definition: fs_common.h:942
FloatArray dashes
A dash array that represents the dash patterns. Value of each element in this array should not be neg...
Definition: fs_common.h:1076
Position: center.
Definition: fs_common.h:337
Font charset: Japanese (Shift-JIS).
Definition: fs_common.h:1356
Definition: fs_common.h:1160
bool AppendEllipse(const RectF &rect)
Add an ellipse figure to the end of current path.
Standard font: Times-Bold.
Definition: fs_common.h:1426
static void SetRenderTextGamma(float gamma)
Set gamma value for text rendering.
Alternate fill mode, in which the system fills this area between odd-numbered and even-numbered polyg...
Definition: fs_common.h:314
CID Font charset: Unknown.
Definition: fs_common.h:1388
static void Release()
Release all resource allocated by Foxit PDF SDK Library.
int GetRateOfProgress()
Get the rate of current progress.
Position: bottom right.
Definition: fs_common.h:345
Definition: fs_common.h:383
Position
Enumeration for watermark position in a PDF page.
Definition: fs_common.h:327
Definition: fs_common.h:1734
Projecting square cap. The stroke continues beyond the endpoint of the path for a distance equal to h...
Definition: fs_common.h:916
bool IsStandardFont(const pdf::PDFDoc &document)
Check whether current font is a standard font.
PointType GetPointType(int index)
Get the type of a point specified by index.
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
IFX_Pause PauseCallback
Definition: fs_common.h:1084
CID Font charset: Adobe-Japan1.
Definition: fs_common.h:1394
Definition: fs_common.h:531
Round line join type.
Definition: fs_common.h:936
virtual FontMapResult MapFont(const char *font_name, bool is_truetype, uint32 styles, int weight, int italic_angle, Font::Charset charset)=0
A callback function used to map a suitable font according to input parameters.
bool operator!=(const Font &other) const
Not equal operator.
Standard font: Times-BoldItalic.
Definition: fs_common.h:1428
GraphState(float line_width, LineJoinStyle line_join, float miter_limit, LineCapStyle line_cap, float dash_phase, const FloatArray &dashes)
Constructor, with parameters.
Definition: fs_common.h:959
Unknown rotation.
Definition: fs_common.h:285
bool IsBold() const
Judge whether current font is bold or not.
static bool SetFontMapperCallback(FontMapperCallback *callback)
Set a FontMapperCallback object to Foxit PDF SDK.
bool operator!=(const Path &other) const
Not equal operator.
static String Base64Encode(const void *data_buffer, size_t length)
Encode the source data buffer by Base64 algorithm.
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:1173
void Set(float line_width, LineJoinStyle line_join, float miter_limit, LineCapStyle line_cap, float dash_phase, const FloatArray &dashes)
Set value.
Definition: fs_common.h:1026
Range & operator=(const Range &other)
Assign operator.
PointF GetPoint(int index)
Get a point specified by index.
bool CloseFigure()
Close current figure (which is also the last figure in current path).
Round cap. A semicircular arc with a diameter equal to the line width is drawn around the endpoint an...
Definition: fs_common.h:911
CID Font charset: Adobe-GB1.
Definition: fs_common.h:1390
Definition: fx_coordinates.h:30
static bool RegisterSignatureCallback(const char *filter, const char *sub_filter, pdf::SignatureCallback *signature_callback)
Register a third-party pdf::SignatureCallback object to Foxit PDF SDK for signing and verifying signa...
Rotate 180 degrees in clockwise direction.
Definition: fs_common.h:281
Name for module "OCR".
Definition: fs_common.h:363
bool IsSupportEmbedded(const pdf::PDFDoc &document)
Check whether current font is supported to be embedded to the specified PDF document or not.
CID Font charset: Unicode.
Definition: fs_common.h:1398
bool MoveTo(const PointF &point)
Add a point to the end of current path, to start a new figure.
Font style: all cap.
Definition: fs_common.h:1336
Filter
Enumeration for range filter.
Definition: fs_common.h:1167
~Font()
Destructor.
void IncreasePointCount(int count)
Increase the point count and prepare adequate memory for these new points.
int GetSegmentCount() const
Get the count of range segments.
Header file for file operation related definitions and functions.
bool operator==(const Range &other) const
Equal operator.
File reading interface.
Definition: fx_stream.h:555
void Clear()
Clear all points.
CIDCharset
Enumeration for CID font charset.
Definition: fs_common.h:1386
WIDE STRING CLASS.
Definition: fx_string.h:1452
GraphState(const GraphState &state)
Constructor, with another graph state object.
Definition: fs_common.h:985
State
Enumeration for progress state.
Definition: fs_common.h:472
Font type: TrueType.
Definition: fs_common.h:1446
static void RegisterXFAAppProviderCallback(addon::xfa::AppProviderCallback *callback)
Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK.
Standard font: Helvetica.
Definition: fs_common.h:1416
Position: top right.
Definition: fs_common.h:333
Definition: fs_common.h:1091
foxit::common::file::ReaderCallback * file_read
A common::file::ReaderCallback object which is implemented by user. Foxit PDF SDK will use this callb...
Definition: fs_common.h:1826
Indicates that the point is the first point of a figure.
Definition: fs_common.h:1888
bool operator==(const FontMapResult &other) const
Equal operator.
Definition: fs_common.h:1787
LineCapStyle
Enumeration for line cap style.
Definition: fs_common.h:901
Font style: script.
Definition: fs_common.h:1330
static ErrorCode Reinitialize()
Reinitialize Foxit PDF SDK Library.
static bool RegisterSecurityCallback(const char *filter, pdf::SecurityCallback *callback)
Register a pdf::SecurityCallback object to Foxit PDF SDK for decryption of the PDFs with special encr...
Definition: fs_pdfdoc.h:352
static bool SetCacheSize(uint32 size)
Set the upper limit of PDF library cache size.
bool operator!=(const FontMapResult &other) const
Not equal operator.
Definition: fs_common.h:1800
bool IsEmpty() const
Check whether current object is empty or not.
static ErrorCode Initialize(const char *sn, const char *key)
Initialize Foxit PDF SDK Library, with valid license information.
foxit::uint32 GetStyles(const pdf::PDFDoc &document)
Get font styles.
Font style: italic.
Definition: fs_common.h:1334
FontMapResult(const FontMapResult &other)
Constructor, with another font mapping result object.
Definition: fs_common.h:1762
Progressive(const Progressive &other)
Constructor, with another progressive object.
Definition: fs_common.h:1847
FontTypes
Enumeration for font type.
Definition: fs_common.h:1442
static bool SetAnnotIconProviderCallback(pdf::annots::IconProviderCallback *annot_icon_provider)
Set a customized pdf::annots::IconProviderCallback object to Foxit PDF SDK.
Progress state: progress needs to be continued.
Definition: fs_common.h:476
GraphState()
Constructor.
Definition: fs_common.h:970
Position: bottom center.
Definition: fs_common.h:343
bool IsEmbedded(const pdf::PDFDoc &document)
Judge whether current font is embedded in a specified PDF document or not.
int GetSegmentEnd(int segment_index) const
Get the end index of a specified range segment.
Definition: fs_signature.h:1135
void Transform(const Matrix &matrix)
Transform all points in current path with a given matrix.
(Reserved, currently, this module is not provided) Name for module "ConnectedPDF".
Definition: fs_common.h:355
Font style: serif.
Definition: fs_common.h:1326
Indicates that a line is drawn from the previous point to this point.
Definition: fs_common.h:1890
Name for module "Conversion".
Definition: fs_common.h:371
Header file for basic types definitions.
LineJoinStyle line_join
Line join style.
Definition: fs_common.h:1050
Position center left.
Definition: fs_common.h:335
Definition: fs_actioncallback.h:142
static void SetLogFile(const char *log_file_path)
Set the log file path.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:236
Only even numbers in a range will be used (discards odd numbers).
Definition: fs_common.h:1171
virtual void OnDocSaved(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is saved.
Definition: fs_common.h:1147
Font charset: Traditional Chinese.
Definition: fs_common.h:1362
Font(const wchar_t *name, uint32 styles, Charset charset, int weight=0)
Constructor, with given attribute.
Font charset: ANSI (United States, Western Europe).
Definition: fs_common.h:1350
static String FlateDecompress(const void *compressed_data_buffer, size_t length)
Decompress the compressed data buffer by DEFLATE algorithm.
Butt cap. The stroke is squared off at the endpoint of a path. There is no projection beyond the end ...
Definition: fs_common.h:906
Position: center right.
Definition: fs_common.h:339
virtual void Release()=0
A callback function used to release current callback object itself.
String GetBaseFontName(const pdf::PDFDoc &document)
Get base font name.
int GetSegmentStart(int segment_index) const
Get the start index of a specified range segment.
Font charset: Standard symbols.
Definition: fs_common.h:1354
CIDCharset GetCIDCharset(const pdf::PDFDoc &document)
Get CID font charset.
Font style: force bold.
Definition: fs_common.h:1340
FillMode
Enumeration for filling mode type, mainly for path graphics object.
Definition: fs_common.h:307
static void * Realloc(void *ptr, size_t new_size)
Reallocate a memory block.
Name for module "Compliance".
Definition: fs_common.h:367
static bool HasModuleLicenseRight(common::ModuleName module_name)
Check if user has right to use a specified module of Foxit PDF SDK in current used license informatio...
FontMapResult & operator=(const FontMapResult &other)
Assign operator.
Definition: fs_common.h:1774
Font style: symbolic.
Definition: fs_common.h:1328
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fx_basic.h:3737
Definition: fs_common.h:893
int GetDescent() const
Get the descent value, in 1/1000 of em size (PDF units).
bool CubicBezierTo(const PointF &point1, const PointF &point2, const PointF &point3)
Add a cubic bezier spline to the end of current figure, by three points: two control points and one t...
Standard font: Courier-BoldOblique, Bold italic.
Definition: fs_common.h:1412
virtual void Release()=0
A callback function used to release current callback object itself.
Definition: fs_common.h:1879
bool operator==(const Path &other) const
Equal operator.
Font charset: Arabic.
Definition: fs_common.h:1376
LineJoinStyle
Enumeration for line join style.
Definition: fs_common.h:925
Range()
Constructor.
static String FlateCompress(const void *data_buffer, size_t length)
Compress the source data buffer by DEFLATE algorithm.
Font charset: System default, for unknown or mapping purpose.
Definition: fs_common.h:1352
Definition: fs_common.h:465
float line_width
Line width.
Definition: fs_common.h:1042
Winding fill mode, in which the system uses a direction in which a figure is drawn to determine wheth...
Definition: fs_common.h:319
Name for module "XFA".
Definition: fs_common.h:357
Font type: CID font.
Definition: fs_common.h:1450
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
virtual void OnDocOpened(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is opened.
Definition: fs_common.h:1117
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
virtual void OnDocWillOpen()
Triggered when the document will be opened.
Definition: fs_common.h:1105
static bool SetDocEventCallback(DocEventCallback *callback)
Set a DocEventCallback object to Foxit PDF SDK.
Font charset: Russian.
Definition: fs_common.h:1368
bool SetPoint(int index, const PointF &point, PointType type)
Change the value and type of a point specified by index.
static String Base64Decode(const void *encoded_data_buffer, size_t length)
Decode the encoded data buffer by Base64 algorithm.
bool LineTo(const PointF &point)
Add a point to the end of current figure, and a line is to be drawn from current point to the new poi...
Progressive & operator=(const Progressive &other)
Assign operator.
bool operator!=(const Range &other) const
Not equal operator.
static bool UnregisterSecurityCallback(const char *filter)
Unregister a pdf::SecurityCallback object from Foxit PDF SDK.
int face_index
Face index. This is a zero-based index value:
Definition: fs_common.h:1836
~Path()
Destructor.
Definition: fx_coordinates.h:594
Alignment
Enumeration for alignment (horizontal).
Definition: fs_common.h:293
virtual void OnDocWillSave(const pdf::PDFDoc &document)
Triggered when a PDF document will be saved.
Definition: fs_common.h:1135
static bool SetActionCallback(ActionCallback *action_callback)
Set a foxit::ActionCallback object to Foxit PDF SDK, in aid of performing PDF actions.
static bool EnableJavaScript(bool enable_javascript)
Enable or disable javascript for PDF.
State Continue()
Continue the progressive process.
~Range()
Destructor.
Definition: fs_basictypes.h:393
bool operator==(const Font &other) const
Equal operator.
ModuleName
Enumeration for module name which is used in license information.
Definition: fs_common.h:353
Font type: Type3.
Definition: fs_common.h:1448
Standard font: ZapfDingbats.
Definition: fs_common.h:1434
Standard font: Helvetica-Oblique, Italic.
Definition: fs_common.h:1422
Definition: fs_security.h:1226
void RemoveAll()
Remove all range segments.
int GetPointCount()
Get the count of points.
static String GetVersion()
Get the version of current Foxit PDF SDK library.
Indicates that this point is the ending point for a Bezier spline, and this point will also be connec...
Definition: fs_common.h:1904
Standard font: Times-Roman.
Definition: fs_common.h:1424
Font Embed(pdf::PDFDoc document)
Embed current font to the specified PDF document.
WString GetName()
Retrieve the postscript name.
Standard font: Symbol.
Definition: fs_common.h:1432
Rotate 270 degrees in clockwise direction.
Definition: fs_common.h:283
Position: bottom left.
Definition: fs_common.h:341
Font style: fixed pitch.
Definition: fs_common.h:1324
Font charset: Simplified Chinese.
Definition: fs_common.h:1360
Standard font: Times-Italic.
Definition: fs_common.h:1430
Path()
Constructor.
Definition: fs_common.h:1315
Name for module "Redaction".
Definition: fs_common.h:359
Fill mode: none.
Definition: fs_common.h:309
Center alignment.
Definition: fs_common.h:297
No rotation.
Definition: fs_common.h:277
Rotation
Enumeration for rotation.
Definition: fs_common.h:275
FontTypes GetFontType(const pdf::PDFDoc &document)
Get font type.
Foxit namespace.
Definition: fs_compare.h:27
Left alignment.
Definition: fs_common.h:295
Definition: fs_common.h:434
void AddSingle(int index)
Add an index as a new range segment.
Name for module "Comparison".
Definition: fs_common.h:365
float dash_phase
Dash phase for dash pattern.
Definition: fs_common.h:1071
StandardID
Enumeration for standard font ID.
Definition: fs_common.h:1406
All the indexes within a range will be used.
Definition: fs_common.h:1169
BYTE STRING CLASS.
Definition: fx_string.h:317
Progress state: progress is finished.
Definition: fs_common.h:478
Font charset: Hebrew.
Definition: fs_common.h:1374
Charset
Enumeration for font charset.
Definition: fs_common.h:1348
static void Free(void *ptr)
Free a memory block.
Font style: small cap.
Definition: fs_common.h:1338
Font charset: Greek.
Definition: fs_common.h:1370
Font type: Type1.
Definition: fs_common.h:1444
Rotate 90 degrees in clockwise direction.
Definition: fs_common.h:279
virtual void Release()=0
A callback function used to release current callback object itself.
float GetCharWidth(uint32 unicode) const
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode.
Standard font: Helvetica-BoldOblique, Bold italic.
Definition: fs_common.h:1420
static void * Alloc(size_t size)
Allocate a memory block.
bool IsEmpty() const
Check whether current object is empty or not.
Font charset: Baltic.
Definition: fs_common.h:1378
Standard font: Courier.
Definition: fs_common.h:1408
GraphState & operator=(const GraphState &state)
Assign operator.
Definition: fs_common.h:1001
Font charset: Turkish.
Definition: fs_common.h:1372
FontMapResult(foxit::common::file::ReaderCallback *file_read, int face_index)
Constructor, with parameters.
Definition: fs_common.h:1752
Progress state: any error occurs.
Definition: fs_common.h:474
#define NULL
The null-pointer value.
Definition: fx_system.h:767
virtual void OnDocWillDestroy(const pdf::PDFDoc &document)
Triggered when a PDF document will be destroyed.
Definition: fs_common.h:1126
Definition: fx_coordinates.h:1074
Font charset: Eastern European.
Definition: fs_common.h:1366
Path & operator=(const Path &other)
Assign operator.
StandardID GetStandard14Font(const pdf::PDFDoc &document)
Get standard font ID.
RectI GetCharBBox(uint32 unicode) const
Get the bounding box of a character specified by unicode.
Right alignment.
Definition: fs_common.h:299
int GetAscent() const
Get the ascent value, in 1/1000 of em size (PDF units).
Indicates that this point is a control point or ending point for a Bezier spline.
Definition: fs_common.h:1898
bool RemovePoint(int index)
Remove a point specified by index.
Position: top left.
Definition: fs_common.h:329
Font & operator=(const Font &other)
Assign operator.
Position: top center.
Definition: fs_common.h:331
bool IsItalic() const
Judge whether current font object is italic or not.
PointType
Enumeration for point type in path.
Definition: fs_common.h:1886
Standard font: Courier-Oblique, Italic.
Definition: fs_common.h:1414
~GraphState()
Destructor.
Definition: fs_common.h:978
Standard font: Courier-Bold.
Definition: fs_common.h:1410
void AddSegment(int start_index, int end_index, Filter filter=e_All)
Add a new range segment. (Reverse ordering is legal.)
virtual void OnOutOfMemory()=0
A callback function used to notify application when Foxit PDF SDK runs out of memory.
Font charset: Thai.
Definition: fs_common.h:1364
CID Font charset: Adobe-Korea1.
Definition: fs_common.h:1396
void Set(foxit::common::file::ReaderCallback *file_read, int face_index)
Set value.
Definition: fs_common.h:1817
String GetFamilyName()
Retrieve the famliy name.
static bool SetNotifierCallback(NotifierCallback *notifier)
Set a NotifierCallback object to Foxit PDF SDK.
Name for module "RMS".
Definition: fs_common.h:361
bool AppendRect(const RectF &rect)
Add a rectangle figure to the end of current path.
Definition: fx_coordinates.h:769
float miter_limit
The miter limit for line join.
Definition: fs_common.h:1060