|
static void | Initialize (const char *license_key=0) |
|
static void | EnableJavaScript (bool enable) |
|
static bool | IsJavaScriptEnabled () |
|
static void | Terminate () |
|
static bool | SetResourcesPath (const UString &path) |
|
static UString | GetResourcesPath () |
|
static double | GetVersion () |
|
static PDFNet::CloudErrorCode | ConnectToCloud (const char *username, const char *password, bool demo_mode=false) |
|
static void | SetColorManagement (CMSType t=e_lcms) |
|
static void | SetDefaultDeviceCMYKProfile (const UString &icc_filename) |
|
static void | SetDefaultDeviceRGBProfile (const UString &icc_filename) |
|
static void | SetDefaultDiskCachingEnabled (bool use_disk) |
|
static void | SetDefaultFlateCompressionLevel (int level) |
|
static void | SetViewerCache (size_t max_cache_size, bool on_disk) |
|
static bool | AddFontSubst (const char *fontname, const UString &fontpath) |
|
static bool | AddFontSubst (CharacterOrdering ordering, const UString &fontpath) |
|
static void | SetTempPath (const UString &temp_path) |
|
static void | SetPersistentCachePath (const UString &persistent_path) |
|
static void | RegisterSecurityHandler (const char *handler_name, const char *gui_name, CreateSecurityHandler factory_method) |
|
static SecurityDescriptorIterator | GetSecHdlrInfoIterator () |
|
static void | SetNumberWriteProc (char *(*WriteProc)(double num, char *in_buf, int in_buf_size)) |
|
static void | SetNumberReadProc (TRN_Bool(*ReadProc)(const TRN_UChar *buf, double *output)) |
|
PDFNet contains global library initialization, registration, configuration, and termination methods.
- Note
- there is only a single, static instance of PDFNet class. Initialization and termination methods need to be called only once per application session.
Definition at line 21 of file PDFNet.h.
static bool pdftron::PDFNet::AddFontSubst |
( |
const char * |
fontname, |
|
|
const UString & |
fontpath |
|
) |
| |
|
static |
AddFontSubst functions can be used to create font substitutes that can override default PDFNet font selection algorithm.
AddFontSubst functions are useful in situations where referenced fonts are not present in the document and PDFNet font substitution algorithm is not producing desired results.
AddFontSubst(fontname, fontpath) maps the given font name (i.e. 'BaseFont' entry from the font dictionary) to a font file.
The following is an example of using this function to provide user defined font substitutes:
*
* ...
* PDFDoc doc("c:/my.pdf");
* ...
*
AddFontSubst functions can be used to create font substitutes that can override default PDFNet font selection algorithm.
AddFontSubst functions are useful in situations where referenced fonts are not present in the document and PDFNet font substitution algorithm is not producing desired results.
AddFontSubst(ordering, fontpath) maps the given character ordering (see Ordering entry in CIDSystemInfo dictionary; Section 5.6.2 in PDF Reference) to a font file. This method is less specific that the former variant of AddFontSubst, and can be used to override a range of missing fonts (or any missing font) with a predefined substitute.
The following is an example of using this function to provide user defined font substitutes:
*
*
* ...
* PDFDoc doc("c:/my.pdf");
* ...
*
static PDFNet::CloudErrorCode pdftron::PDFNet::ConnectToCloud |
( |
const char * |
username, |
|
|
const char * |
password, |
|
|
bool |
demo_mode = false |
|
) |
| |
|
static |
ConnectToCloud() is used to connect PDFNet with your 'pay-as-you-go' account (http://www.pdftron.com/pws/onpremise.html).
PDFTron Cloud is a 'pay-as-you-go' service that offers PDFTron document conversion and processing capabilities with minimal startup costs.
PDFTron Cloud account allows applications to convert documents either on your own servers (e.g. using PDFNet SDK or DocPub CLI) or via PDFTron hosted REST service.
Benefits of the self-hosted model are related to privacy and increased flexibility and speed from your own hardware infrastructure. On the other hand, self-hosted model may be more costly due to operation fees.
- Note
- Please note that in order to use ConnectToCloud() you need to have a valid Enterprise or Web CPU license for PDFNet. If you do not need additional functionality provided by PDFNet (e.g. you simply need to convert), please use DocPub CLI instead of PDFNet SDK.
-
ConnectToCloud() should be called once, immediately after PDFNet.Initialize("...license key...").
-
List of functions supported by pay-as-you-go:
- FromEmf (free)
- ToEmf (free)
- ToSvg (chargeable)
- ToPDF (chargeable, except image to PDF)
- FromXps (chargeable)
- ToXps (chargeable)
- ToXod (chargeable)
- Flattener (chargeable)
- PDFACompliance (chargeable)
- ToHtml (chargeable)
- ToEpub (chargeable)
- Parameters
-
username | Your API ID. You should receive this information via email after Cloud API service (https://api.pdftron.com) sign-up. You can also find your 'API ID' in the 'Account' section in your PDFTron Cloud account. |
password | This information is provided together with 'api_id' and can also be retrieved from https://api.pdftron.com. |
- Returns
- CloudErrorCode will be returned. STATUS_OK if PDFNet successfully connected to your Cloud account.
- Exceptions
-
If | called before call to PDFNet.Initialized or in DEMO mode, the function will throw an exception. |