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 
75 typedef enum _Alignment {
82 } Alignment;
83 
89 typedef enum _FillMode {
102 } FillMode;
103 
109 typedef enum _Position {
128 } Position;
129 
135 typedef enum _ModuleName {
166 } ModuleName;
167 
173 typedef enum _ColorSpaceType {
201 
207 typedef enum _LocaleID {
226 } LocaleID;
227 
233 typedef enum _FileFormatType {
251 
252 
253 #define CommonDefines foxit::common
254 
260 class Codec FS_FINAL : public Base {
261  public:
270  static String Base64Encode(const void* data_buffer, size_t length);
271 
280  static String Base64Decode(const void* encoded_data_buffer, size_t length);
281 
290  static String FlateCompress(const void* data_buffer, size_t length);
291 
300  static String FlateDecompress(const void* compressed_data_buffer, size_t length);
301 };
302 
312  public:
318  virtual void Release() = 0;
319 
332  virtual void OnOutOfMemory() = 0;
333 
334  protected:
335  ~NotifierCallback() {}
336 };
337 
342 class Progressive FS_FINAL : public Base {
343  public:
349  typedef enum _State {
351  e_Error = 0,
356  } State;
357 
363  Progressive(const Progressive& other);
365  ~Progressive();
366 
374  Progressive& operator = (const Progressive& other);
375 
384  State Continue();
385 
392  int GetRateOfProgress();
393 
394  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
395  explicit Progressive(FS_HANDLE handle = NULL);
396 };
401 class RenderConfig FS_FINAL : public Object {
402  public:
410 
413 
416 
424  RenderConfig& operator = (const RenderConfig& render_config) {
426  return *this;
427  }
428 
436  bool operator == (const RenderConfig& render_config) const {
438  return true;
439  return false;
440  }
441 
449  bool operator != (const RenderConfig& render_config) const {
451  return true;
452  return false;
453  }
454 
464  this->graphics_objs_count_in_one_step = graphics_objs_count_in_one_step;
465  }
466 
480 };
481 
498 class Library FS_FINAL : public Object {
499  public:
516  static ErrorCode Initialize(const char* sn, const char* key);
517 
529  static ErrorCode Reinitialize();
530 
540  static void Release();
541 
556  static bool HasModuleLicenseRight(common::ModuleName module_name);
557 
563  static String GetVersion();
564 
576  static bool SetCacheSize(uint32 size);
577 
589  static bool EnableJavaScript(bool enable_javascript);
590 
591 #ifndef __EMSCRIPTEN_RENDER__
592 
614  static bool SetAnnotIconProviderCallback(pdf::annots::IconProviderCallback* annot_icon_provider);
615 #endif
616 
627  static bool SetNotifierCallback(NotifierCallback* notifier);
628 
643  static bool SetActionCallback(ActionCallback* action_callback);
644 
653  static bool SetDocEventCallback(DocEventCallback* callback);
654 
691  static bool RegisterSignatureCallback(const char* filter, const char* sub_filter,
692  pdf::SignatureCallback* signature_callback);
693 
728  static bool RegisterSecurityCallback(const char* filter, pdf::SecurityCallback* callback);
729 
748  static bool UnregisterSecurityCallback(const char* filter);
749 
769  static bool SetTimeStampCallback(pdf::TimeStampCallback* timestamp_callback);
770 
771  #ifndef _FX_NO_XFA_
772 
790  #endif // #ifndef _FX_NO_XFA_
791 
801  static void SetRenderTextGamma(float gamma);
802 
813  static void* Alloc(size_t size);
814 
822  static void Free(void* ptr);
823 
835  static void* Realloc(void* ptr, size_t new_size);
836 
847  static void SetLogFile(const char* log_file_path);
848 
859  static void SetLogFile(const wchar_t* log_file_path);
860 
872  static bool SetFontMapperCallback(FontMapperCallback* callback);
873 
887  static void SetDefaultICCProfilesPath(const wchar_t* icc_profile_folder_path);
888 
894  static RenderConfig GetRenderConfig();
895 
903  static void SetRenderConfig(const RenderConfig& render_config);
904 
915  static void EnableThreadSafety(bool is_enable_thread_safety);
916 
917  private:
918  Library(const Library&);
919  Library& operator = (const Library&);
920 };
922 class GraphState FS_FINAL : public Object {
923  public:
930  typedef enum _LineCapStyle {
946  } LineCapStyle;
947 
954  typedef enum _LineJoinStyle {
972  } LineJoinStyle;
973 
974 
990  this->line_width = line_width;
991  this->line_join = line_join;
992  this->miter_limit = miter_limit;
993  this->line_cap = line_cap;
994  this->dash_phase = dash_phase;
995  this->dashes = dashes;
996  }
997 
1000  : line_width(1.0f)
1002  , miter_limit(10*1.0f)
1004  , dash_phase(0) {}
1005 
1008 
1014  GraphState(const GraphState& state) {
1015  this->line_width = state.line_width;
1016  this->line_join = state.line_join;
1017  this->miter_limit = state.miter_limit;
1018  this->line_cap = state.line_cap;
1019  this->dash_phase = state.dash_phase;
1020  this->dashes = state.dashes;
1021  }
1022 
1031  this->line_width = state.line_width;
1032  this->line_join = state.line_join;
1033  this->miter_limit = state.miter_limit;
1034  this->line_cap = state.line_cap;
1035  this->dash_phase = state.dash_phase;
1036  this->dashes = state.dashes;
1037  return *this;
1038  }
1039 
1056  const FloatArray& dashes) {
1057  this->line_width = line_width;
1058  this->line_join = line_join;
1059  this->miter_limit = miter_limit;
1060  this->line_cap = line_cap;
1061  this->dash_phase = dash_phase;
1062  this->dashes = dashes;
1063  }
1064 
1071  float line_width;
1098 
1100  float dash_phase;
1101 
1106 };
1107 
1114 
1121  public:
1127  virtual void Release() = 0;
1128 
1134  virtual void OnDocWillOpen() {}
1135 
1146  virtual void OnDocOpened(const pdf::PDFDoc& document, ErrorCode error_code) {}
1147 
1155  virtual void OnDocWillDestroy(const pdf::PDFDoc& document) {}
1156 
1164  virtual void OnDocWillSave(const pdf::PDFDoc& document) {}
1165 
1176  virtual void OnDocSaved(const pdf::PDFDoc& document, ErrorCode error_code) {}
1177 
1178  protected:
1179  ~DocEventCallback() {}
1180 };
1181 
1189 class Range FS_FINAL : public Base {
1190  public:
1196  typedef enum _Filter {
1198  e_All = 0,
1200  e_Even = 1,
1202  e_Odd = 2
1203  } Filter;
1204 
1206  Range();
1207 
1213  explicit Range(int index);
1214 
1227  explicit Range(int start_index, int end_index, Filter filter = e_All);
1228 
1234  Range(const Range& other);
1235 
1237  ~Range();
1238 
1246  Range& operator = (const Range& other);
1247 
1255  bool operator == (const Range& other) const;
1256 
1264  bool operator != (const Range& other) const;
1265 
1273  bool IsEmpty() const;
1274 
1280  void AddSingle( int index );
1281 
1296  void AddSegment( int start_index, int end_index, Filter filter = e_All );
1297 
1303  int GetSegmentCount() const;
1304 
1313  int GetSegmentStart(int segment_index) const;
1314 
1323  int GetSegmentEnd(int segment_index) const;
1324 
1330  void RemoveAll();
1331 
1332  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1333  explicit Range(FS_HANDLE handle);
1334 };
1335 
1344 class Font FS_FINAL : public Base {
1345  public:
1351  typedef enum _Styles {
1355  e_StyleSerif = 0x0002,
1359  e_StyleScript = 0x0008,
1363  e_StyleItalic = 0x0040,
1365  e_StyleAllCap = 0x10000,
1367  e_StylesSmallCap = 0x20000,
1369  e_StylesBold = 0x40000
1370  } Styles;
1371 
1377  typedef enum _Charset {
1408  } Charset;
1409 
1415  typedef enum _CIDCharset {
1428  } CIDCharset;
1429 
1435  typedef enum _StandardID {
1464  } StandardID;
1465 
1471  typedef enum _FontTypes {
1480  } FontTypes;
1481 
1494  Font(const wchar_t* name, uint32 styles, Charset charset, int weight);
1495 
1502  explicit Font(StandardID font_id);
1503 
1513  Font(const char* font_file_path, int face_index, Charset charset);
1514 
1524  Font(const wchar_t* font_file_path, int face_index, Charset charset);
1525 
1526  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1527  explicit Font(FS_HANDLE handle = NULL);
1528 
1534  Font(const Font& other);
1535 
1543  Font& operator = (const Font& other);
1544 
1552  bool operator == (const Font& other) const;
1553 
1561  bool operator != (const Font& other) const;
1562 
1570  bool IsEmpty() const;
1571 
1573  ~Font();
1574 
1580  WString GetName();
1581 
1588 
1594  bool IsBold() const;
1595 
1601  bool IsItalic() const;
1602 
1610  bool IsEmbedded(const pdf::PDFDoc& document);
1611 
1620  bool IsSupportEmbedded(const pdf::PDFDoc& document);
1621 
1634  Font Embed(pdf::PDFDoc document, bool is_add_all_unicodes = true);
1635 
1646  UInt32Array AddUnicodes(const pdf::PDFDoc& document, const UInt32Array& unicode_array);
1647 
1648 #ifdef _FONT_GETWOFFDATA_
1649 
1656  String GetWoffData(pdf::PDFDoc document);
1657 #endif
1658 
1664  int GetAscent() const;
1665 
1671  int GetDescent() const;
1672 
1680  RectI GetCharBBox(uint32 unicode) const;
1681 
1689  float GetCharWidth(uint32 unicode) const;
1690 
1699  RectI GetCharBBox(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1700 
1709  float GetCharWidth(foxit::uint32 unicode,const foxit::pdf::PDFDoc& document);
1710 
1719  foxit::uint32 GetStyles(const pdf::PDFDoc& document);
1720 
1732  CIDCharset GetCIDCharset(const pdf::PDFDoc& document);
1733 
1741  bool IsStandardFont(const pdf::PDFDoc& document);
1742 
1754  StandardID GetStandard14Font(const pdf::PDFDoc& document);
1755 
1764  FontTypes GetFontType(const pdf::PDFDoc& document);
1765 
1773  String GetBaseFontName(const pdf::PDFDoc& document);
1774 
1783  bool IsVertWriting(const pdf::PDFDoc& document);
1784 
1793  String GetEncoding(const pdf::PDFDoc& document);
1794 
1806  bool SetEncoding(const pdf::PDFDoc& document, const char* value);
1807 };
1808 
1813 class FontMapResult FS_FINAL : public Object {
1814  public:
1817 
1832  this->file_read = file_read;
1833  this->face_index = face_index;
1834  }
1835 
1842  this->file_read = other.file_read;
1843  this->face_index = other.face_index;
1844  }
1845 
1854  this->file_read = other.file_read;
1855  this->face_index = other.face_index;
1856  return *this;
1857  }
1858 
1866  bool operator == (const FontMapResult& other) const {
1867  if (this->file_read != other.file_read || this->face_index != other.face_index)
1868  return false;
1869  return true;
1870  }
1871 
1879  bool operator != (const FontMapResult& other) const {
1880  return !(*this == other);
1881  }
1882 
1897  this->file_read = file_read;
1898  this->face_index = face_index;
1899  }
1900 
1916 };
1917 
1927  public:
1933  virtual void Release() = 0;
1934 
1950  virtual FontMapResult MapFont(const char* font_name, bool is_truetype, uint32 styles,
1951  int weight, int italic_angle, Font::Charset charset) = 0;
1952 
1953  protected:
1954  ~FontMapperCallback() {}
1955 };
1956 
1958 class Path FS_FINAL : public Base {
1959  public:
1965  typedef enum _PointType {
1984  } PointType;
1985 
1987  Path();
1989  ~Path();
1995  Path(const Path& other);
2003  Path& operator=(const Path& other);
2011  bool operator ==(const Path& other) const;
2019  bool operator != (const Path& other) const;
2020 
2028  bool IsEmpty() const;
2029 
2035  int GetPointCount();
2036 
2045  PointF GetPoint(int index);
2046 
2056  PointType GetPointType(int index);
2057 
2069  bool SetPoint(int index, const PointF& point, PointType type);
2070 
2081  bool MoveTo(const PointF& point);
2082 
2092  bool LineTo(const PointF& point);
2093 
2106  bool CubicBezierTo(const PointF& point1, const PointF& point2, const PointF& point3);
2107 
2127  bool CloseFigure();
2128 
2137  bool RemovePoint(int index);
2138 
2146  bool AppendRect(const RectF& rect);
2147 
2155  bool AppendEllipse(const RectF& rect);
2156 
2164  void Transform(const Matrix& matrix);
2170  void Clear();
2171 
2184  void IncreasePointCount(int count);
2185 
2186  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2187  explicit Path(FS_HANDLE handle);
2188 };
2189 
2191 FSDK_DEFINE_ARRAY(PathArray, Path)
2192 
2193 
2196 class ColorSpace FS_FINAL : public Base {
2197  public:
2206  typedef enum _RenderingIntent {
2208  e_RenderIntentPerceptual = 0,
2210  e_RenderIntentRelColorimetric = 1,
2212  e_RenderIntentSaturation = 2,
2214  e_RenderIntentAbsColorimetric = 3
2215  } RenderingIntent;
2216 
2217 
2218  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2219  explicit ColorSpace(FS_HANDLE handle);
2220 
2231  ~ColorSpace();
2232 
2238  ColorSpace(const ColorSpace& other);
2239 
2247  ColorSpace& operator=(const ColorSpace& other);
2248 
2257  bool operator==(const ColorSpace& other) const;
2258 
2267  bool operator!=(const ColorSpace& other) const;
2268 
2276  bool IsEmpty() const;
2277 
2285  int GetComponentCount() const;
2286 
2293  foxit::common::ColorSpaceType GetColorSpaceType() const;
2294 
2300  bool IsSpotColorSpace() const;
2301 
2318  StringArray GetComponentNames() const;
2319 
2328  Color ConvertColor(const Color& color);
2329 
2340  Color ConvertColor(int r_value, int g_value, int b_value);
2341 
2353  Color ConvertColor(int c_value, int m_value, int y_value, int k_value);
2354 };
2355 
2359 class Color FS_FINAL : public Base {
2360  public:
2361  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2362  explicit Color(FS_HANDLE handle);
2363 
2365  Color();
2371  explicit Color(const ColorSpace& color_space);
2373  ~Color();
2374 
2380  Color(const Color& other);
2381 
2389  Color& operator=(const Color& other);
2390 
2398  bool operator==(const Color& other) const;
2399 
2407  bool operator!=(const Color& other) const;
2408 
2416  bool IsEmpty() const;
2417 
2424 
2434  FloatArray GetValue() const;
2435 
2448  void SetValue(const FloatArray& component_array);
2449 
2459 
2469 };
2470 } // namespace common
2471 } // namespace foxit
2472 
2473 #endif // FS_COMMON_H_
2474 
CID Font charset: Adobe-CNS1.
Definition: fs_common.h:1421
File format type: XFDF.
Definition: fs_common.h:237
Definition: fs_annot.h:1717
Font style: non-symbolic.
Definition: fs_common.h:1361
bool IsVertWriting(const pdf::PDFDoc &document)
Check whether current font is vertical writing.
FontMapResult()
Constructor.
Definition: fs_common.h:1816
Indicates that a line is drawn from the previous point to this point, and this point will also be con...
Definition: fs_common.h:1975
Miter line join type.
Definition: fs_common.h:959
Name for module "Optimizer".
Definition: fs_common.h:151
Styles
Enumeration for font styles.
Definition: fs_common.h:1351
LineCapStyle line_cap
Line cap style.
Definition: fs_common.h:1097
Color & operator=(const Color &other)
Assign operator.
Standard font: Helvetica-Bold.
Definition: fs_common.h:1447
Font charset: Korean (Wansung).
Definition: fs_common.h:1387
Color space: Separation.
Definition: fs_common.h:189
Bevel line join type.
Definition: fs_common.h:971
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:1105
Position: center.
Definition: fs_common.h:119
Font charset: Japanese (Shift-JIS).
Definition: fs_common.h:1385
Definition: fs_common.h:1189
bool AppendEllipse(const RectF &rect)
Add an ellipse figure to the end of current path.
Standard font: Times-Bold.
Definition: fs_common.h:1455
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:96
CID Font charset: Unknown.
Definition: fs_common.h:1417
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:127
Definition: fs_common.h:260
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:109
Definition: fs_common.h:1813
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:945
Definition: fs_common.h:2196
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:1113
Color space: CalGray. (1 component, A)
Definition: fs_common.h:183
Name for module "AdvEdit".
Definition: fs_common.h:163
CID Font charset: Adobe-Japan1.
Definition: fs_common.h:1423
Definition: fs_common.h:498
Round line join type.
Definition: fs_common.h:965
Locale ID for region: Taiwan.
Definition: fs_common.h:213
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:1457
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:988
Definition: fs_common.h:401
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:2210
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:177
LocaleID
Enumeration for locale ID.
Definition: fs_common.h:207
Only odd numbers in a range will be used (discards even numbers).
Definition: fs_common.h:1202
Name for module "PDF2Office".
Definition: fs_common.h:165
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:1055
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:241
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:940
CID Font charset: Adobe-GB1.
Definition: fs_common.h:1419
bool operator !=(const FontMapResult &other) const
Not equal operator.
Definition: fs_common.h:1879
Locale ID for country: Korea.
Definition: fs_common.h:223
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:145
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:1427
void SetValue(const FloatArray &component_array)
Set component value array.
RenderingIntent
Enumeration for rendering intent.
Definition: fs_common.h:2206
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:1365
Filter
Enumeration for range filter.
Definition: fs_common.h:1196
File format type: FDF.
Definition: fs_common.h:235
Locale ID: Unspecified, used when locale is not specified.
Definition: fs_common.h:209
~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:566
Color space: DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:179
void Clear()
Clear all points.
FloatArray GetValue() const
Get component value array.
CIDCharset
Enumeration for CID font charset.
Definition: fs_common.h:1415
Locale ID for region: HongKong.
Definition: fs_common.h:211
WIDE STRING CLASS.
Definition: fx_string.h:1452
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:1014
State
Enumeration for progress state.
Definition: fs_common.h:349
(Reserved, currently, this module is not provided) Name for module "LayoutRecognition".
Definition: fs_common.h:155
Font type: TrueType.
Definition: fs_common.h:1475
static void RegisterXFAAppProviderCallback(addon::xfa::AppProviderCallback *callback)
Register an addon::xfa::AppProviderCallback object to Foxit PDF SDK.
Standard font: Helvetica.
Definition: fs_common.h:1445
Position: top right.
Definition: fs_common.h:115
Definition: fs_common.h:1120
Locale ID for country: France.
Definition: fs_common.h:217
FileFormatType
Enumeration for file format type.
Definition: fs_common.h:233
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:1905
Indicates that the point is the first point of a figure.
Definition: fs_common.h:1967
bool operator==(const FontMapResult &other) const
Equal operator.
Definition: fs_common.h:1866
LineCapStyle
Enumeration for line cap style.
Definition: fs_common.h:930
Font style: script.
Definition: fs_common.h:1359
Locale ID for country: Germany.
Definition: fs_common.h:219
static ErrorCode Reinitialize()
Re-initialize Foxit PDF SDK Library.
Locale ID for country: Japan.
Definition: fs_common.h:225
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:613
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:181
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fs_common.h:2359
static ErrorCode Initialize(const char *sn, const char *key)
Initialize Foxit PDF SDK Library, with valid license information.
(Reserved, unsupported yet)Name for module "DWG2PDF".
Definition: fs_common.h:161
foxit::uint32 GetStyles(const pdf::PDFDoc &document)
Get font styles.
Font style: italic.
Definition: fs_common.h:1363
Color space: ICCBased DeviceCMYK. (4 components, C, M, Y, K)
Definition: fs_common.h:199
Definition: fs_common.h:2191
FontMapResult(const FontMapResult &other)
Constructor, with another font mapping result object.
Definition: fs_common.h:1841
Progressive(const Progressive &other)
Constructor, with another progressive object.
Definition: fs_common.h:1926
FontTypes
Enumeration for font type.
Definition: fs_common.h:1471
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:353
GraphState()
Constructor.
Definition: fs_common.h:999
Position: bottom center.
Definition: fs_common.h:125
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:239
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:137
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.
Font style: serif.
Definition: fs_common.h:1355
Indicates that a line is drawn from the previous point to this point.
Definition: fs_common.h:1969
Name for module "Conversion".
Definition: fs_common.h:153
Color space: ICCBased DeviceGray. (1 component, gray)
Definition: fs_common.h:195
Header file for basic types definitions.
LineJoinStyle line_join
Line join style.
Definition: fs_common.h:1079
Position center left.
Definition: fs_common.h:117
Definition: fs_actioncallback.h:2158
ColorSpaceType
Enumeration for color space.
Definition: fs_common.h:173
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:1200
virtual void OnDocSaved(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is saved.
Definition: fs_common.h:1176
Font charset: Traditional Chinese.
Definition: fs_common.h:1391
Font charset: ANSI (United States, Western Europe).
Definition: fs_common.h:1379
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:935
Position: center right.
Definition: fs_common.h:121
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:1383
Color space: ICCBased DeviceRGB. (3 components, R, G, B)
Definition: fs_common.h:197
CIDCharset GetCIDCharset(const pdf::PDFDoc &document)
Get CID font charset.
Font style: force bold.
Definition: fs_common.h:1369
FillMode
Enumeration for filling mode type, mainly for path graphics object.
Definition: fs_common.h:89
static void * Realloc(void *ptr, size_t new_size)
Reallocate a memory block.
Name for module "Compliance".
Definition: fs_common.h:149
RenderConfig()
Constructor.
Definition: fs_common.h:412
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:1853
Font style: symbolic.
Definition: fs_common.h:1357
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fx_basic.h:3761
Definition: fs_common.h:922
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:1441
virtual void Release()=0
A callback function used to release current callback object itself.
Definition: fs_common.h:1958
RenderConfig(int graphics_objs_count_in_one_step)
Constructor, with parameter.
Definition: fs_common.h:409
bool operator==(const Path &other) const
Equal operator.
Font charset: Arabic.
Definition: fs_common.h:1405
LineJoinStyle
Enumeration for line join style.
Definition: fs_common.h:954
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:1381
Definition: fs_common.h:342
float line_width
Line width.
Definition: fs_common.h:1071
Winding fill mode, in which the system uses a direction in which a figure is drawn to determine wheth...
Definition: fs_common.h:101
Name for module "XFA".
Definition: fs_common.h:139
Locale ID for country: Italy.
Definition: fs_common.h:221
Font type: CID font.
Definition: fs_common.h:1479
~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:191
virtual void OnDocOpened(const pdf::PDFDoc &document, ErrorCode error_code)
Triggered when a PDF document is opened.
Definition: fs_common.h:1146
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
virtual void OnDocWillOpen()
Triggered when the document will be opened.
Definition: fs_common.h:1134
~RenderConfig()
Destructor.
Definition: fs_common.h:415
static bool SetDocEventCallback(DocEventCallback *callback)
Set a DocEventCallback object to Foxit PDF SDK.
Font charset: Russian.
Definition: fs_common.h:1397
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:1915
~Path()
Destructor.
Definition: fx_coordinates.h:596
Color()
Construct an empty color.
Name for module "TableMaker".
Definition: fs_common.h:159
Alignment
Enumeration for alignment (horizontal).
Definition: fs_common.h:75
virtual void OnDocWillSave(const pdf::PDFDoc &document)
Triggered when a PDF document will be saved.
Definition: fs_common.h:1164
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:419
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:135
Font type: Type3.
Definition: fs_common.h:1477
Standard font: ZapfDingbats.
Definition: fs_common.h:1463
Standard font: Helvetica-Oblique, Italic.
Definition: fs_common.h:1451
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:1983
Standard font: Times-Roman.
Definition: fs_common.h:1453
bool operator !=(const Range &other) const
Not equal operator.
WString GetName()
Retrieve the postscript name.
Standard font: Symbol.
Definition: fs_common.h:1461
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:123
Font style: fixed pitch.
Definition: fs_common.h:1353
Font charset: Simplified Chinese.
Definition: fs_common.h:1389
Color space: Pattern.
Definition: fs_common.h:193
Standard font: Times-Italic.
Definition: fs_common.h:1459
Path()
Constructor.
Definition: fs_common.h:1344
Color space: Lab. (3 components, A, B, C)
Definition: fs_common.h:187
Name for module "Redaction".
Definition: fs_common.h:141
Color space: Invalid.
Definition: fs_common.h:175
Fill mode: none.
Definition: fs_common.h:91
Center alignment.
Definition: fs_common.h:79
No rotation.
Definition: fs_common.h:59
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:77
Color space: CalRGB. (3 components, A, B, C)
Definition: fs_common.h:185
Definition: fs_common.h:311
void AddSingle(int index)
Add an index as a new range segment.
Name for module "Comparison".
Definition: fs_common.h:147
float dash_phase
Dash phase for dash pattern.
Definition: fs_common.h:1100
StandardID
Enumeration for standard font ID.
Definition: fs_common.h:1435
File format type: XFD.
Definition: fs_common.h:245
All the indexes within a range will be used.
Definition: fs_common.h:1198
BYTE STRING CLASS.
Definition: fx_string.h:317
Progress state: progress is finished.
Definition: fs_common.h:355
Font charset: Hebrew.
Definition: fs_common.h:1403
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:1377
static void Free(void *ptr)
Free a memory block.
Font style: small cap.
Definition: fs_common.h:1367
Font charset: Greek.
Definition: fs_common.h:1399
Font type: Type1.
Definition: fs_common.h:1473
Name for module "Accessibility".
Definition: fs_common.h:157
Rotate 90 degrees in clockwise direction.
Definition: fs_common.h:61
File format type: XML.
Definition: fs_common.h:243
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:1449
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:1407
Standard font: Courier.
Definition: fs_common.h:1437
GraphState & operator=(const GraphState &state)
Assign operator.
Definition: fs_common.h:1030
Font charset: Turkish.
Definition: fs_common.h:1401
FontMapResult(foxit::common::file::ReaderCallback *file_read, int face_index)
Constructor, with parameters.
Definition: fs_common.h:1831
bool operator !=(const RenderConfig &render_config) const
Not equal operator.
Definition: fs_common.h:449
Progress state: any error occurs.
Definition: fs_common.h:351
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:479
#define NULL
The null-pointer value.
Definition: fx_system.h:780
bool operator==(const RenderConfig &render_config) const
Equal operator.
Definition: fs_common.h:436
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:1155
void Set(int graphics_objs_count_in_one_step)
Set value.
Definition: fs_common.h:463
Definition: fx_coordinates.h:1076
Font charset: Eastern European.
Definition: fs_common.h:1395
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:81
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:1977
bool RemovePoint(int index)
Remove a point specified by index.
Position: top left.
Definition: fs_common.h:111
Font & operator=(const Font &other)
Assign operator.
Position: top center.
Definition: fs_common.h:113
bool IsItalic() const
Judge whether current font object is italic or not.
PointType
Enumeration for point type in path.
Definition: fs_common.h:1965
ColorSpace GetColorSpace()
Get the color space that current color belongs to.
Standard font: Courier-Oblique, Italic.
Definition: fs_common.h:1443
~GraphState()
Destructor.
Definition: fs_common.h:1007
Locale ID for country: Netherlands.
Definition: fs_common.h:215
Standard font: Courier-Bold.
Definition: fs_common.h:1439
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:249
Font charset: Thai.
Definition: fs_common.h:1393
CID Font charset: Adobe-Korea1.
Definition: fs_common.h:1425
void Set(foxit::common::file::ReaderCallback *file_read, int face_index)
Set value.
Definition: fs_common.h:1896
File format type: PDF.
Definition: fs_common.h:247
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:143
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:1089
RenderConfig & operator=(const RenderConfig &render_config)
Assign operator.
Definition: fs_common.h:424