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 {
56 typedef enum _Rotation {
67 } Rotation;
68 
74 typedef enum _Alignment {
81 } Alignment;
82 
88 typedef enum _FillMode {
101 } FillMode;
102 
108 typedef enum _Position {
127 } Position;
128 
134 typedef enum _ModuleName {
155 } ModuleName;
156 
162 typedef enum _ColorSpaceType {
190 
191 
192 #define CommonDefines foxit::common
193 
199 class Codec FS_FINAL : public Base {
200  public:
209  static String Base64Encode(const void* data_buffer, size_t length);
210 
219  static String Base64Decode(const void* encoded_data_buffer, size_t length);
220 
229  static String FlateCompress(const void* data_buffer, size_t length);
230 
239  static String FlateDecompress(const void* compressed_data_buffer, size_t length);
240 };
241 
251  public:
257  virtual void Release() = 0;
258 
271  virtual void OnOutOfMemory() = 0;
272 
273  protected:
274  ~NotifierCallback() {}
275 };
276 
281 class Progressive FS_FINAL : public Base {
282  public:
288  typedef enum _State {
290  e_Error = 0,
295  } State;
296 
302  Progressive(const Progressive& other);
304  ~Progressive();
305 
313  Progressive& operator = (const Progressive& other);
314 
323  State Continue();
324 
331  int GetRateOfProgress();
332 
333  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
334  explicit Progressive(FS_HANDLE handle = NULL);
335 };
336 
347 class Library FS_FINAL : public Object {
348  public:
362  static ErrorCode Initialize(const char* sn, const char* key);
363 
372  static ErrorCode Reinitialize();
373 
383  static void Release();
384 
399  static bool HasModuleLicenseRight(common::ModuleName module_name);
400 
406  static String GetVersion();
407 
419  static bool SetCacheSize(uint32 size);
420 
432  static bool EnableJavaScript(bool enable_javascript);
433 
434 #ifndef __EMSCRIPTEN_RENDER__
435 
457  static bool SetAnnotIconProviderCallback(pdf::annots::IconProviderCallback* annot_icon_provider);
458 #endif
459 
470  static bool SetNotifierCallback(NotifierCallback* notifier);
471 
486  static bool SetActionCallback(ActionCallback* action_callback);
487 
496  static bool SetDocEventCallback(DocEventCallback* callback);
497 
530  static bool RegisterSignatureCallback(const char* filter, const char* sub_filter,
531  pdf::SignatureCallback* signature_callback);
532 
567  static bool RegisterSecurityCallback(const char* filter, pdf::SecurityCallback* callback);
568 
587  static bool UnregisterSecurityCallback(const char* filter);
588 
589  #if defined(__ANDROID__) || defined(FS_IOS_) || defined(_SWIG_ANDROID_) || defined(_SWIG_IOS_)
590 
598  static bool IsFipsMode();
599  #endif
600 
601  #ifndef _FX_NO_XFA_
602 
620  #endif
621 
631  static void SetRenderTextGamma(float gamma);
632 
643  static void* Alloc(size_t size);
644 
652  static void Free(void* ptr);
653 
665  static void* Realloc(void* ptr, size_t new_size);
666 
677  static void SetLogFile(const char* log_file_path);
678 
689  static void SetLogFile(const wchar_t* log_file_path);
690 
702  static bool SetFontMapperCallback(FontMapperCallback* callback);
703 
717  static void SetDefaultICCProfilesPath(const wchar_t* icc_profile_folder_path);
718 
719  private:
720  Library(const Library&);
721  Library& operator = (const Library&);
722 };
724 class GraphState FS_FINAL : public Object {
725  public:
732  typedef enum _LineCapStyle {
748  } LineCapStyle;
749 
756  typedef enum _LineJoinStyle {
774  } LineJoinStyle;
775 
776 
792  this->line_width = line_width;
793  this->line_join = line_join;
794  this->miter_limit = miter_limit;
795  this->line_cap = line_cap;
796  this->dash_phase = dash_phase;
797  this->dashes = dashes;
798  }
799 
802  : line_width(1.0f)
804  , miter_limit(10*1.0f)
806  , dash_phase(0) {}
807 
810 
816  GraphState(const GraphState& state) {
817  this->line_width = state.line_width;
818  this->line_join = state.line_join;
819  this->miter_limit = state.miter_limit;
820  this->line_cap = state.line_cap;
821  this->dash_phase = state.dash_phase;
822  this->dashes = state.dashes;
823  }
824 
833  this->line_width = state.line_width;
834  this->line_join = state.line_join;
835  this->miter_limit = state.miter_limit;
836  this->line_cap = state.line_cap;
837  this->dash_phase = state.dash_phase;
838  this->dashes = state.dashes;
839  return *this;
840  }
841 
858  const FloatArray& dashes) {
859  this->line_width = line_width;
860  this->line_join = line_join;
861  this->miter_limit = miter_limit;
862  this->line_cap = line_cap;
863  this->dash_phase = dash_phase;
864  this->dashes = dashes;
865  }
866 
873  float line_width;
891  float miter_limit;
900 
902  float dash_phase;
903 
908 };
909 
916 
923  public:
929  virtual void Release() = 0;
930 
936  virtual void OnDocWillOpen() {}
937 
948  virtual void OnDocOpened(const pdf::PDFDoc& document, ErrorCode error_code) {}
949 
957  virtual void OnDocWillDestroy(const pdf::PDFDoc& document) {}
958 
966  virtual void OnDocWillSave(const pdf::PDFDoc& document) {}
967 
978  virtual void OnDocSaved(const pdf::PDFDoc& document, ErrorCode error_code) {}
979 
980  protected:
981  ~DocEventCallback() {}
982 };
983 
991 class Range FS_FINAL : public Base {
992  public:
998  typedef enum _Filter {
1000  e_All = 0,
1002  e_Even = 1,
1004  e_Odd = 2
1005  } Filter;
1006 
1008  Range();
1009 
1015  explicit Range(int index);
1016 
1029  explicit Range(int start_index, int end_index, Filter filter = e_All);
1030 
1036  Range(const Range& other);
1037 
1039  ~Range();
1040 
1048  Range& operator = (const Range& other);
1049 
1057  bool operator == (const Range& other) const;
1058 
1066  bool operator != (const Range& other) const;
1067 
1075  bool IsEmpty() const;
1076 
1082  void AddSingle( int index );
1083 
1098  void AddSegment( int start_index, int end_index, Filter filter = e_All );
1099 
1105  int GetSegmentCount() const;
1106 
1115  int GetSegmentStart(int segment_index) const;
1116 
1125  int GetSegmentEnd(int segment_index) const;
1126 
1132  void RemoveAll();
1133 
1134  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1135  explicit Range(FS_HANDLE handle);
1136 };
1137 
1146 class Font FS_FINAL : public Base {
1147  public:
1153  typedef enum _Styles {
1157  e_StyleSerif = 0x0002,
1161  e_StyleScript = 0x0008,
1165  e_StyleItalic = 0x0040,
1167  e_StyleAllCap = 0x10000,
1169  e_StylesSmallCap = 0x20000,
1171  e_StylesBold = 0x40000
1172  } Styles;
1173 
1179  typedef enum _Charset {
1210  } Charset;
1211 
1217  typedef enum _CIDCharset {
1230  } CIDCharset;
1231 
1237  typedef enum _StandardID {
1266  } StandardID;
1267 
1273  typedef enum _FontTypes {
1282  } FontTypes;
1283 
1296  Font(const wchar_t* name, uint32 styles, Charset charset, int weight);
1297 
1304  explicit Font(StandardID font_id);
1305 
1315  Font(const char* font_file_path, int face_index, Charset charset);
1316 
1326  Font(const wchar_t* font_file_path, int face_index, Charset charset);
1327 
1328  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1329  explicit Font(FS_HANDLE handle = NULL);
1330 
1336  Font(const Font& other);
1337 
1345  Font& operator = (const Font& other);
1346 
1354  bool operator == (const Font& other) const;
1355 
1363  bool operator != (const Font& other) const;
1364 
1372  bool IsEmpty() const;
1373 
1375  ~Font();
1376 
1382  WString GetName();
1383 
1390 
1396  bool IsBold() const;
1397 
1403  bool IsItalic() const;
1404 
1412  bool IsEmbedded(const pdf::PDFDoc& document);
1413 
1422  bool IsSupportEmbedded(const pdf::PDFDoc& document);
1423 
1431  Font Embed(pdf::PDFDoc document);
1432 
1433 #ifdef _FONT_GETWOFFDATA_
1434 
1441  String GetWoffData(pdf::PDFDoc document);
1442 #endif
1443 
1449  int GetAscent() const;
1450 
1456  int GetDescent() const;
1457 
1465  RectI GetCharBBox(uint32 unicode) const;
1466 
1474  float GetCharWidth(uint32 unicode) const;
1475 
1484  RectI GetCharBBox(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1485 
1494  float GetCharWidth(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1495 
1504  foxit::uint32 GetStyles(const pdf::PDFDoc& document);
1505 
1517  CIDCharset GetCIDCharset(const pdf::PDFDoc& document);
1518 
1526  bool IsStandardFont(const pdf::PDFDoc& document);
1527 
1539  StandardID GetStandard14Font(const pdf::PDFDoc& document);
1540 
1549  FontTypes GetFontType(const pdf::PDFDoc& document);
1550 
1558  String GetBaseFontName(const pdf::PDFDoc& document);
1559 
1568  bool IsVertWriting(const pdf::PDFDoc& document);
1569 };
1570 
1575 class FontMapResult FS_FINAL : public Object {
1576  public:
1579 
1594  this->file_read = file_read;
1595  this->face_index = face_index;
1596  }
1597 
1604  this->file_read = other.file_read;
1605  this->face_index = other.face_index;
1606  }
1607 
1616  this->file_read = other.file_read;
1617  this->face_index = other.face_index;
1618  return *this;
1619  }
1620 
1628  bool operator == (const FontMapResult& other) const {
1629  if (this->file_read != other.file_read || this->face_index != other.face_index)
1630  return false;
1631  return true;
1632  }
1633 
1641  bool operator != (const FontMapResult& other) const {
1642  return !(*this == other);
1643  }
1644 
1659  this->file_read = file_read;
1660  this->face_index = face_index;
1661  }
1662 
1678 };
1679 
1689  public:
1695  virtual void Release() = 0;
1696 
1712  virtual FontMapResult MapFont(const char* font_name, bool is_truetype, uint32 styles,
1713  int weight, int italic_angle, Font::Charset charset) = 0;
1714 
1715  protected:
1716  ~FontMapperCallback() {}
1717 };
1718 
1720 class Path FS_FINAL : public Base {
1721  public:
1727  typedef enum _PointType {
1746  } PointType;
1747 
1749  Path();
1751  ~Path();
1757  Path(const Path& other);
1765  Path& operator=(const Path& other);
1773  bool operator ==(const Path& other) const;
1781  bool operator != (const Path& other) const;
1782 
1790  bool IsEmpty() const;
1791 
1797  int GetPointCount();
1798 
1807  PointF GetPoint(int index);
1808 
1818  PointType GetPointType(int index);
1819 
1831  bool SetPoint(int index, const PointF& point, PointType type);
1832 
1843  bool MoveTo(const PointF& point);
1844 
1854  bool LineTo(const PointF& point);
1855 
1868  bool CubicBezierTo(const PointF& point1, const PointF& point2, const PointF& point3);
1869 
1889  bool CloseFigure();
1890 
1899  bool RemovePoint(int index);
1900 
1908  bool AppendRect(const RectF& rect);
1909 
1917  bool AppendEllipse(const RectF& rect);
1918 
1926  void Transform(const Matrix& matrix);
1932  void Clear();
1933 
1946  void IncreasePointCount(int count);
1947 
1948  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1949  explicit Path(FS_HANDLE handle);
1950 };
1951 
1955 class ColorSpace FS_FINAL : public Base {
1956  public:
1965  typedef enum _RenderingIntent {
1974  } RenderingIntent;
1975 
1976 
1977  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1978  explicit ColorSpace(FS_HANDLE handle);
1979 
1990  ~ColorSpace();
1991 
1997  ColorSpace(const ColorSpace& other);
1998 
2006  ColorSpace& operator=(const ColorSpace& other);
2007 
2016  bool operator==(const ColorSpace& other) const;
2017 
2026  bool operator!=(const ColorSpace& other) const;
2027 
2035  bool IsEmpty() const;
2036 
2044  int GetComponentCount() const;
2045 
2053 
2059  bool IsSpotColorSpace() const;
2060 
2078 
2087  Color ConvertColor(const Color& color);
2088 
2099  Color ConvertColor(int r_value, int g_value, int b_value);
2100 
2112  Color ConvertColor(int c_value, int m_value, int y_value, int k_value);
2113 };
2114 
2118 class Color FS_FINAL : public Base {
2119  public:
2120  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2121  explicit Color(FS_HANDLE handle);
2122 
2124  Color();
2130  explicit Color(const ColorSpace& color_space);
2132  ~Color();
2133 
2139  Color(const Color& other);
2140 
2148  Color& operator=(const Color& other);
2149 
2157  bool operator==(const Color& other) const;
2158 
2166  bool operator!=(const Color& other) const;
2167 
2175  bool IsEmpty() const;
2176 
2183 
2193  FloatArray GetValue() const;
2194 
2207  void SetValue(const FloatArray& component_array);
2208 
2218 
2228 };
2229 } // namespace common
2230 } // namespace foxit
2231 
2232 #endif // FS_COMMON_H_
2233 
CID Font charset: Adobe-CNS1.
Definition: fs_common.h:1223
Definition: fs_annot.h:1672
Font style: non-symbolic.
Definition: fs_common.h:1163
bool IsVertWriting(const pdf::PDFDoc &document)
Check whether current font is vertical writing.
FontMapResult()
Constructor.
Definition: fs_common.h:1578
Indicates that a line is drawn from the previous point to this point, and this point will also be con...
Definition: fs_common.h:1737
Miter line join type.
Definition: fs_common.h:761
Name for module "Optimizer".
Definition: fs_common.h:150
Styles
Enumeration for font styles.
Definition: fs_common.h:1153
LineCapStyle line_cap
Line cap style.
Definition: fs_common.h:899
Color & operator=(const Color &other)
Assign operator.
Standard font: Helvetica-Bold.
Definition: fs_common.h:1249
Font charset: Korean (Wansung).
Definition: fs_common.h:1189
Color space: Separation.
Definition: fs_common.h:178
Bevel line join type.
Definition: fs_common.h:773
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:907
Position: center.
Definition: fs_common.h:118
Font charset: Japanese (Shift-JIS).
Definition: fs_common.h:1187
Definition: fs_common.h:991
bool AppendEllipse(const RectF &rect)
Add an ellipse figure to the end of current path.
Standard font: Times-Bold.
Definition: fs_common.h:1257
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:95
CID Font charset: Unknown.
Definition: fs_common.h:1219
StringArray GetComponentNames() const
Get a string array which represents the name of colorant for Separation color space,...
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:126
Definition: fs_common.h:199
Color ConvertToCMYK(ColorSpace::RenderingIntent intent=ColorSpace::e_RenderIntentRelColorimetric) const
Convert to a CMYK color.
Position
Enumeration for watermark position in a PDF page.
Definition: fs_common.h:108
Definition: fs_common.h:1575
Color ConvertToRGB(ColorSpace::RenderingIntent intent=ColorSpace::e_RenderIntentRelColorimetric) const
Convert to a RGB color.
Projecting square cap. The stroke continues beyond the endpoint of the path for a distance equal to h...
Definition: fs_common.h:747
Definition: fs_common.h:1955
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:217
IFX_Pause PauseCallback
Definition: fs_common.h:915
Color space: CalGray. (1 component, A)
Definition: fs_common.h:172
CID Font charset: Adobe-Japan1.
Definition: fs_common.h:1225
Definition: fs_common.h:347
Round line join type.
Definition: fs_common.h:767
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.
Standard font: Times-BoldItalic.
Definition: fs_common.h:1259
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:790
Font(const wchar_t *name, uint32 styles, Charset charset, int weight)
Constructor, with given attribute.
Unknown rotation.
Definition: fs_common.h:66
Rendering intent: Relative Colorimetric.
Definition: fs_common.h:1969
bool IsBold() const
Judge whether current font is bold or not.
static bool SetFontMapperCallback(FontMapperCallback *callback)
Set a FontMapperCallback object to Foxit PDF SDK.
static String Base64Encode(const void *data_buffer, size_t length)
Encode the source data buffer by Base64 algorithm.
bool operator==(const Color &other) const
Equal operator.
bool operator !=(const Path &other) const
Not equal operator.
Color space: DeviceGray. (1 component, gray)
Definition: fs_common.h:166
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:1004
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:857
Range & operator=(const Range &other)
Assign operator.
PointF GetPoint(int index)
Get a point specified by index.
int GetComponentCount() const
Get the count of components.
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:742
CID Font charset: Adobe-GB1.
Definition: fs_common.h:1221
bool operator !=(const FontMapResult &other) const
Not equal operator.
Definition: fs_common.h:1641
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:62
Name for module "OCR".
Definition: fs_common.h:144
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:1229
void SetValue(const FloatArray &component_array)
Set component value array.
RenderingIntent
Enumeration for rendering intent.
Definition: fs_common.h:1965
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:1167
Filter
Enumeration for range filter.
Definition: fs_common.h:998
~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 IsSpotColorSpace() const
Check whether current color space object is a spot color space or not.
bool operator==(const Range &other) const
Equal operator.
File reading interface.
Definition: fx_stream.h:566
Color space: DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:168
void Clear()
Clear all points.
FloatArray GetValue() const
Get component value array.
CIDCharset
Enumeration for CID font charset.
Definition: fs_common.h:1217
ColorSpace & operator=(const ColorSpace &other)
Assign operator.
WIDE STRING CLASS.
Definition: fx_string.h:1452
GraphState(const GraphState &state)
Constructor, with another graph state object.
Definition: fs_common.h:816
State
Enumeration for progress state.
Definition: fs_common.h:288
(Reserved, currently, this module is not provided) Name for module "LayoutRecognition".
Definition: fs_common.h:154
Font type: TrueType.
Definition: fs_common.h:1277
static void RegisterXFAAppProviderCallback(addon::xfa::AppProviderCallback *callback)
Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK.
Rendering intent: Saturation.
Definition: fs_common.h:1971
Standard font: Helvetica.
Definition: fs_common.h:1247
Position: top right.
Definition: fs_common.h:114
Definition: fs_common.h:922
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:1667
Indicates that the point is the first point of a figure.
Definition: fs_common.h:1729
bool operator==(const FontMapResult &other) const
Equal operator.
Definition: fs_common.h:1628
LineCapStyle
Enumeration for line cap style.
Definition: fs_common.h:732
Font style: script.
Definition: fs_common.h:1161
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:389
static bool SetCacheSize(uint32 size)
Set the upper limit of PDF library cache size.
Color space: DeviceCMYK. (4 components, C, M, Y, K)
Definition: fs_common.h:170
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fs_common.h:2118
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.
bool operator!=(const ColorSpace &other) const
Not equal operator.
Font style: italic.
Definition: fs_common.h:1165
Color space: ICCBased DeviceCMYK. (4 components, C, M, Y, K)
Definition: fs_common.h:188
FontMapResult(const FontMapResult &other)
Constructor, with another font mapping result object.
Definition: fs_common.h:1603
Progressive(const Progressive &other)
Constructor, with another progressive object.
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fs_common.h:1688
FontTypes
Enumeration for font type.
Definition: fs_common.h:1273
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:292
GraphState()
Constructor.
Definition: fs_common.h:801
Position: bottom center.
Definition: fs_common.h:124
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:1338
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:136
bool operator!=(const Color &other) const
Not equal operator.
Font style: serif.
Definition: fs_common.h:1157
Indicates that a line is drawn from the previous point to this point.
Definition: fs_common.h:1731
Name for module "Conversion".
Definition: fs_common.h:152
Color space: ICCBased DeviceGray. (1 component, gray)
Definition: fs_common.h:184
Header file for basic types definitions.
LineJoinStyle line_join
Line join style.
Definition: fs_common.h:881
Position center left.
Definition: fs_common.h:116
Definition: fs_actioncallback.h:142
ColorSpaceType
Enumeration for color space.
Definition: fs_common.h:162
static void SetLogFile(const char *log_file_path)
Set the log file path.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:233
Only even numbers in a range will be used (discards odd numbers).
Definition: fs_common.h:1002
virtual void OnDocSaved(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is saved.
Definition: fs_common.h:978
Font charset: Traditional Chinese.
Definition: fs_common.h:1193
bool operator==(const ColorSpace &other) const
Equal operator.
Font charset: ANSI (United States, Western Europe).
Definition: fs_common.h:1181
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:737
Position: center right.
Definition: fs_common.h:120
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:1185
Color space: ICCBased DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:186
CIDCharset GetCIDCharset(const pdf::PDFDoc &document)
Get CID font charset.
Font style: force bold.
Definition: fs_common.h:1171
FillMode
Enumeration for filling mode type, mainly for path graphics object.
Definition: fs_common.h:88
static void * Realloc(void *ptr, size_t new_size)
Reallocate a memory block.
Name for module "Compliance".
Definition: fs_common.h:148
bool IsEmpty() const
Check whether current object is empty or not.
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:1615
Font style: symbolic.
Definition: fs_common.h:1159
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fx_basic.h:3752
Definition: fs_common.h:724
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:1243
virtual void Release()=0
A callback function used to release current callback object itself.
Definition: fs_common.h:1720
bool operator==(const Path &other) const
Equal operator.
Font charset: Arabic.
Definition: fs_common.h:1207
foxit::common::ColorSpaceType GetColorSpaceType() const
Get color space type.
LineJoinStyle
Enumeration for line join style.
Definition: fs_common.h:756
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:1183
Definition: fs_common.h:281
float line_width
Line width.
Definition: fs_common.h:873
Winding fill mode, in which the system uses a direction in which a figure is drawn to determine wheth...
Definition: fs_common.h:100
Name for module "XFA".
Definition: fs_common.h:138
Font type: CID font.
Definition: fs_common.h:1281
~Color()
Destructor.
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:196
static void SetDefaultICCProfilesPath(const wchar_t *icc_profile_folder_path)
Set path of folder which contains default ICC profile files.
Color space: DeviceN.
Definition: fs_common.h:180
virtual void OnDocOpened(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is opened.
Definition: fs_common.h:948
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
virtual void OnDocWillOpen()
Triggered when the document will be opened.
Definition: fs_common.h:936
static bool SetDocEventCallback(DocEventCallback *callback)
Set a DocEventCallback object to Foxit PDF SDK.
Font charset: Russian.
Definition: fs_common.h:1199
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.
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:1677
~Path()
Destructor.
Definition: fx_coordinates.h:596
Rendering intent: Perceptual.
Definition: fs_common.h:1967
Color()
Construct an empty color.
Alignment
Enumeration for alignment (horizontal).
Definition: fs_common.h:74
virtual void OnDocWillSave(const pdf::PDFDoc &document)
Triggered when a PDF document will be saved.
Definition: fs_common.h:966
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:397
Definition: fs_basictypes.h:226
bool operator==(const Font &other) const
Equal operator.
ModuleName
Enumeration for module name which is used in license information.
Definition: fs_common.h:134
Font type: Type3.
Definition: fs_common.h:1279
Standard font: ZapfDingbats.
Definition: fs_common.h:1265
Standard font: Helvetica-Oblique, Italic.
Definition: fs_common.h:1253
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:1745
Standard font: Times-Roman.
Definition: fs_common.h:1255
Font Embed(pdf::PDFDoc document)
Embed current font to the specified PDF document.
bool operator !=(const Range &other) const
Not equal operator.
WString GetName()
Retrieve the postscript name.
Standard font: Symbol.
Definition: fs_common.h:1263
Rotate 270 degrees in clockwise direction.
Definition: fs_common.h:64
Position: bottom left.
Definition: fs_common.h:122
Font style: fixed pitch.
Definition: fs_common.h:1155
Font charset: Simplified Chinese.
Definition: fs_common.h:1191
Color space: Pattern.
Definition: fs_common.h:182
Standard font: Times-Italic.
Definition: fs_common.h:1261
Color ConvertColor(const Color &color)
Convert input color to the color in current color space.
Path()
Constructor.
Definition: fs_common.h:1146
Color space: Lab. (3 components, A, B, C)
Definition: fs_common.h:176
Name for module "Redaction".
Definition: fs_common.h:140
Color space: Invalid.
Definition: fs_common.h:164
Fill mode: none.
Definition: fs_common.h:90
Center alignment.
Definition: fs_common.h:78
No rotation.
Definition: fs_common.h:58
Rotation
Enumeration for rotation.
Definition: fs_common.h:56
FontTypes GetFontType(const pdf::PDFDoc &document)
Get font type.
Foxit namespace.
Definition: fs_compare.h:27
Left alignment.
Definition: fs_common.h:76
Color space: CalRGB. (3 components, A, B, C)
Definition: fs_common.h:174
Definition: fs_common.h:250
void AddSingle(int index)
Add an index as a new range segment.
Name for module "Comparison".
Definition: fs_common.h:146
float dash_phase
Dash phase for dash pattern.
Definition: fs_common.h:902
StandardID
Enumeration for standard font ID.
Definition: fs_common.h:1237
All the indexes within a range will be used.
Definition: fs_common.h:1000
BYTE STRING CLASS.
Definition: fx_string.h:317
Progress state: progress is finished.
Definition: fs_common.h:294
Font charset: Hebrew.
Definition: fs_common.h:1205
Charset
Enumeration for font charset.
Definition: fs_common.h:1179
static void Free(void *ptr)
Free a memory block.
Font style: small cap.
Definition: fs_common.h:1169
Font charset: Greek.
Definition: fs_common.h:1201
Font type: Type1.
Definition: fs_common.h:1275
Rotate 90 degrees in clockwise direction.
Definition: fs_common.h:60
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:1251
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:1209
Standard font: Courier.
Definition: fs_common.h:1239
GraphState & operator=(const GraphState &state)
Assign operator.
Definition: fs_common.h:832
Font charset: Turkish.
Definition: fs_common.h:1203
FontMapResult(foxit::common::file::ReaderCallback *file_read, int face_index)
Constructor, with parameters.
Definition: fs_common.h:1593
Progress state: any error occurs.
Definition: fs_common.h:290
#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:957
Definition: fx_coordinates.h:1076
Font charset: Eastern European.
Definition: fs_common.h:1197
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:80
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:1739
Rendering intent: Absolute Colorimetric.
Definition: fs_common.h:1973
bool RemovePoint(int index)
Remove a point specified by index.
Position: top left.
Definition: fs_common.h:110
Font & operator=(const Font &other)
Assign operator.
Position: top center.
Definition: fs_common.h:112
bool IsItalic() const
Judge whether current font object is italic or not.
PointType
Enumeration for point type in path.
Definition: fs_common.h:1727
ColorSpace GetColorSpace()
Get the color space that current color belongs to.
Standard font: Courier-Oblique, Italic.
Definition: fs_common.h:1245
~GraphState()
Destructor.
Definition: fs_common.h:809
Standard font: Courier-Bold.
Definition: fs_common.h:1241
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:1195
CID Font charset: Adobe-Korea1.
Definition: fs_common.h:1227
void Set(foxit::common::file::ReaderCallback *file_read, int face_index)
Set value.
Definition: fs_common.h:1658
String GetFamilyName()
Retrieve the famliy name.
bool operator !=(const Font &other) const
Not equal operator.
static bool SetNotifierCallback(NotifierCallback *notifier)
Set a NotifierCallback object to Foxit PDF SDK.
Name for module "RMS".
Definition: fs_common.h:142
bool AppendRect(const RectF &rect)
Add a rectangle figure to the end of current path.
Definition: fx_coordinates.h:771
float miter_limit
The miter limit for line join.
Definition: fs_common.h:891