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 class Color;
32 } // namespace common
33 namespace pdf {
34 namespace annots {
36 } // namespace annots
37 class PDFDoc;
38 class SignatureCallback;
39 class SecurityCallback;
40 } // namespace pdf
41 namespace addon {
42 namespace xfa {
43 class AppProviderCallback;
44 } // namespace xfa
45 } // namespace addon
46 
50 namespace common {
51 #if defined(_SWIG_ANDROID_) || defined(_SWIG_JAVA_)
52 
53 class Constants {
54  public:
60  typedef enum _Rotation {
62  e_Rotation0 = 0,
64  e_Rotation90 = 1,
66  e_Rotation180 = 2,
68  e_Rotation270 = 3,
71  } Rotation;
72 
78  typedef enum _Alignment {
80  e_AlignmentLeft = 0,
85  } Alignment;
86 
92  typedef enum _FillMode {
94  e_FillModeNone = 0,
105  } FillMode;
106 
112  typedef enum _Position {
114  e_PosTopLeft = 0,
116  e_PosTopCenter = 1,
118  e_PosTopRight = 2,
120  e_PosCenterLeft = 3,
122  e_PosCenter = 4,
124  e_PosCenterRight = 5,
126  e_PosBottomLeft = 6,
128  e_PosBottomCenter = 7,
130  e_PosBottomRight = 8
131  } Position;
132 
138  typedef enum _ModuleName {
142  e_ModuleNameXFA = 2,
146  e_ModuleNameRMS = 4,
148  e_ModuleNameOCR = 5,
157  } ModuleName;
158 
164  typedef enum _ColorSpaceType {
176  e_ColorSpaceCalRGB = 5,
178  e_ColorSpaceLab = 6,
184  e_ColorSpacePattern = 11,
191  } ColorSpaceType;
192 
193 };
194 #else
195 #if defined(__ANDROID__) || defined(_JAVA_)
196 
197 class Constants {
198  public:
204  typedef enum _Rotation {
206  e_Rotation0 = 0,
208  e_Rotation90 = 1,
210  e_Rotation180 = 2,
212  e_Rotation270 = 3,
215  } Rotation;
216 
222  typedef enum _Alignment {
224  e_AlignmentLeft = 0,
226  e_AlignmentCenter = 1,
228  e_AlignmentRight = 2
229  } Alignment;
230 
236  typedef enum _FillMode {
238  e_FillModeNone = 0,
249  } FillMode;
250 
256  typedef enum _Position {
258  e_PosTopLeft = 0,
260  e_PosTopCenter = 1,
262  e_PosTopRight = 2,
264  e_PosCenterLeft = 3,
266  e_PosCenter = 4,
268  e_PosCenterRight = 5,
270  e_PosBottomLeft = 6,
272  e_PosBottomCenter = 7,
274  e_PosBottomRight = 8
275  } Position;
276 
282  typedef enum _ModuleName {
286  e_ModuleNameXFA = 2,
290  e_ModuleNameRMS = 4,
292  e_ModuleNameOCR = 5,
301  } ModuleName;
302 
308  typedef enum _ColorSpaceType {
320  e_ColorSpaceCalRGB = 5,
322  e_ColorSpaceLab = 6,
328  e_ColorSpacePattern = 11,
335  } ColorSpaceType;
336 
337 };
338 #endif
339 
344 typedef enum _Rotation {
355 } Rotation;
356 
362 typedef enum _Alignment {
369 } Alignment;
370 
376 typedef enum _FillMode {
389 } FillMode;
390 
396 typedef enum _Position {
415 } Position;
416 
422 typedef enum _ModuleName {
441 } ModuleName;
442 
448 typedef enum _ColorSpaceType {
476 
477 #endif
478 
479 #define CommonDefines foxit::common
480 
486 class Codec FS_FINAL : public Base {
487  public:
496  static String Base64Encode(const void* data_buffer, size_t length);
497 
506  static String Base64Decode(const void* encoded_data_buffer, size_t length);
507 
516  static String FlateCompress(const void* data_buffer, size_t length);
517 
526  static String FlateDecompress(const void* compressed_data_buffer, size_t length);
527 };
528 
538  public:
544  virtual void Release() = 0;
545 
558  virtual void OnOutOfMemory() = 0;
559 
560  protected:
561  ~NotifierCallback() {}
562 };
563 
568 class Progressive FS_FINAL : public Base {
569  public:
575  typedef enum _State {
577  e_Error = 0,
582  } State;
583 
589  Progressive(const Progressive& other);
591  ~Progressive();
592 
600  Progressive& operator = (const Progressive& other);
601 
610  State Continue();
611 
618  int GetRateOfProgress();
619 
620  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
621  explicit Progressive(FS_HANDLE handle = NULL);
622 };
623 
634 class Library FS_FINAL : public Object {
635  public:
649  static ErrorCode Initialize(const char* sn, const char* key);
650 
659  static ErrorCode Reinitialize();
660 
670  static void Release();
671 
686  static bool HasModuleLicenseRight(common::ModuleName module_name);
687 
693  static String GetVersion();
694 
706  static bool SetCacheSize(uint32 size);
707 
719  static bool EnableJavaScript(bool enable_javascript);
720 
721 #ifndef __EMSCRIPTEN_RENDER__
722 
744  static bool SetAnnotIconProviderCallback(pdf::annots::IconProviderCallback* annot_icon_provider);
745 #endif
746 
757  static bool SetNotifierCallback(NotifierCallback* notifier);
758 
773  static bool SetActionCallback(ActionCallback* action_callback);
774 
783  static bool SetDocEventCallback(DocEventCallback* callback);
784 
817  static bool RegisterSignatureCallback(const char* filter, const char* sub_filter,
818  pdf::SignatureCallback* signature_callback);
819 
854  static bool RegisterSecurityCallback(const char* filter, pdf::SecurityCallback* callback);
855 
874  static bool UnregisterSecurityCallback(const char* filter);
875 
876  #if defined(__ANDROID__) || defined(FS_IOS_) || defined(_SWIG_ANDROID_) || defined(_SWIG_IOS_)
877 
885  static bool IsFipsMode();
886  #endif
887 
888  #ifndef _FX_NO_XFA_
889 
907  #endif
908 
918  static void SetRenderTextGamma(float gamma);
919 
930  static void* Alloc(size_t size);
931 
939  static void Free(void* ptr);
940 
952  static void* Realloc(void* ptr, size_t new_size);
953 
964  static void SetLogFile(const char* log_file_path);
965 
976  static void SetLogFile(const wchar_t* log_file_path);
977 
989  static bool SetFontMapperCallback(FontMapperCallback* callback);
990 
991  private:
992  Library(const Library&);
993  Library& operator = (const Library&);
994 };
996 class GraphState FS_FINAL : public Object {
997  public:
1004  typedef enum _LineCapStyle {
1020  } LineCapStyle;
1021 
1028  typedef enum _LineJoinStyle {
1046  } LineJoinStyle;
1047 
1048 
1064  this->line_width = line_width;
1065  this->line_join = line_join;
1066  this->miter_limit = miter_limit;
1067  this->line_cap = line_cap;
1068  this->dash_phase = dash_phase;
1069  this->dashes = dashes;
1070  }
1071 
1074  : line_width(1.0f)
1076  , miter_limit(10*1.0f)
1078  , dash_phase(0) {}
1079 
1082 
1088  GraphState(const GraphState& state) {
1089  this->line_width = state.line_width;
1090  this->line_join = state.line_join;
1091  this->miter_limit = state.miter_limit;
1092  this->line_cap = state.line_cap;
1093  this->dash_phase = state.dash_phase;
1094  this->dashes = state.dashes;
1095  }
1096 
1105  this->line_width = state.line_width;
1106  this->line_join = state.line_join;
1107  this->miter_limit = state.miter_limit;
1108  this->line_cap = state.line_cap;
1109  this->dash_phase = state.dash_phase;
1110  this->dashes = state.dashes;
1111  return *this;
1112  }
1113 
1130  const FloatArray& dashes) {
1131  this->line_width = line_width;
1132  this->line_join = line_join;
1133  this->miter_limit = miter_limit;
1134  this->line_cap = line_cap;
1135  this->dash_phase = dash_phase;
1136  this->dashes = dashes;
1137  }
1138 
1145  float line_width;
1172 
1174  float dash_phase;
1175 
1180 };
1181 
1188 
1195  public:
1201  virtual void Release() = 0;
1202 
1208  virtual void OnDocWillOpen() {}
1209 
1220  virtual void OnDocOpened(const pdf::PDFDoc& document, ErrorCode error_code) {}
1221 
1229  virtual void OnDocWillDestroy(const pdf::PDFDoc& document) {}
1230 
1238  virtual void OnDocWillSave(const pdf::PDFDoc& document) {}
1239 
1250  virtual void OnDocSaved(const pdf::PDFDoc& document, ErrorCode error_code) {}
1251 
1252  protected:
1253  ~DocEventCallback() {}
1254 };
1255 
1263 class Range FS_FINAL : public Base {
1264  public:
1270  typedef enum _Filter {
1272  e_All = 0,
1274  e_Even = 1,
1276  e_Odd = 2
1277  } Filter;
1278 
1280  Range();
1281 
1287  explicit Range(int index);
1288 
1301  explicit Range(int start_index, int end_index, Filter filter = e_All);
1302 
1308  Range(const Range& other);
1309 
1311  ~Range();
1312 
1320  Range& operator = (const Range& other);
1321 
1329  bool operator == (const Range& other) const;
1330 
1338  bool operator != (const Range& other) const;
1339 
1347  bool IsEmpty() const;
1348 
1354  void AddSingle( int index );
1355 
1370  void AddSegment( int start_index, int end_index, Filter filter = e_All );
1371 
1377  int GetSegmentCount() const;
1378 
1387  int GetSegmentStart(int segment_index) const;
1388 
1397  int GetSegmentEnd(int segment_index) const;
1398 
1404  void RemoveAll();
1405 
1406  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1407  explicit Range(FS_HANDLE handle);
1408 };
1409 
1418 class Font FS_FINAL : public Base {
1419  public:
1425  typedef enum _Styles {
1429  e_StyleSerif = 0x0002,
1433  e_StyleScript = 0x0008,
1437  e_StyleItalic = 0x0040,
1439  e_StyleAllCap = 0x10000,
1441  e_StylesSmallCap = 0x20000,
1443  e_StylesBold = 0x40000
1444  } Styles;
1445 
1451  typedef enum _Charset {
1482  } Charset;
1483 
1489  typedef enum _CIDCharset {
1502  } CIDCharset;
1503 
1509  typedef enum _StandardID {
1538  } StandardID;
1539 
1545  typedef enum _FontTypes {
1554  } FontTypes;
1555 
1568  Font(const wchar_t* name, uint32 styles, Charset charset, int weight);
1569 
1576  explicit Font(StandardID font_id);
1577 
1587  Font(const char* font_file_path, int face_index, Charset charset);
1588 
1598  Font(const wchar_t* font_file_path, int face_index, Charset charset);
1599 
1600  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1601  explicit Font(FS_HANDLE handle = NULL);
1602 
1608  Font(const Font& other);
1609 
1617  Font& operator = (const Font& other);
1618 
1626  bool operator == (const Font& other) const;
1627 
1635  bool operator != (const Font& other) const;
1636 
1644  bool IsEmpty() const;
1645 
1647  ~Font();
1648 
1654  WString GetName();
1655 
1662 
1668  bool IsBold() const;
1669 
1675  bool IsItalic() const;
1676 
1684  bool IsEmbedded(const pdf::PDFDoc& document);
1685 
1694  bool IsSupportEmbedded(const pdf::PDFDoc& document);
1695 
1703  Font Embed(pdf::PDFDoc document);
1704 
1705 #ifdef _FONT_GETWOFFDATA_
1706 
1713  String GetWoffData(pdf::PDFDoc document);
1714 #endif
1715 
1721  int GetAscent() const;
1722 
1728  int GetDescent() const;
1729 
1737  RectI GetCharBBox(uint32 unicode) const;
1738 
1746  float GetCharWidth(uint32 unicode) const;
1747 
1756  RectI GetCharBBox(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1757 
1766  float GetCharWidth(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1767 
1776  foxit::uint32 GetStyles(const pdf::PDFDoc& document);
1777 
1789  CIDCharset GetCIDCharset(const pdf::PDFDoc& document);
1790 
1798  bool IsStandardFont(const pdf::PDFDoc& document);
1799 
1811  StandardID GetStandard14Font(const pdf::PDFDoc& document);
1812 
1821  FontTypes GetFontType(const pdf::PDFDoc& document);
1822 
1830  String GetBaseFontName(const pdf::PDFDoc& document);
1831 };
1832 
1837 class FontMapResult FS_FINAL : public Object {
1838  public:
1841 
1856  this->file_read = file_read;
1857  this->face_index = face_index;
1858  }
1859 
1866  this->file_read = other.file_read;
1867  this->face_index = other.face_index;
1868  }
1869 
1878  this->file_read = other.file_read;
1879  this->face_index = other.face_index;
1880  return *this;
1881  }
1882 
1890  bool operator == (const FontMapResult& other) const {
1891  if (this->file_read != other.file_read || this->face_index != other.face_index)
1892  return false;
1893  return true;
1894  }
1895 
1903  bool operator != (const FontMapResult& other) const {
1904  return !(*this == other);
1905  }
1906 
1921  this->file_read = file_read;
1922  this->face_index = face_index;
1923  }
1924 
1940 };
1941 
1951  public:
1957  virtual void Release() = 0;
1958 
1974  virtual FontMapResult MapFont(const char* font_name, bool is_truetype, uint32 styles,
1975  int weight, int italic_angle, Font::Charset charset) = 0;
1976 
1977  protected:
1978  ~FontMapperCallback() {}
1979 };
1980 
1982 class Path FS_FINAL : public Base {
1983  public:
1989  typedef enum _PointType {
2008  } PointType;
2009 
2011  Path();
2013  ~Path();
2019  Path(const Path& other);
2027  Path& operator=(const Path& other);
2035  bool operator ==(const Path& other) const;
2043  bool operator != (const Path& other) const;
2044 
2052  bool IsEmpty() const;
2053 
2059  int GetPointCount();
2060 
2069  PointF GetPoint(int index);
2070 
2080  PointType GetPointType(int index);
2081 
2093  bool SetPoint(int index, const PointF& point, PointType type);
2094 
2105  bool MoveTo(const PointF& point);
2106 
2116  bool LineTo(const PointF& point);
2117 
2130  bool CubicBezierTo(const PointF& point1, const PointF& point2, const PointF& point3);
2131 
2151  bool CloseFigure();
2152 
2161  bool RemovePoint(int index);
2162 
2170  bool AppendRect(const RectF& rect);
2171 
2179  bool AppendEllipse(const RectF& rect);
2180 
2188  void Transform(const Matrix& matrix);
2194  void Clear();
2195 
2208  void IncreasePointCount(int count);
2209 
2210  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2211  explicit Path(FS_HANDLE handle);
2212 };
2213 
2217 class ColorSpace FS_FINAL : public Base {
2218  public:
2227  typedef enum _RenderingIntent {
2236  } RenderingIntent;
2237 
2238 
2239  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2240  explicit ColorSpace(FS_HANDLE handle);
2241 
2252  ~ColorSpace();
2253 
2259  ColorSpace(const ColorSpace& other);
2260 
2268  ColorSpace& operator=(const ColorSpace& other);
2269 
2278  bool operator==(const ColorSpace& other) const;
2279 
2288  bool operator!=(const ColorSpace& other) const;
2289 
2297  bool IsEmpty() const;
2298 
2306  int GetComponentCount() const;
2307 
2315 
2324  Color ConvertColor(const Color& color);
2325 
2336  Color ConvertColor(int r_value, int g_value, int b_value);
2337 
2349  Color ConvertColor(int c_value, int m_value, int y_value, int k_value);
2350 };
2351 
2355 class Color FS_FINAL : public Base {
2356  public:
2357  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2358  explicit Color(FS_HANDLE handle);
2359 
2361  Color();
2367  explicit Color(const ColorSpace& color_space);
2369  ~Color();
2370 
2376  Color(const Color& other);
2377 
2385  Color& operator=(const Color& other);
2386 
2394  bool operator==(const Color& other) const;
2395 
2403  bool operator!=(const Color& other) const;
2404 
2412  bool IsEmpty() const;
2413 
2420 
2430  FloatArray GetValue() const;
2431 
2444  void SetValue(const FloatArray& component_array);
2445 
2455 
2465 };
2466 } // namespace common
2467 } // namespace foxit
2468 
2469 #endif // FS_COMMON_H_
2470 
Definition: fs_common.h:1950
Font charset: ANSI (United States, Western Europe).
Definition: fs_common.h:1453
LineCapStyle
Enumeration for line cap style.
Definition: fs_common.h:1004
Standard font: Times-BoldItalic.
Definition: fs_common.h:1531
void Transform(const Matrix &matrix)
Transform all points in current path with a given matrix.
bool AppendRect(const RectF &rect)
Add a rectangle figure to the end of current path.
Position center left.
Definition: fs_common.h:404
Winding fill mode, in which the system uses a direction in which a figure is drawn to determine wheth...
Definition: fs_common.h:388
PointType GetPointType(int index)
Get the type of a point specified by index.
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...
Font & operator=(const Font &other)
Assign operator.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
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...
int GetAscent() const
Get the ascent value, in 1/1000 of em size (PDF units).
Font charset: Turkish.
Definition: fs_common.h:1475
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:1929
Definition: fs_actioncallback.h:142
Font charset: Eastern European.
Definition: fs_common.h:1469
Color space: Pattern.
Definition: fs_common.h:468
LineJoinStyle
Enumeration for line join style.
Definition: fs_common.h:1028
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...
bool operator==(const FontMapResult &other) const
Equal operator.
Definition: fs_common.h:1890
Definition: fs_common.h:2355
Definition: fs_common.h:2217
Color space: DeviceN.
Definition: fs_common.h:466
bool operator !=(const Path &other) const
Not equal operator.
bool IsEmbedded(const pdf::PDFDoc &document)
Judge whether current font is embedded in a specified PDF document or not.
StandardID
Enumeration for standard font ID.
Definition: fs_common.h:1509
Fill mode: none.
Definition: fs_common.h:378
Font charset: Arabic.
Definition: fs_common.h:1479
Definition: fs_common.h:1194
Font charset: Russian.
Definition: fs_common.h:1471
LineCapStyle line_cap
Line cap style.
Definition: fs_common.h:1171
void AddSegment(int start_index, int end_index, Filter filter=e_All)
Add a new range segment. (Reverse ordering is legal.)
~Range()
Destructor.
Position
Enumeration for watermark position in a PDF page.
Definition: fs_common.h:396
bool operator==(const ColorSpace &other) const
Equal operator.
Font charset: Traditional Chinese.
Definition: fs_common.h:1465
FontTypes
Enumeration for font type.
Definition: fs_common.h:1545
bool IsEmpty() const
Check whether current object is empty or not.
static bool SetDocEventCallback(DocEventCallback *callback)
Set a DocEventCallback object to Foxit PDF SDK.
Rotate 90 degrees in clockwise direction.
Definition: fs_common.h:348
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
Font type: Type3.
Definition: fs_common.h:1551
Rendering intent: Absolute Colorimetric.
Definition: fs_common.h:2235
Definition: fs_common.h:996
Standard font: Courier-Bold.
Definition: fs_common.h:1513
No rotation.
Definition: fs_common.h:346
Definition: fs_common.h:568
Font style: small cap.
Definition: fs_common.h:1441
Position: bottom left.
Definition: fs_common.h:410
static void * Alloc(size_t size)
Allocate a memory block.
PointType
Enumeration for point type in path.
Definition: fs_common.h:1989
Standard font: Times-Italic.
Definition: fs_common.h:1533
bool CloseFigure()
Close current figure (which is also the last figure in current path).
GraphState & operator=(const GraphState &state)
Assign operator.
Definition: fs_common.h:1104
Font style: all cap.
Definition: fs_common.h:1439
static bool SetFontMapperCallback(FontMapperCallback *callback)
Set a FontMapperCallback object to Foxit PDF SDK.
Color space: CalRGB. (3 components, A, B, C)
Definition: fs_common.h:460
Range()
Constructor.
virtual void OnOutOfMemory()=0
A callback function used to notify application when Foxit PDF SDK runs out of memory.
int GetRateOfProgress()
Get the rate of current progress.
Standard font: Courier-Oblique, Italic.
Definition: fs_common.h:1517
Definition: fs_common.h:634
Definition: fs_common.h:537
bool IsItalic() const
Judge whether current font object is italic or not.
bool operator !=(const Range &other) const
Not equal operator.
Right alignment.
Definition: fs_common.h:368
void Set(foxit::common::file::ReaderCallback *file_read, int face_index)
Set value.
Definition: fs_common.h:1920
CID Font charset: Adobe-Korea1.
Definition: fs_common.h:1499
PointF GetPoint(int index)
Get a point specified by index.
void AddSingle(int index)
Add an index as a new range segment.
static String FlateDecompress(const void *compressed_data_buffer, size_t length)
Decompress the compressed data buffer by DEFLATE algorithm.
void SetValue(const FloatArray &component_array)
Set component value array.
CID Font charset: Adobe-Japan1.
Definition: fs_common.h:1497
WString GetName()
Retrieve the postscript name.
virtual void OnDocOpened(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is opened.
Definition: fs_common.h:1220
ColorSpace GetColorSpace()
Get the color space that current color belongs to.
FontMapResult(const FontMapResult &other)
Constructor, with another font mapping result object.
Definition: fs_common.h:1865
static String Base64Encode(const void *data_buffer, size_t length)
Encode the source data buffer by Base64 algorithm.
Color space: Invalid.
Definition: fs_common.h:450
Standard font: Helvetica-Oblique, Italic.
Definition: fs_common.h:1525
void RemoveAll()
Remove all range segments.
Name for module "Comparison".
Definition: fs_common.h:434
float miter_limit
The miter limit for line join.
Definition: fs_common.h:1163
bool IsEmpty() const
Check whether current object is empty or not.
Font(const wchar_t *name, uint32 styles, Charset charset, int weight)
Constructor, with given attribute.
Alignment
Enumeration for alignment (horizontal).
Definition: fs_common.h:362
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.
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:1062
File reading interface.
Definition: fx_stream.h:566
Font style: force bold.
Definition: fs_common.h:1443
Font charset: Korean (Wansung).
Definition: fs_common.h:1461
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...
Font Embed(pdf::PDFDoc document)
Embed current font to the specified PDF document.
static ErrorCode Initialize(const char *sn, const char *key)
Initialize Foxit PDF SDK Library, with valid license information.
Rotate 270 degrees in clockwise direction.
Definition: fs_common.h:352
Header file for file operation related definitions and functions.
Font charset: Japanese (Shift-JIS).
Definition: fs_common.h:1459
Font charset: Simplified Chinese.
Definition: fs_common.h:1463
Font style: symbolic.
Definition: fs_common.h:1431
Color ConvertToRGB(ColorSpace::RenderingIntent intent=ColorSpace::e_RenderIntentRelColorimetric) const
Convert to a RGB color.
String GetBaseFontName(const pdf::PDFDoc &document)
Get base font name.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:236
Rendering intent: Perceptual.
Definition: fs_common.h:2229
Header file for basic types definitions.
bool operator==(const Path &other) const
Equal operator.
static void SetLogFile(const char *log_file_path)
Set the log file path.
Definition: fs_common.h:486
CID Font charset: Adobe-CNS1.
Definition: fs_common.h:1495
Name for module "Redaction".
Definition: fs_common.h:428
Color ConvertColor(const Color &color)
Convert input color to the color in current color space.
float dash_phase
Dash phase for dash pattern.
Definition: fs_common.h:1174
Left alignment.
Definition: fs_common.h:364
Progressive & operator=(const Progressive &other)
Assign operator.
bool IsSupportEmbedded(const pdf::PDFDoc &document)
Check whether current font is supported to be embedded to the specified PDF document or not.
static void SetRenderTextGamma(float gamma)
Set gamma value for text rendering.
Definition: fs_common.h:1982
Round line join type.
Definition: fs_common.h:1039
Center alignment.
Definition: fs_common.h:366
~Color()
Destructor.
static bool SetCacheSize(uint32 size)
Set the upper limit of PDF library cache size.
virtual void Release()=0
A callback function used to release current callback object itself.
CIDCharset
Enumeration for CID font charset.
Definition: fs_common.h:1489
Font style: italic.
Definition: fs_common.h:1437
float GetCharWidth(uint32 unicode) const
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode.
Name for module "RMS".
Definition: fs_common.h:430
bool IsEmpty() const
Check whether current object is empty or not.
StandardID GetStandard14Font(const pdf::PDFDoc &document)
Get standard font ID.
int GetSegmentStart(int segment_index) const
Get the start index of a specified range segment.
RectI GetCharBBox(uint32 unicode) const
Get the bounding box of a character specified by unicode.
CID Font charset: Adobe-GB1.
Definition: fs_common.h:1493
Position: bottom right.
Definition: fs_common.h:414
int GetComponentCount() const
Get the count of components.
virtual void OnDocWillDestroy(const pdf::PDFDoc &document)
Triggered when a PDF document will be destroyed.
Definition: fs_common.h:1229
int GetSegmentEnd(int segment_index) const
Get the end index of a specified range segment.
Standard font: Times-Roman.
Definition: fs_common.h:1527
Position: center.
Definition: fs_common.h:406
bool operator==(const Range &other) const
Equal operator.
FontMapResult & operator=(const FontMapResult &other)
Assign operator.
Definition: fs_common.h:1877
Position: top left.
Definition: fs_common.h:398
bool SetPoint(int index, const PointF &point, PointType type)
Change the value and type of a point specified by index.
ColorSpaceType
Enumeration for color space.
Definition: fs_common.h:448
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:1276
bool AppendEllipse(const RectF &rect)
Add an ellipse figure to the end of current path.
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:1129
bool operator !=(const FontMapResult &other) const
Not equal operator.
Definition: fs_common.h:1903
virtual void OnDocWillSave(const pdf::PDFDoc &document)
Triggered when a PDF document will be saved.
Definition: fs_common.h:1238
Definition: fs_security.h:1226
int face_index
Face index. This is a zero-based index value:
Definition: fs_common.h:1939
Round cap. A semicircular arc with a diameter equal to the line width is drawn around the endpoint an...
Definition: fs_common.h:1014
Color space: Lab. (3 components, A, B, C)
Definition: fs_common.h:462
foxit::common::ColorSpaceType GetColorSpaceType() const
Get color space type.
Charset
Enumeration for font charset.
Definition: fs_common.h:1451
Position: top center.
Definition: fs_common.h:400
Color & operator=(const Color &other)
Assign operator.
BYTE STRING CLASS.
Definition: fx_string.h:317
Definition: fs_common.h:1837
void Clear()
Clear all points.
Indicates that this point is a control point or ending point for a Bezier spline.
Definition: fs_common.h:2001
Color space: CalGray. (1 component, A)
Definition: fs_common.h:458
Font style: script.
Definition: fs_common.h:1433
Standard font: Helvetica.
Definition: fs_common.h:1519
Indicates that a line is drawn from the previous point to this point, and this point will also be con...
Definition: fs_common.h:1999
bool operator!=(const Color &other) const
Not equal operator.
Definition: fx_coordinates.h:30
Name for module "Optimizer".
Definition: fs_common.h:438
static void Release()
Release all resource allocated by Foxit PDF SDK Library.
Alternate fill mode, in which the system fills this area between odd-numbered and even-numbered polyg...
Definition: fs_common.h:383
bool operator !=(const Font &other) const
Not equal operator.
Path & operator=(const Path &other)
Assign operator.
Rotation
Enumeration for rotation.
Definition: fs_common.h:344
static String Base64Decode(const void *encoded_data_buffer, size_t length)
Decode the encoded data buffer by Base64 algorithm.
Unknown rotation.
Definition: fs_common.h:354
int GetPointCount()
Get the count of points.
Color()
Construct an empty color.
Indicates that a line is drawn from the previous point to this point.
Definition: fs_common.h:1993
Font style: fixed pitch.
Definition: fs_common.h:1427
Name for module "OCR".
Definition: fs_common.h:432
Color space: Separation.
Definition: fs_common.h:464
FillMode
Enumeration for filling mode type, mainly for path graphics object.
Definition: fs_common.h:376
static void RegisterXFAAppProviderCallback(addon::xfa::AppProviderCallback *callback)
Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK.
static bool EnableJavaScript(bool enable_javascript)
Enable or disable javascript for PDF.
Styles
Enumeration for font styles.
Definition: fs_common.h:1425
virtual void Release()=0
A callback function used to release current callback object itself.
Color space: DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:454
Font charset: Hebrew.
Definition: fs_common.h:1477
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:1179
Font type: CID font.
Definition: fs_common.h:1553
Foxit namespace.
Definition: fs_compare.h:27
~GraphState()
Destructor.
Definition: fs_common.h:1081
FontMapResult(foxit::common::file::ReaderCallback *file_read, int face_index)
Constructor, with parameters.
Definition: fs_common.h:1855
Range & operator=(const Range &other)
Assign operator.
Font style: serif.
Definition: fs_common.h:1429
Progress state: any error occurs.
Definition: fs_common.h:577
Font type: TrueType.
Definition: fs_common.h:1549
Font charset: Baltic.
Definition: fs_common.h:1481
Font charset: Greek.
Definition: fs_common.h:1473
void IncreasePointCount(int count)
Increase the point count and prepare adequate memory for these new points.
Standard font: Courier.
Definition: fs_common.h:1511
float line_width
Line width.
Definition: fs_common.h:1145
Rendering intent: Saturation.
Definition: fs_common.h:2233
bool IsStandardFont(const pdf::PDFDoc &document)
Check whether current font is a standard font.
Definition: fx_basic.h:3752
bool operator!=(const ColorSpace &other) const
Not equal operator.
Font style: non-symbolic.
Definition: fs_common.h:1435
foxit::uint32 GetStyles(const pdf::PDFDoc &document)
Get font styles.
Color space: DeviceCMYK. (4 components, C, M, Y, K)
Definition: fs_common.h:456
Color space: DeviceGray. (1 component, gray)
Definition: fs_common.h:452
Bevel line join type.
Definition: fs_common.h:1045
Standard font: Helvetica-Bold.
Definition: fs_common.h:1521
Progressive(const Progressive &other)
Constructor, with another progressive object.
Color ConvertToCMYK(ColorSpace::RenderingIntent intent=ColorSpace::e_RenderIntentRelColorimetric) const
Convert to a CMYK color.
Standard font: ZapfDingbats.
Definition: fs_common.h:1537
static String FlateCompress(const void *data_buffer, size_t length)
Compress the source data buffer by DEFLATE algorithm.
static bool SetActionCallback(ActionCallback *action_callback)
Set a foxit::ActionCallback object to Foxit PDF SDK, in aid of performing PDF actions.
virtual void Release()=0
A callback function used to release current callback object itself.
GraphState()
Constructor.
Definition: fs_common.h:1073
All the indexes within a range will be used.
Definition: fs_common.h:1272
#define NULL
The null-pointer value.
Definition: fx_system.h:767
Position: bottom center.
Definition: fs_common.h:412
Butt cap. The stroke is squared off at the endpoint of a path. There is no projection beyond the end ...
Definition: fs_common.h:1009
Definition: fx_coordinates.h:771
Font charset: Thai.
Definition: fs_common.h:1467
static String GetVersion()
Get the version of current Foxit PDF SDK library.
String GetFamilyName()
Retrieve the famliy name.
Definition: fs_pdfdoc.h:389
Projecting square cap. The stroke continues beyond the endpoint of the path for a distance equal to h...
Definition: fs_common.h:1019
bool operator==(const Color &other) const
Equal operator.
static bool UnregisterSecurityCallback(const char *filter)
Unregister a pdf::SecurityCallback object from Foxit PDF SDK.
Definition: fs_annot.h:1461
CID Font charset: Unicode.
Definition: fs_common.h:1501
Indicates that this point is the ending point for a Bezier spline, and this point will also be connec...
Definition: fs_common.h:2007
State
Enumeration for progress state.
Definition: fs_common.h:575
Position: top right.
Definition: fs_common.h:402
Miter line join type.
Definition: fs_common.h:1033
FontMapResult()
Constructor.
Definition: fs_common.h:1840
bool MoveTo(const PointF &point)
Add a point to the end of current path, to start a new figure.
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...
Only even numbers in a range will be used (discards odd numbers).
Definition: fs_common.h:1274
Name for module "Conversion".
Definition: fs_common.h:440
CIDCharset GetCIDCharset(const pdf::PDFDoc &document)
Get CID font charset.
ModuleName
Enumeration for module name which is used in license information.
Definition: fs_common.h:422
Standard font: Symbol.
Definition: fs_common.h:1535
Rotate 180 degrees in clockwise direction.
Definition: fs_common.h:350
State Continue()
Continue the progressive process.
Font charset: Standard symbols.
Definition: fs_common.h:1457
(Reserved, currently, this module is not provided) Name for module "ConnectedPDF".
Definition: fs_common.h:424
Progress state: progress needs to be continued.
Definition: fs_common.h:579
Definition: fx_coordinates.h:596
~Path()
Destructor.
int GetDescent() const
Get the descent value, in 1/1000 of em size (PDF units).
Font type: Type1.
Definition: fs_common.h:1547
Definition: fs_common.h:1418
static void * Realloc(void *ptr, size_t new_size)
Reallocate a memory block.
static bool SetNotifierCallback(NotifierCallback *notifier)
Set a NotifierCallback object to Foxit PDF SDK.
Name for module "Compliance".
Definition: fs_common.h:436
Definition: fx_coordinates.h:1076
static void Free(void *ptr)
Free a memory block.
ColorSpace & operator=(const ColorSpace &other)
Assign operator.
int GetSegmentCount() const
Get the count of range segments.
bool RemovePoint(int index)
Remove a point specified by index.
bool IsBold() const
Judge whether current font is bold or not.
Rendering intent: Relative Colorimetric.
Definition: fs_common.h:2231
FontTypes GetFontType(const pdf::PDFDoc &document)
Get font type.
static bool SetAnnotIconProviderCallback(pdf::annots::IconProviderCallback *annot_icon_provider)
Set a customized pdf::annots::IconProviderCallback object to Foxit PDF SDK.
Progress state: progress is finished.
Definition: fs_common.h:581
Font charset: System default, for unknown or mapping purpose.
Definition: fs_common.h:1455
static ErrorCode Reinitialize()
Reinitialize Foxit PDF SDK Library.
Definition: fs_signature.h:1270
WIDE STRING CLASS.
Definition: fx_string.h:1452
Position: center right.
Definition: fs_common.h:408
RenderingIntent
Enumeration for rendering intent.
Definition: fs_common.h:2227
Color space: ICCBased DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:472
Definition: fs_common.h:1263
FloatArray GetValue() const
Get component value array.
Filter
Enumeration for range filter.
Definition: fs_common.h:1270
virtual void OnDocSaved(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is saved.
Definition: fs_common.h:1250
Color space: ICCBased DeviceGray. (1 component, gray)
Definition: fs_common.h:470
bool IsEmpty() const
Check whether current object is empty or not.
GraphState(const GraphState &state)
Constructor, with another graph state object.
Definition: fs_common.h:1088
Standard font: Times-Bold.
Definition: fs_common.h:1529
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
~Font()
Destructor.
Standard font: Courier-BoldOblique, Bold italic.
Definition: fs_common.h:1515
Definition: fs_basictypes.h:399
Standard font: Helvetica-BoldOblique, Bold italic.
Definition: fs_common.h:1523
Name for module "XFA".
Definition: fs_common.h:426
bool operator==(const Font &other) const
Equal operator.
IFX_Pause PauseCallback
Definition: fs_common.h:1187
Color space: ICCBased DeviceCMYK. (4 components, C, M, Y, K)
Definition: fs_common.h:474
CID Font charset: Unknown.
Definition: fs_common.h:1491
LineJoinStyle line_join
Line join style.
Definition: fs_common.h:1153
Path()
Constructor.
bool IsEmpty() const
Check whether current object is empty or not.
Indicates that the point is the first point of a figure.
Definition: fs_common.h:1991
virtual void OnDocWillOpen()
Triggered when the document will be opened.
Definition: fs_common.h:1208