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 class TimeStampCallback;
41 } // namespace pdf
42 namespace addon {
43 namespace xfa {
44 class AppProviderCallback;
45 } // namespace xfa
46 } // namespace addon
47 
51 namespace common {
57 typedef enum _Rotation {
68 } Rotation;
69 
76 typedef enum _RotationPointOptions {
88 
94 typedef enum _Alignment {
101 } Alignment;
102 
108 typedef enum _FillMode {
121 } FillMode;
122 
128 typedef enum _Position {
147 } Position;
148 
154 typedef enum _ModuleName {
193 } ModuleName;
194 
200 typedef enum _ColorSpaceType {
232 
238 typedef enum _LocaleID {
257 } LocaleID;
258 
264 typedef enum _FileFormatType {
282 
283 
284 #define CommonDefines foxit::common
285 
291 class Codec FS_FINAL : public Base {
292  public:
301  static String Base64Encode(const void* data_buffer, size_t length);
302 
311  static String Base64Decode(const void* encoded_data_buffer, size_t length);
312 
321  static String FlateCompress(const void* data_buffer, size_t length);
322 
331  static String FlateDecompress(const void* compressed_data_buffer, size_t length);
332 };
333 
343  public:
349  virtual void Release() = 0;
350 
363  virtual void OnOutOfMemory() = 0;
364 
365  protected:
366  ~NotifierCallback() {}
367 };
368 
373 class Progressive FS_FINAL : public Base {
374  public:
380  typedef enum _State {
382  e_Error = 0,
387  } State;
388 
394  Progressive(const Progressive& other);
396  ~Progressive();
397 
405  Progressive& operator = (const Progressive& other);
406 
415  State Continue();
416 
423  int GetRateOfProgress();
424 
425  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
426  explicit Progressive(FS_HANDLE handle = NULL);
427 };
432 class RenderConfig FS_FINAL : public Object {
433  public:
441 
444 
452  RenderConfig& operator = (const RenderConfig& render_config) {
454  return *this;
455  }
456 
464  bool operator == (const RenderConfig& render_config) const {
466  return true;
467  return false;
468  }
469 
477  bool operator != (const RenderConfig& render_config) const {
479  return true;
480  return false;
481  }
482 
492  this->graphics_objs_count_in_one_step = graphics_objs_count_in_one_step;
493  }
494 
508 };
509 
526 class Library FS_FINAL : public Object {
527  public:
544  static ErrorCode Initialize(const char* sn, const char* key);
545 
546 #if !defined(_SWIG_ANDROID_) && !defined(_SWIG_IOS_) && !defined(_SWIG_JAVA_) && !defined(_SWIG_DOTNET_) && !defined(_SWIG_MACOC_) && !defined(_SWIG_PYTHON_) && !defined(_SWIG_NODEJS_) && !defined(_SWIG_GO_)
547 
564 #if _FX_OS_ == _FX_IOS_ || _FX_OS_ == _FX_ANDROID_
565  static ErrorCode InitializeWithAppName(const char* sn, const char* key, const char* app_name);
566 #endif
567 #endif
568 
590  static ErrorCode Initialize(const char* sn, const char* key, bool is_optimize_memory, bool enable_js_xfa_threadsafety = false);
591 
603  static ErrorCode Reinitialize();
604 
614  static void Release();
615 
630  static bool HasModuleLicenseRight(common::ModuleName module_name);
631 
637  static String GetVersion();
638 
650  static bool SetCacheSize(uint32 size);
651 
663  static bool EnableJavaScript(bool enable_javascript);
664 
665 #ifndef __EMSCRIPTEN_RENDER__
666 
688  static bool SetAnnotIconProviderCallback(pdf::annots::IconProviderCallback* annot_icon_provider);
689 #endif
690 
702  static bool SetNotifierCallback(NotifierCallback* notifier);
703 
718  static bool SetActionCallback(ActionCallback* action_callback);
719 
728  static bool SetDocEventCallback(DocEventCallback* callback);
729 
766  static bool RegisterSignatureCallback(const char* filter, const char* sub_filter,
767  pdf::SignatureCallback* signature_callback);
768 
790  static void UnregisterSignatureCallback(const char* filter, const char* sub_filter);
791 
826  static bool RegisterSecurityCallback(const char* filter, pdf::SecurityCallback* callback);
827 
846  static bool UnregisterSecurityCallback(const char* filter);
847 
867  static bool SetTimeStampCallback(pdf::TimeStampCallback* timestamp_callback);
868 
869  #ifndef _FX_NO_XFA_
870 
888 
889  #endif
890 
900  static void SetRenderTextGamma(float gamma);
901 
912  static void* Alloc(size_t size);
913 
921  static void Free(void* ptr);
922 
934  static void* Realloc(void* ptr, size_t new_size);
935 
946  static void SetLogFile(const char* log_file_path);
947 
958  static void SetLogFile(const wchar_t* log_file_path);
959 
970  static void SetLogFile(foxit::common::file::StreamCallback* log_file);
971 
977  static foxit::ErrorCode FlushLog();
978 
990  static bool SetFontMapperCallback(FontMapperCallback* callback);
991 
1005  static void SetDefaultICCProfilesPath(const wchar_t* icc_profile_folder_path);
1006 
1012  static RenderConfig GetRenderConfig();
1013 
1021  static void SetRenderConfig(const RenderConfig& render_config);
1022 
1038  static void EnableThreadSafety(bool is_enable_thread_safety);
1039 
1040 #if defined(_WIN32) || defined(_WIN64)|| defined(__linux__)
1041 
1057  static ErrorCode InitializeOFDEngine(const char* ofd_library_path);
1058 
1067  static void ReleaseOFDEngine();
1068 #endif
1069 
1077  static WString ExecuteJavaScript(const wchar_t* java_script);
1078 
1079  private:
1080  Library(const Library&);
1081  Library& operator = (const Library&);
1082 };
1084 class GraphState FS_FINAL : public Object {
1085  public:
1092  typedef enum _LineCapStyle {
1108  } LineCapStyle;
1109 
1116  typedef enum _LineJoinStyle {
1134  } LineJoinStyle;
1135 
1136 
1152  this->line_width = line_width;
1153  this->line_join = line_join;
1154  this->miter_limit = miter_limit;
1155  this->line_cap = line_cap;
1156  this->dash_phase = dash_phase;
1157  this->dashes = dashes;
1158  }
1159 
1162  : line_width(1.0f)
1164  , miter_limit(10*1.0f)
1166  , dash_phase(0) {}
1167 
1173  GraphState(const GraphState& state) {
1174  this->line_width = state.line_width;
1175  this->line_join = state.line_join;
1176  this->miter_limit = state.miter_limit;
1177  this->line_cap = state.line_cap;
1178  this->dash_phase = state.dash_phase;
1179  this->dashes = state.dashes;
1180  }
1181 
1190  this->line_width = state.line_width;
1191  this->line_join = state.line_join;
1192  this->miter_limit = state.miter_limit;
1193  this->line_cap = state.line_cap;
1194  this->dash_phase = state.dash_phase;
1195  this->dashes = state.dashes;
1196  return *this;
1197  }
1198 
1215  const FloatArray& dashes) {
1216  this->line_width = line_width;
1217  this->line_join = line_join;
1218  this->miter_limit = miter_limit;
1219  this->line_cap = line_cap;
1220  this->dash_phase = dash_phase;
1221  this->dashes = dashes;
1222  }
1223 
1230  float line_width;
1257 
1259  float dash_phase;
1260 
1265 };
1266 
1273 
1280  public:
1286  virtual void Release() = 0;
1287 
1293  virtual void OnDocWillOpen() {}
1294 
1305  virtual void OnDocOpened(const pdf::PDFDoc& document, ErrorCode error_code) {}
1306 
1314  virtual void OnDocWillDestroy(const pdf::PDFDoc& document) {}
1315 
1323  virtual void OnDocWillSave(const pdf::PDFDoc& document) {}
1324 
1335  virtual void OnDocSaved(const pdf::PDFDoc& document, ErrorCode error_code) {}
1336 
1337  protected:
1338  ~DocEventCallback() {}
1339 };
1340 
1348 class Range FS_FINAL : public Base {
1349  public:
1355  typedef enum _Filter {
1357  e_All = 0,
1359  e_Even = 1,
1361  e_Odd = 2
1362  } Filter;
1363 
1365  Range();
1366 
1372  explicit Range(int index);
1373 
1386  explicit Range(int start_index, int end_index, Filter filter = e_All);
1387 
1393  Range(const Range& other);
1394 
1396  ~Range();
1397 
1405  Range& operator = (const Range& other);
1406 
1414  bool operator == (const Range& other) const;
1415 
1423  bool operator != (const Range& other) const;
1424 
1432  bool IsEmpty() const;
1433 
1439  void AddSingle( int index );
1440 
1455  void AddSegment( int start_index, int end_index, Filter filter = e_All );
1456 
1462  int GetSegmentCount() const;
1463 
1472  int GetSegmentStart(int segment_index) const;
1473 
1482  int GetSegmentEnd(int segment_index) const;
1483 
1489  void RemoveAll();
1490 
1491  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1492  explicit Range(FS_HANDLE handle);
1493 };
1494 
1503 class Font FS_FINAL : public Base {
1504  public:
1510  typedef enum _Styles {
1514  e_StyleSerif = 0x0002,
1518  e_StyleScript = 0x0008,
1522  e_StyleItalic = 0x0040,
1524  e_StyleAllCap = 0x10000,
1526  e_StylesSmallCap = 0x20000,
1528  e_StylesBold = 0x40000
1529  } Styles;
1530 
1536  typedef enum _Charset {
1567  } Charset;
1568 
1574  typedef enum _CIDCharset {
1587  } CIDCharset;
1588 
1594  typedef enum _StandardID {
1623  } StandardID;
1624 
1630  typedef enum _FontTypes {
1639  } FontTypes;
1640 
1653  Font(const wchar_t* name, uint32 styles, Charset charset, int weight);
1654 
1661  explicit Font(StandardID font_id);
1662 
1672  Font(const char* font_file_path, int face_index, Charset charset);
1673 
1683  Font(const wchar_t* font_file_path, int face_index, Charset charset);
1684 
1692 
1693  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1694  explicit Font(FS_HANDLE handle = NULL);
1695 
1701  Font(const Font& other);
1702 
1710  Font& operator = (const Font& other);
1711 
1719  bool operator == (const Font& other) const;
1720 
1728  bool operator != (const Font& other) const;
1729 
1737  bool IsEmpty() const;
1738 
1740  ~Font();
1741 
1747  WString GetName();
1748 
1755 
1761  bool IsBold() const;
1762 
1768  bool IsItalic() const;
1769 
1777  bool IsEmbedded(const pdf::PDFDoc& document);
1778 
1787  bool IsSupportEmbedded(const pdf::PDFDoc& document);
1788 
1801  Font Embed(pdf::PDFDoc document, bool is_add_all_unicodes = true);
1802 
1813  UInt32Array AddUnicodes(const pdf::PDFDoc& document, const UInt32Array& unicode_array);
1814 
1815 #ifdef _FONT_GETWOFFDATA_
1816 
1823  String GetWoffData(pdf::PDFDoc document);
1824 #endif
1825 
1831  int GetAscent() const;
1832 
1838  int GetDescent() const;
1839 
1847  RectI GetCharBBox(uint32 unicode) const;
1848 
1856  float GetCharWidth(uint32 unicode) const;
1857 
1866  RectI GetCharBBox(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1867 
1876  float GetCharWidth(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1877 
1886  foxit::uint32 GetStyles(const pdf::PDFDoc& document);
1887 
1899  CIDCharset GetCIDCharset(const pdf::PDFDoc& document);
1900 
1908  bool IsStandardFont(const pdf::PDFDoc& document);
1909 
1921  StandardID GetStandard14Font(const pdf::PDFDoc& document);
1922 
1931  FontTypes GetFontType(const pdf::PDFDoc& document);
1932 
1940  String GetBaseFontName(const pdf::PDFDoc& document);
1941 
1950  bool IsVertWriting(const pdf::PDFDoc& document);
1951 
1960  String GetEncoding(const pdf::PDFDoc& document);
1961 
1973  bool SetEncoding(const pdf::PDFDoc& document, const char* value);
1974 };
1975 
1980 class FontMapResult FS_FINAL : public Object {
1981  public:
1984 
1999  this->file_read = file_read;
2000  this->face_index = face_index;
2001  }
2002 
2009  this->file_read = other.file_read;
2010  this->face_index = other.face_index;
2011  }
2012 
2021  this->file_read = other.file_read;
2022  this->face_index = other.face_index;
2023  return *this;
2024  }
2025 
2033  bool operator == (const FontMapResult& other) const {
2034  if (this->file_read != other.file_read || this->face_index != other.face_index)
2035  return false;
2036  return true;
2037  }
2038 
2046  bool operator != (const FontMapResult& other) const {
2047  return !(*this == other);
2048  }
2049 
2064  this->file_read = file_read;
2065  this->face_index = face_index;
2066  }
2067 
2083 };
2084 
2094  public:
2100  virtual void Release() = 0;
2101 
2119  virtual FontMapResult MapFont(const char* font_name, bool is_truetype, uint32 styles,
2120  int weight, int italic_angle, Font::Charset charset) = 0;
2121 
2135  virtual StringArray MapFont(const char* font_family_name, Font::Charset charset,
2136  uint32 styles, int weight, int italic_angle) = 0;
2137 
2138  protected:
2139  ~FontMapperCallback() {}
2140 };
2141 
2143 class Path FS_FINAL : public Base {
2144  public:
2150  typedef enum _PointType {
2169  } PointType;
2170 
2172  Path();
2174  ~Path();
2180  Path(const Path& other);
2188  Path& operator=(const Path& other);
2196  bool operator ==(const Path& other) const;
2204  bool operator != (const Path& other) const;
2205 
2213  bool IsEmpty() const;
2214 
2220  int GetPointCount();
2221 
2230  PointF GetPoint(int index);
2231 
2241  PointType GetPointType(int index);
2242 
2254  bool SetPoint(int index, const PointF& point, PointType type);
2255 
2266  bool MoveTo(const PointF& point);
2267 
2277  bool LineTo(const PointF& point);
2278 
2291  bool CubicBezierTo(const PointF& point1, const PointF& point2, const PointF& point3);
2292 
2312  bool CloseFigure();
2313 
2322  bool RemovePoint(int index);
2323 
2331  bool AppendRect(const RectF& rect);
2332 
2340  bool AppendEllipse(const RectF& rect);
2341 
2349  void Transform(const Matrix& matrix);
2355  void Clear();
2356 
2369  void IncreasePointCount(int count);
2370 
2371  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2372  explicit Path(FS_HANDLE handle);
2373 };
2374 
2376 FSDK_DEFINE_ARRAY(PathArray, Path)
2377 
2378 
2381 class ColorSpace FS_FINAL : public Base {
2382  public:
2391  typedef enum _RenderingIntent {
2393  e_RenderIntentPerceptual = 0,
2395  e_RenderIntentRelColorimetric = 1,
2397  e_RenderIntentSaturation = 2,
2399  e_RenderIntentAbsColorimetric = 3
2400  } RenderingIntent;
2401 
2402 
2403  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2404  explicit ColorSpace(FS_HANDLE handle);
2405 
2416  ~ColorSpace();
2417 
2423  ColorSpace(const ColorSpace& other);
2424 
2432  ColorSpace& operator=(const ColorSpace& other);
2433 
2442  bool operator==(const ColorSpace& other) const;
2443 
2452  bool operator!=(const ColorSpace& other) const;
2453 
2461  bool IsEmpty() const;
2462 
2470  int GetComponentCount() const;
2471 
2478  foxit::common::ColorSpaceType GetColorSpaceType() const;
2479 
2485  bool IsSpotColorSpace() const;
2486 
2503  StringArray GetComponentNames() const;
2504 
2513  Color ConvertColor(const Color& color);
2514 
2525  Color ConvertColor(int r_value, int g_value, int b_value);
2526 
2538  Color ConvertColor(int c_value, int m_value, int y_value, int k_value);
2539 };
2540 
2544 class Color FS_FINAL : public Base {
2545  public:
2546  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2547  explicit Color(FS_HANDLE handle);
2548 
2550  Color();
2556  explicit Color(const ColorSpace& color_space);
2558  ~Color();
2559 
2565  Color(const Color& other);
2566 
2574  Color& operator=(const Color& other);
2575 
2583  bool operator==(const Color& other) const;
2584 
2592  bool operator!=(const Color& other) const;
2593 
2601  bool IsEmpty() const;
2602 
2609 
2619  FloatArray GetValue() const;
2620 
2633  void SetValue(const FloatArray& component_array);
2634 
2644 
2654 };
2655 
2656 } // namespace common
2657 } // namespace foxit
2658 
2659 #endif // FS_COMMON_H_
2660 
CID Font charset: Adobe-CNS1.
Definition: fs_common.h:1580
File format type: XFDF.
Definition: fs_common.h:268
Definition: fs_annot.h:1749
Font style: non-symbolic.
Definition: fs_common.h:1520
bool IsVertWriting(const pdf::PDFDoc &document)
Check whether current font is vertical writing.
FontMapResult()
Constructor.
Definition: fs_common.h:1983
Indicates that a line is drawn from the previous point to this point, and this point will also be con...
Definition: fs_common.h:2160
Miter line join type.
Definition: fs_common.h:1121
Name for module "Optimizer".
Definition: fs_common.h:170
Styles
Enumeration for font styles.
Definition: fs_common.h:1510
LineCapStyle line_cap
Line cap style.
Definition: fs_common.h:1256
Color & operator=(const Color &other)
Assign operator.
Standard font: Helvetica-Bold.
Definition: fs_common.h:1606
Font charset: Korean (Wansung).
Definition: fs_common.h:1546
Color space: Separation.
Definition: fs_common.h:218
Bevel line join type.
Definition: fs_common.h:1133
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:1264
Color space: ICCBased.
Definition: fs_common.h:216
static WString ExecuteJavaScript(const wchar_t *java_script)
Execute javascript.
Position: center.
Definition: fs_common.h:138
Font charset: Japanese (Shift-JIS).
Definition: fs_common.h:1544
Definition: fs_common.h:1348
bool AppendEllipse(const RectF &rect)
Add an ellipse figure to the end of current path.
Rotate the text block based on the left-top point of the rectangle.
Definition: fs_common.h:80
Standard font: Times-Bold.
Definition: fs_common.h:1614
static void SetRenderTextGamma(float gamma)
Set gamma value for text rendering.
static bool SetTimeStampCallback(pdf::TimeStampCallback *timestamp_callback)
Set a pdf::TimeStampCallback object to Foxit PDF SDK, in aid of interacting with time stamp server.
Alternate fill mode, in which the system fills this area between odd-numbered and even-numbered polyg...
Definition: fs_common.h:115
CID Font charset: Unknown.
Definition: fs_common.h:1576
static void Release()
Release all resource allocated by Foxit PDF SDK Library.
int GetRateOfProgress()
Get the rate of current progress.
RotationPointOptions
Enumeration for rotation point options.
Definition: fs_common.h:76
Position: bottom right.
Definition: fs_common.h:146
Definition: fs_common.h:291
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:128
Definition: fs_common.h:1980
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:1107
Definition: fs_common.h:2381
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:221
IFX_Pause PauseCallback
Definition: fs_common.h:1272
Color space: CalGray. (1 component, A)
Definition: fs_common.h:210
Name for module "AdvEdit".
Definition: fs_common.h:182
CID Font charset: Adobe-Japan1.
Definition: fs_common.h:1582
Definition: fs_common.h:526
Round line join type.
Definition: fs_common.h:1127
Locale ID for region: Taiwan.
Definition: fs_common.h:244
virtual FontMapResult MapFont(const char *font_name, bool is_truetype, uint32 styles, int weight, int italic_angle, Font::Charset charset)=0
(This function will be deprecated in the future. It is recommended to use FontMapperCallback::MapFont...
Name for module "3D".
Definition: fs_common.h:186
Standard font: Times-BoldItalic.
Definition: fs_common.h:1616
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:1150
Definition: fs_common.h:432
Rotate the text block based on the right-top point of the rectangle.
Definition: fs_common.h:82
Font(const wchar_t *name, uint32 styles, Charset charset, int weight)
Constructor, with given attribute.
Unknown rotation.
Definition: fs_common.h:67
Rendering intent: Relative Colorimetric.
Definition: fs_common.h:2395
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:204
LocaleID
Enumeration for locale ID.
Definition: fs_common.h:238
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:1361
Name for module "PDF2Office".
Definition: fs_common.h:184
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:1214
Range & operator=(const Range &other)
Assign operator.
PointF GetPoint(int index)
Get a point specified by index.
File format type: XDP.
Definition: fs_common.h:272
bool CloseFigure()
Close current figure (which is also the last figure in current path).
Color space: Indexed.
Definition: fs_common.h:222
Round cap. A semicircular arc with a diameter equal to the line width is drawn around the endpoint an...
Definition: fs_common.h:1102
CID Font charset: Adobe-GB1.
Definition: fs_common.h:1578
bool operator !=(const FontMapResult &other) const
Not equal operator.
Definition: fs_common.h:2046
Locale ID for country: Korea.
Definition: fs_common.h:254
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:63
Name for module "OCR".
Definition: fs_common.h:164
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:1586
void SetValue(const FloatArray &component_array)
Set component value array.
RenderingIntent
Enumeration for rendering intent.
Definition: fs_common.h:2391
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:1524
Filter
Enumeration for range filter.
Definition: fs_common.h:1355
File format type: FDF.
Definition: fs_common.h:266
Locale ID: Unspecified, used when locale is not specified.
Definition: fs_common.h:240
~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:587
Color space: DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:206
void Clear()
Clear all points.
FloatArray GetValue() const
Get component value array.
CIDCharset
Enumeration for CID font charset.
Definition: fs_common.h:1574
Locale ID for region: HongKong.
Definition: fs_common.h:242
WIDE STRING CLASS.
Definition: fx_string.h:1461
static void EnableThreadSafety(bool is_enable_thread_safety)
Enable thread safety.
GraphState(const GraphState &state)
Constructor, with another graph state object.
Definition: fs_common.h:1173
State
Enumeration for progress state.
Definition: fs_common.h:380
(Reserved, currently, this module is not provided) Name for module "LayoutRecognition".
Definition: fs_common.h:174
Font type: TrueType.
Definition: fs_common.h:1634
static void RegisterXFAAppProviderCallback(addon::xfa::AppProviderCallback *callback)
Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK.
Standard font: Helvetica.
Definition: fs_common.h:1604
Position: top right.
Definition: fs_common.h:134
Definition: fs_common.h:1279
Locale ID for country: France.
Definition: fs_common.h:248
FileFormatType
Enumeration for file format type.
Definition: fs_common.h:264
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:2072
Indicates that the point is the first point of a figure.
Definition: fs_common.h:2152
bool operator==(const FontMapResult &other) const
Equal operator.
Definition: fs_common.h:2033
LineCapStyle
Enumeration for line cap style.
Definition: fs_common.h:1092
Font style: script.
Definition: fs_common.h:1518
Locale ID for country: Germany.
Definition: fs_common.h:250
static ErrorCode Reinitialize()
Re-initialize Foxit PDF SDK Library.
Locale ID for country: Japan.
Definition: fs_common.h:256
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:772
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:208
bool IsEmpty() const
Check whether current object is empty or not.
static void ReleaseOFDEngine()
Release OFD engine.
Definition: fs_common.h:2544
static ErrorCode Initialize(const char *sn, const char *key)
Initialize Foxit PDF SDK Library, with valid license information.
Name for module "DWG2PDF".
Definition: fs_common.h:180
foxit::uint32 GetStyles(const pdf::PDFDoc &document)
Get font styles.
Font style: italic.
Definition: fs_common.h:1522
Color space: ICCBased DeviceCMYK. (4 components, C, M, Y, K)
Definition: fs_common.h:230
Definition: fs_common.h:2376
FontMapResult(const FontMapResult &other)
Constructor, with another font mapping result object.
Definition: fs_common.h:2008
Progressive(const Progressive &other)
Constructor, with another progressive object.
Definition: fs_common.h:2093
FontTypes
Enumeration for font type.
Definition: fs_common.h:1630
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:384
GraphState()
Constructor.
Definition: fs_common.h:1161
Position: bottom center.
Definition: fs_common.h:144
bool IsEmbedded(const pdf::PDFDoc &document)
Judge whether current font is embedded in a specified PDF document or not.
static void SetRenderConfig(const RenderConfig &render_config)
Set the rendering configuration.
int GetSegmentEnd(int segment_index) const
Get the end index of a specified range segment.
Definition: fs_signature.h:1453
File format type: HTML.
Definition: fs_common.h:270
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:156
bool operator!=(const Color &other) const
Not equal operator.
String GetEncoding(const pdf::PDFDoc &document)
Get the current font encoding.
bool operator==(const char *str1, const CFX_ByteString &str2)
Check if two byte strings are equal.
Definition: fs_basictypes.h:128
bool SetEncoding(const pdf::PDFDoc &document, const char *value)
Set the current font encoding.
Name for module "OFD".
Definition: fs_common.h:188
Font style: serif.
Definition: fs_common.h:1514
Indicates that a line is drawn from the previous point to this point.
Definition: fs_common.h:2154
Name for module "Conversion".
Definition: fs_common.h:172
Color space: ICCBased DeviceGray. (1 component, gray)
Definition: fs_common.h:226
Header file for basic types definitions.
LineJoinStyle line_join
Line join style.
Definition: fs_common.h:1238
Position center left.
Definition: fs_common.h:136
Definition: fs_actioncallback.h:2158
ColorSpaceType
Enumeration for color space.
Definition: fs_common.h:200
static void SetLogFile(const char *log_file_path)
Set the log file path.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:237
Only even numbers in a range will be used (discards odd numbers).
Definition: fs_common.h:1359
virtual void OnDocSaved(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is saved.
Definition: fs_common.h:1335
Font charset: Traditional Chinese.
Definition: fs_common.h:1550
Font charset: ANSI (United States, Western Europe).
Definition: fs_common.h:1538
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:1097
File stream interface, reading & writing.
Definition: fx_stream.h:692
Position: center right.
Definition: fs_common.h:140
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:1542
Color space: ICCBased DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:228
CIDCharset GetCIDCharset(const pdf::PDFDoc &document)
Get CID font charset.
Font style: force bold.
Definition: fs_common.h:1528
FillMode
Enumeration for filling mode type, mainly for path graphics object.
Definition: fs_common.h:108
static void * Realloc(void *ptr, size_t new_size)
Reallocate a memory block.
Name for module "Compliance".
Definition: fs_common.h:168
RenderConfig()
Constructor.
Definition: fs_common.h:443
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:2020
Font style: symbolic.
Definition: fs_common.h:1516
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fx_basic.h:3758
Definition: fs_common.h:1084
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:1600
virtual void Release()=0
A callback function used to release current callback object itself.
Definition: fs_common.h:2143
RenderConfig(int graphics_objs_count_in_one_step)
Constructor, with parameter.
Definition: fs_common.h:440
bool operator==(const Path &other) const
Equal operator.
Font charset: Arabic.
Definition: fs_common.h:1564
LineJoinStyle
Enumeration for line join style.
Definition: fs_common.h:1116
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:1540
Definition: fs_common.h:373
float line_width
Line width.
Definition: fs_common.h:1230
Winding fill mode, in which the system uses a direction in which a figure is drawn to determine wheth...
Definition: fs_common.h:120
Name for module "XFA".
Definition: fs_common.h:158
Locale ID for country: Italy.
Definition: fs_common.h:252
Font type: CID font.
Definition: fs_common.h:1638
~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:220
virtual void OnDocOpened(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is opened.
Definition: fs_common.h:1305
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
virtual void OnDocWillOpen()
Triggered when the document will be opened.
Definition: fs_common.h:1293
static bool SetDocEventCallback(DocEventCallback *callback)
Set a DocEventCallback object to Foxit PDF SDK.
Font charset: Russian.
Definition: fs_common.h:1556
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...
Definition: fs_signature.h:1868
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:2082
~Path()
Destructor.
Definition: fx_coordinates.h:596
Color()
Construct an empty color.
Name for module "TableMaker".
Definition: fs_common.h:178
Alignment
Enumeration for alignment (horizontal).
Definition: fs_common.h:94
virtual void OnDocWillSave(const pdf::PDFDoc &document)
Triggered when a PDF document will be saved.
Definition: fs_common.h:1323
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:449
Definition: fs_basictypes.h:230
static foxit::ErrorCode FlushLog()
Flush the log file.
bool operator==(const Font &other) const
Equal operator.
ModuleName
Enumeration for module name which is used in license information.
Definition: fs_common.h:154
Font type: Type3.
Definition: fs_common.h:1636
Standard font: ZapfDingbats.
Definition: fs_common.h:1622
Standard font: Helvetica-Oblique, Italic.
Definition: fs_common.h:1610
Definition: fs_security.h:1210
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:2168
Standard font: Times-Roman.
Definition: fs_common.h:1612
bool operator !=(const Range &other) const
Not equal operator.
WString GetName()
Retrieve the postscript name.
Standard font: Symbol.
Definition: fs_common.h:1620
Rotate 270 degrees in clockwise direction.
Definition: fs_common.h:65
Font Embed(pdf::PDFDoc document, bool is_add_all_unicodes=true)
Embed current font to the specified PDF document.
Position: bottom left.
Definition: fs_common.h:142
Font style: fixed pitch.
Definition: fs_common.h:1512
Font charset: Simplified Chinese.
Definition: fs_common.h:1548
Color space: Pattern.
Definition: fs_common.h:224
Standard font: Times-Italic.
Definition: fs_common.h:1618
Path()
Constructor.
Definition: fs_common.h:1503
Color space: Lab. (3 components, A, B, C)
Definition: fs_common.h:214
Name for module "Redaction".
Definition: fs_common.h:160
Color space: Invalid.
Definition: fs_common.h:202
Fill mode: none.
Definition: fs_common.h:110
Center alignment.
Definition: fs_common.h:98
No rotation.
Definition: fs_common.h:59
static ErrorCode InitializeOFDEngine(const char *ofd_library_path)
Initialize OFD engine.
Rotation
Enumeration for rotation.
Definition: fs_common.h:57
FontTypes GetFontType(const pdf::PDFDoc &document)
Get font type.
Foxit namespace.
Definition: fs_taggedpdf.h:27
Left alignment.
Definition: fs_common.h:96
Color space: CalRGB. (3 components, A, B, C)
Definition: fs_common.h:212
Definition: fs_common.h:342
void AddSingle(int index)
Add an index as a new range segment.
Name for module "Comparison".
Definition: fs_common.h:166
float dash_phase
Dash phase for dash pattern.
Definition: fs_common.h:1259
StandardID
Enumeration for standard font ID.
Definition: fs_common.h:1594
File format type: XFD.
Definition: fs_common.h:276
All the indexes within a range will be used.
Definition: fs_common.h:1357
BYTE STRING CLASS.
Definition: fx_string.h:317
Progress state: progress is finished.
Definition: fs_common.h:386
Font charset: Hebrew.
Definition: fs_common.h:1562
UInt32Array AddUnicodes(const pdf::PDFDoc &document, const UInt32Array &unicode_array)
Add unicodes to current embedded font.
Charset
Enumeration for font charset.
Definition: fs_common.h:1536
static void Free(void *ptr)
Free a memory block.
Font style: small cap.
Definition: fs_common.h:1526
Font charset: Greek.
Definition: fs_common.h:1558
Font type: Type1.
Definition: fs_common.h:1632
Name for module "Accessibility".
Definition: fs_common.h:176
static void UnregisterSignatureCallback(const char *filter, const char *sub_filter)
Unregister the third-party pdf::SignatureCallback object, which is associated with a specific filter ...
Rotate 90 degrees in clockwise direction.
Definition: fs_common.h:61
File format type: XML.
Definition: fs_common.h:274
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:1608
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:1566
Standard font: Courier.
Definition: fs_common.h:1596
GraphState & operator=(const GraphState &state)
Assign operator.
Definition: fs_common.h:1189
Rotate the text block based on the center point.
Definition: fs_common.h:78
Font charset: Turkish.
Definition: fs_common.h:1560
FontMapResult(foxit::common::file::ReaderCallback *file_read, int face_index)
Constructor, with parameters.
Definition: fs_common.h:1998
Rotate the text block based on the left-bottom point of the rectangle.
Definition: fs_common.h:84
Name for module "Office2PDF".
Definition: fs_common.h:190
bool operator !=(const RenderConfig &render_config) const
Not equal operator.
Definition: fs_common.h:477
Progress state: any error occurs.
Definition: fs_common.h:382
int graphics_objs_count_in_one_step
The count of graphics objects to be rendered in one step during progressive rendering process....
Definition: fs_common.h:507
#define NULL
The null-pointer value.
Definition: fx_system.h:792
bool operator==(const RenderConfig &render_config) const
Equal operator.
Definition: fs_common.h:464
bool operator!=(const char *str1, const CFX_ByteString &str2)
Check if two byte strings are not equal.
Definition: fs_basictypes.h:140
virtual void OnDocWillDestroy(const pdf::PDFDoc &document)
Triggered when a PDF document will be destroyed.
Definition: fs_common.h:1314
void Set(int graphics_objs_count_in_one_step)
Set value.
Definition: fs_common.h:491
Definition: fx_coordinates.h:1076
Name for module "Print2PDF".
Definition: fs_common.h:192
Font charset: Eastern European.
Definition: fs_common.h:1554
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:100
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:2162
bool RemovePoint(int index)
Remove a point specified by index.
Position: top left.
Definition: fs_common.h:130
Font & operator=(const Font &other)
Assign operator.
Position: top center.
Definition: fs_common.h:132
bool IsItalic() const
Judge whether current font object is italic or not.
PointType
Enumeration for point type in path.
Definition: fs_common.h:2150
ColorSpace GetColorSpace()
Get the color space that current color belongs to.
Standard font: Courier-Oblique, Italic.
Definition: fs_common.h:1602
Locale ID for country: Netherlands.
Definition: fs_common.h:246
Standard font: Courier-Bold.
Definition: fs_common.h:1598
static RenderConfig GetRenderConfig()
Get the rendering configuration.
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.
File format type: TXT.
Definition: fs_common.h:280
Font charset: Thai.
Definition: fs_common.h:1552
CID Font charset: Adobe-Korea1.
Definition: fs_common.h:1584
void Set(foxit::common::file::ReaderCallback *file_read, int face_index)
Set value.
Definition: fs_common.h:2063
File format type: PDF.
Definition: fs_common.h:278
Rotate the text block based on the right-bottom point of the rectangle.
Definition: fs_common.h:86
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:162
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:1248
RenderConfig & operator=(const RenderConfig &render_config)
Assign operator.
Definition: fs_common.h:452