All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PDFNet.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2020 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFPDFNet
6 #define PDFTRON_H_CPPPDFPDFNet
7 
8 #include <C/PDF/TRN_PDFNet.h>
9 #include <Common/UString.h>
10 #include <Common/Iterator.h>
11 #include <Filters/Filter.h>
12 
13 namespace pdftron {
14 
22 class PDFNet
23 {
24 public:
25 
39  static void Initialize(const char* license_key = 0);
40 
46  static void EnableJavaScript(bool enable);
47 
53  static bool IsJavaScriptEnabled();
54 
55 #ifndef SWIG
56 
63  static void Terminate();
64 #endif
65 
80  static bool SetResourcesPath(const UString& path);
81 
86  static UString GetResourcesPath();
87 
98  static void AddResourceSearchPath(const UString& path);
99 
103  static double GetVersion();
104 
105  enum CMSType
106  {
110  };
111 
118  static void SetColorManagement(CMSType t = e_lcms);
119 
130  static void SetDefaultDeviceCMYKProfile(const UString& icc_filename);
131 
142  static void SetDefaultDeviceCMYKProfile(Filters::Filter stream);
143 
144 
155  static void SetDefaultDeviceRGBProfile(const UString& icc_filename);
156 
167  static void SetDefaultDeviceRGBProfile(Filters::Filter stream);
168 
175  static void SetDefaultDiskCachingEnabled( bool use_disk );
176 
178  {
183  };
196  static void SetDefaultFlateCompressionLevel(int level);
197 
208  static void SetViewerCache(size_t max_cache_size, bool on_disk);
209 
217  e_Japan1 = 1,
218  e_Japan2 = 2,
219  e_GB1 = 3,
220  e_CNS1 = 4,
221  e_Korea1 = 5
222  };
223 
251  static bool AddFontSubst(const char* fontname, const UString& fontpath);
285  static bool AddFontSubst(CharacterOrdering ordering, const UString& fontpath);
286 
293  static void SetTempPath(const UString& temp_path);
294 
301  static void SetPersistentCachePath(const UString& persistent_path);
302 
308  static UString GetSystemFontList();
309 
310 #ifndef SWIG
311 
316  typedef TRN_PDFNetCreateSecurityHandler CreateSecurityHandler;
317 
326  static void RegisterSecurityHandler(const char* handler_name, const char* gui_name, CreateSecurityHandler factory_method);
327 
331  class SecurityDescriptor : public TRN_SecHdlrInfo {
332  public:
333  const char* GetName() { return m_name; }
334  const char* GetGuiName() { return m_gui_name; }
335  CreateSecurityHandler GetCreateFunct() { return m_factory_method; }
336  };
337 
339 
345 
358  static void SetNumberWriteProc(char* (*WriteProc) (double num, char *in_buf, int in_buf_size));
359 
368  static void SetNumberReadProc(TRN_Bool (*ReadProc) (const TRN_UChar *buf, double *output));
369 #endif
370 
372  typedef enum _LogLevel
373  {
374  e_LogLevel_Off = -1,
375  e_LogLevel_Fatal = 5,
376  e_LogLevel_Error = 4,
377  e_LogLevel_Warning = 3,
378  e_LogLevel_Info = 2,
379  e_LogLevel_Trace = 1,
380  e_LogLevel_Debug = 0
381  }
382  LogLevel;
383 
384  static void SetLogLevel(LogLevel level = e_LogLevel_Fatal);
386 
387 
388 
389 };
390 
391 
392 
393 #include <Impl/PDFNet.inl>
394 
395 }; // namespace pdftron
396 
397 #endif // PDFTRON_H_CPPPDFPDFNet
static void SetViewerCache(size_t max_cache_size, bool on_disk)
No ICC color management.
Definition: PDFNet.h:109
static void SetDefaultDeviceCMYKProfile(const UString &icc_filename)
static bool IsJavaScriptEnabled()
TRN_PDFNetCreateSecurityHandler CreateSecurityHandler
Definition: PDFNet.h:316
Use Windows ICM2 (available only on Windows platforms).
Definition: PDFNet.h:108
static void Terminate()
static void SetDefaultFlateCompressionLevel(int level)
static void SetNumberReadProc(TRN_Bool(*ReadProc)(const TRN_UChar *buf, double *output))
Common::Iterator< SecurityDescriptor > SecurityDescriptorIterator
Definition: PDFNet.h:338
Use LittleCMS (available on all supported platforms).
Definition: PDFNet.h:107
static bool AddFontSubst(const char *fontname, const UString &fontpath)
static void EnableJavaScript(bool enable)
static void Initialize(const char *license_key=0)
static void SetTempPath(const UString &temp_path)
static UString GetSystemFontList()
static bool SetResourcesPath(const UString &path)
static double GetVersion()
static void SetDefaultDeviceRGBProfile(const UString &icc_filename)
static void SetColorManagement(CMSType t=e_lcms)
static void SetPersistentCachePath(const UString &persistent_path)
Chinese; Traditional.
Definition: PDFNet.h:220
CreateSecurityHandler GetCreateFunct()
Definition: PDFNet.h:335
Chinese; Simplified.
Definition: PDFNet.h:219
static void SetDefaultDiskCachingEnabled(bool use_disk)
static void AddResourceSearchPath(const UString &path)
static SecurityDescriptorIterator GetSecHdlrInfoIterator()
static void RegisterSecurityHandler(const char *handler_name, const char *gui_name, CreateSecurityHandler factory_method)
Generic/Unicode.
Definition: PDFNet.h:216
static void SetNumberWriteProc(char *(*WriteProc)(double num, char *in_buf, int in_buf_size))
static UString GetResourcesPath()