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-2018 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 
12 namespace pdftron {
13 
21 class PDFNet
22 {
23 public:
24 
38  static void Initialize(const char* license_key = 0);
39 
45  static void EnableJavaScript(bool enable);
46 
52  static bool IsJavaScriptEnabled();
53 
54 #ifndef SWIG
55 
62  static void Terminate();
63 #endif
64 
79  static bool SetResourcesPath(const UString& path);
80 
85  static UString GetResourcesPath();
86 
90  static double GetVersion();
91 
93  {
101  };
149  static PDFNet::CloudErrorCode ConnectToCloud(const char* username, const char* password, bool demo_mode = false);
150 
151  enum CMSType
152  {
156  };
157 
164  static void SetColorManagement(CMSType t = e_lcms);
165 
176  static void SetDefaultDeviceCMYKProfile(const UString& icc_filename);
177 
188  static void SetDefaultDeviceRGBProfile(const UString& icc_filename);
189 
196  static void SetDefaultDiskCachingEnabled( bool use_disk );
197 
199  {
204  };
217  static void SetDefaultFlateCompressionLevel(int level);
218 
229  static void SetViewerCache(size_t max_cache_size, bool on_disk);
230 
238  e_Japan1 = 1,
239  e_Japan2 = 2,
240  e_GB1 = 3,
241  e_CNS1 = 4,
242  e_Korea1 = 5
243  };
244 
272  static bool AddFontSubst(const char* fontname, const UString& fontpath);
306  static bool AddFontSubst(CharacterOrdering ordering, const UString& fontpath);
307 
314  static void SetTempPath(const UString& temp_path);
315 
322  static void SetPersistentCachePath(const UString& persistent_path);
323 
324 #ifndef SWIG
325 
330  typedef TRN_PDFNetCreateSecurityHandler CreateSecurityHandler;
331 
340  static void RegisterSecurityHandler(const char* handler_name, const char* gui_name, CreateSecurityHandler factory_method);
341 
345  class SecurityDescriptor : public TRN_SecHdlrInfo {
346  public:
347  const char* GetName() { return m_name; }
348  const char* GetGuiName() { return m_gui_name; }
349  CreateSecurityHandler GetCreateFunct() { return m_factory_method; }
350  };
351 
353 
359 
372  static void SetNumberWriteProc(char* (*WriteProc) (double num, char *in_buf, int in_buf_size));
373 
382  static void SetNumberReadProc(TRN_Bool (*ReadProc) (const TRN_UChar *buf, double *output));
383 #endif
384 
386  typedef enum _LogLevel
387  {
388  e_LogLevel_Off = -1,
389  e_LogLevel_Fatal = 5,
390  e_LogLevel_Error = 4,
391  e_LogLevel_Warning = 3,
392  e_LogLevel_Info = 2,
393  e_LogLevel_Trace = 1,
394  e_LogLevel_Debug = 0
395  }
396  LogLevel;
397 
398  static void SetLogLevel(LogLevel level = e_LogLevel_Fatal);
400 };
401 
402 
403 #include <Impl/PDFNet.inl>
404 
405 }; // namespace pdftron
406 
407 #endif // PDFTRON_H_CPPPDFPDFNet
static void SetViewerCache(size_t max_cache_size, bool on_disk)
No ICC color management.
Definition: PDFNet.h:155
static void SetDefaultDeviceCMYKProfile(const UString &icc_filename)
static bool IsJavaScriptEnabled()
Can&#39;t establish a connection due networking error; Check your connectivity to the internet and firewa...
Definition: PDFNet.h:96
Server is not responding. If the error persists go to http://www.pdftron.com/kb_cloud_error.
Definition: PDFNet.h:98
TRN_PDFNetCreateSecurityHandler CreateSecurityHandler
Definition: PDFNet.h:330
Use Windows ICM2 (available only on Windows platforms).
Definition: PDFNet.h:154
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:352
Use LittleCMS (available on all supported platforms).
Definition: PDFNet.h:153
Unexpected internal server error. If the error persists go to http://www.pdftron.com/kb_cloud_error.
Definition: PDFNet.h:99
static bool AddFontSubst(const char *fontname, const UString &fontpath)
static void EnableJavaScript(bool enable)
static void Initialize(const char *license_key=0)
Credentials are correct.
Definition: PDFNet.h:95
static void SetTempPath(const UString &temp_path)
Credentials provided for authentication are incorrect. Make sure you are subscribed to pay as you go ...
Definition: PDFNet.h:97
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:241
CreateSecurityHandler GetCreateFunct()
Definition: PDFNet.h:349
Chinese; Simplified.
Definition: PDFNet.h:240
static void SetDefaultDiskCachingEnabled(bool use_disk)
static SecurityDescriptorIterator GetSecHdlrInfoIterator()
static void RegisterSecurityHandler(const char *handler_name, const char *gui_name, CreateSecurityHandler factory_method)
static PDFNet::CloudErrorCode ConnectToCloud(const char *username, const char *password, bool demo_mode=false)
Generic/Unicode.
Definition: PDFNet.h:237
static void SetNumberWriteProc(char *(*WriteProc)(double num, char *in_buf, int in_buf_size))
Unexpected error. If the error persists go to http://www.pdftron.com/kb_cloud_error.
Definition: PDFNet.h:94
static UString GetResourcesPath()

© 2002-2014 PDFTron Systems Inc.