Pdftools SDK
Loading...
Searching...
No Matches
PdfTools_PdfTools.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * File: PdfTools_PdfTools.h
4 *
5 * Description: Sub Header file for Pdftools SDK
6 *
7 * Author: PDF Tools AG
8 *
9 * Copyright: Copyright (C) 2023 - 2024 PDF Tools AG, Switzerland
10 * All rights reserved.
11 *
12 *****************************************************************************/
13
14#ifndef PDFTOOLS_PDFTOOLS_H__
15#define PDFTOOLS_PDFTOOLS_H__
16
17#ifndef PDFTOOLS_CALL
18#if defined(WIN32)
19#define PDFTOOLS_CALL __stdcall
20#else
21#define PDFTOOLS_CALL
22#endif
23#endif
24
25#include "PdfTools_Types.h"
27
28#ifdef __cplusplus
29extern "C"
30{
31#endif
32
33#ifdef _UNICODE
34#define PdfTools_GetLastErrorMessage PdfTools_GetLastErrorMessageW
35#define PdfTools_Sdk_Initialize PdfTools_Sdk_InitializeW
36
37#define PdfTools_Sdk_GetVersion PdfTools_Sdk_GetVersionW
38
39#define PdfTools_Sdk_GetProducerFullName PdfTools_Sdk_GetProducerFullNameW
40
41#define PdfTools_Sdk_GetProxy PdfTools_Sdk_GetProxyW
42#define PdfTools_Sdk_SetProxy PdfTools_Sdk_SetProxyW
43#define PdfTools_Sdk_GetLicensingService PdfTools_Sdk_GetLicensingServiceW
44#define PdfTools_Sdk_SetLicensingService PdfTools_Sdk_SetLicensingServiceW
45
46#define PdfTools_StringList_Get PdfTools_StringList_GetW
47#define PdfTools_StringList_Add PdfTools_StringList_AddW
48
49#define PdfTools_MetadataDictionary_Get PdfTools_MetadataDictionary_GetW
50#define PdfTools_MetadataDictionary_GetKey PdfTools_MetadataDictionary_GetKeyW
51#define PdfTools_MetadataDictionary_GetValue PdfTools_MetadataDictionary_GetValueW
52#define PdfTools_MetadataDictionary_Set PdfTools_MetadataDictionary_SetW
53#define PdfTools_MetadataDictionary_SetValue PdfTools_MetadataDictionary_SetValueW
54
55#define PdfTools_HttpClientHandler_SetClientCertificate PdfTools_HttpClientHandler_SetClientCertificateW
56#define PdfTools_HttpClientHandler_SetClientCertificateAndKey PdfTools_HttpClientHandler_SetClientCertificateAndKeyW
57
58#else
59#define PdfTools_GetLastErrorMessage PdfTools_GetLastErrorMessageA
60#define PdfTools_Sdk_Initialize PdfTools_Sdk_InitializeA
61
62#define PdfTools_Sdk_GetVersion PdfTools_Sdk_GetVersionA
63
64#define PdfTools_Sdk_GetProducerFullName PdfTools_Sdk_GetProducerFullNameA
65
66#define PdfTools_Sdk_GetProxy PdfTools_Sdk_GetProxyA
67#define PdfTools_Sdk_SetProxy PdfTools_Sdk_SetProxyA
68#define PdfTools_Sdk_GetLicensingService PdfTools_Sdk_GetLicensingServiceA
69#define PdfTools_Sdk_SetLicensingService PdfTools_Sdk_SetLicensingServiceA
70
71#define PdfTools_StringList_Get PdfTools_StringList_GetA
72#define PdfTools_StringList_Add PdfTools_StringList_AddA
73
74#define PdfTools_MetadataDictionary_Get PdfTools_MetadataDictionary_GetA
75#define PdfTools_MetadataDictionary_GetKey PdfTools_MetadataDictionary_GetKeyA
76#define PdfTools_MetadataDictionary_GetValue PdfTools_MetadataDictionary_GetValueA
77#define PdfTools_MetadataDictionary_Set PdfTools_MetadataDictionary_SetA
78#define PdfTools_MetadataDictionary_SetValue PdfTools_MetadataDictionary_SetValueA
79
80#define PdfTools_HttpClientHandler_SetClientCertificate PdfTools_HttpClientHandler_SetClientCertificateA
81#define PdfTools_HttpClientHandler_SetClientCertificateAndKey PdfTools_HttpClientHandler_SetClientCertificateAndKeyA
82
83#endif
84
85/******************************************************************************
86 * Library
87 *****************************************************************************/
88
96
104
114
128PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_GetLastErrorMessageA(char* pBuffer, size_t nBufferSize);
129
144
153PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_SetLastErrorA(TPdfTools_ErrorCode iErrorCode, const char* szErrorMessage);
154
164
165/******************************************************************************
166 * Object
167 *****************************************************************************/
177
186
198
209/******************************************************************************
210 * ConsumptionData
211 *****************************************************************************/
248
249/******************************************************************************
250 * LicenseInfo
251 *****************************************************************************/
283 TPdfToolsSys_Date* pExpirationDate);
301
302/******************************************************************************
303 * Sdk
304 *****************************************************************************/
330PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_InitializeA(const char* szLicense, const char* szProducerSuffix);
356PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_InitializeW(const WCHAR* szLicense, const WCHAR* szProducerSuffix);
357
374PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetVersionA(char* pBuffer, size_t nBufferSize);
391PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetVersionW(WCHAR* pBuffer, size_t nBufferSize);
410PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProducerFullNameA(char* pBuffer, size_t nBufferSize);
466PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProxyA(char* pBuffer, size_t nBufferSize);
503PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProxyW(WCHAR* pBuffer, size_t nBufferSize);
652PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetLicensingServiceA(char* pBuffer, size_t nBufferSize);
770
771/******************************************************************************
772 * StringList
773 *****************************************************************************/
784
822 char* pBuffer, size_t nBufferSize);
846 WCHAR* pBuffer, size_t nBufferSize);
881
882/******************************************************************************
883 * MetadataDictionary
884 *****************************************************************************/
895
995 int it);
1017 const char* szKey);
1039 const WCHAR* szKey);
1063 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, char* pBuffer, size_t nBufferSize);
1087 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, WCHAR* pBuffer, size_t nBufferSize);
1111 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, char* pBuffer, size_t nBufferSize);
1135 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, WCHAR* pBuffer, size_t nBufferSize);
1157 const char* szKey, const char* szValue);
1179 const WCHAR* szKey, const WCHAR* szValue);
1198PdfTools_MetadataDictionary_SetValueA(TPdfTools_MetadataDictionary* pMetadataDictionary, int it, const char* szValue);
1250 int it);
1251
1252/******************************************************************************
1253 * HttpClientHandler
1254 *****************************************************************************/
1268
1295 const TPdfToolsSys_StreamDescriptor* pArchive, const char* szPassword);
1321 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pArchive,
1322 const WCHAR* szPassword);
1349 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pCert,
1350 const TPdfToolsSys_StreamDescriptor* pKey, const char* szPassword);
1377 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pCert,
1378 const TPdfToolsSys_StreamDescriptor* pKey, const WCHAR* szPassword);
1401 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pCert);
1402
1446 TPdfTools_HttpClientHandler* pHttpClientHandler, BOOL bSslVerifyServerCertificate);
1447
1448#ifdef __cplusplus
1449}
1450#endif
1451
1452#endif /* PDFTOOLS_PDFTOOLS_H__ */
PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_Initialize()
Initializes the library.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_MetadataDictionary_GetA(TPdfTools_MetadataDictionary *pMetadataDictionary, const char *szKey)
Get the position of a key in the map. If no error occurred, then the position can be used to get the ...
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_MetadataDictionary_GetEnd(TPdfTools_MetadataDictionary *pMetadataDictionary)
Get the end position of the map.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Equals(void *pObject, void *pOther)
Compare two native objects.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetVersionW(WCHAR *pBuffer, size_t nBufferSize)
The version of the SDK.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_HttpClientHandler_SetClientCertificateAndKeyW(TPdfTools_HttpClientHandler *pHttpClientHandler, const TPdfToolsSys_StreamDescriptor *pCert, const TPdfToolsSys_StreamDescriptor *pKey, const WCHAR *szPassword)
Set the SSL/TLS client certificate and private key The file must contain the certificate and its priv...
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_HttpClientHandler_AddTrustedCertificate(TPdfTools_HttpClientHandler *pHttpClientHandler, const TPdfToolsSys_StreamDescriptor *pCert)
Add a certificate to the trust store Add a certificate to the trust store of this HttpClientHandler i...
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_HttpClientHandler_SetClientCertificateAndKeyA(TPdfTools_HttpClientHandler *pHttpClientHandler, const TPdfToolsSys_StreamDescriptor *pCert, const TPdfToolsSys_StreamDescriptor *pKey, const char *szPassword)
Set the SSL/TLS client certificate and private key The file must contain the certificate and its priv...
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProducerFullNameW(WCHAR *pBuffer, size_t nBufferSize)
The producer string that is set within the metadata of PDF output documents The producer string depen...
PDFTOOLS_EXPORT TPdfTools_HttpClientHandler *PDFTOOLS_CALL PdfTools_HttpClientHandler_New(void)
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_HttpClientHandler_SetClientCertificateA(TPdfTools_HttpClientHandler *pHttpClientHandler, const TPdfToolsSys_StreamDescriptor *pArchive, const char *szPassword)
Set the SSL/TLS client certificate as PFX (PKCS#12) archive The file must contain the certificate its...
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_SetProxyW(const WCHAR *szProxy)
Proxy to use for all communication to remote servers.
PDFTOOLS_EXPORT TPdfTools_HttpClientHandler *PDFTOOLS_CALL PdfTools_Sdk_GetHttpClientHandler(void)
The default handler for communication to remote servers This instance is used wherever there is no de...
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProxyW(WCHAR *pBuffer, size_t nBufferSize)
Proxy to use for all communication to remote servers.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_MetadataDictionary_GetValueA(TPdfTools_MetadataDictionary *pMetadataDictionary, int it, char *pBuffer, size_t nBufferSize)
Get the value of the entry given a position.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_MetadataDictionary_GetW(TPdfTools_MetadataDictionary *pMetadataDictionary, const WCHAR *szKey)
Get the position of a key in the map. If no error occurred, then the position can be used to get the ...
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProducerFullNameA(char *pBuffer, size_t nBufferSize)
The producer string that is set within the metadata of PDF output documents The producer string depen...
PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_Release(void *pObject)
Release object.
PDFTOOLS_EXPORT TPdfTools_MetadataDictionary *PDFTOOLS_CALL PdfTools_MetadataDictionary_New(void)
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetVersionA(char *pBuffer, size_t nBufferSize)
The version of the SDK.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_GetHashCode(void *pObject)
Get a hash code.
PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_SetLastErrorW(TPdfTools_ErrorCode iErrorCode, const WCHAR *szErrorMessage)
Set last error code and error message.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_MetadataDictionary_Remove(TPdfTools_MetadataDictionary *pMetadataDictionary, int it)
Remove the entry at a position in the map.
PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_SetLastErrorA(TPdfTools_ErrorCode iErrorCode, const char *szErrorMessage)
Set last error code and error message.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_StringList_GetA(TPdfTools_StringList *pStringList, int iIndex, char *pBuffer, size_t nBufferSize)
Returns the element at the specified position in the given list.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_StringList_AddA(TPdfTools_StringList *pStringList, const char *szString)
Add an element to the end of the list.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_MetadataDictionary_GetBegin(TPdfTools_MetadataDictionary *pMetadataDictionary)
Get the position of the first entry in the map.
PDFTOOLS_EXPORT TPdfTools_ErrorCode PDFTOOLS_CALL PdfTools_GetLastError()
Retrieves the last error code.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_HttpClientHandler_SetSslVerifyServerCertificate(TPdfTools_HttpClientHandler *pHttpClientHandler, BOOL bSslVerifyServerCertificate)
Verify the server certificate for SSL/TLS.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_MetadataDictionary_GetKeyW(TPdfTools_MetadataDictionary *pMetadataDictionary, int it, WCHAR *pBuffer, size_t nBufferSize)
Get the key of the entry given a position.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_StringList_GetCount(TPdfTools_StringList *pStringList)
Get the number of elements in the list.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_MetadataDictionary_Clear(TPdfTools_MetadataDictionary *pMetadataDictionary)
Remove all entries from the map.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_StringList_GetW(TPdfTools_StringList *pStringList, int iIndex, WCHAR *pBuffer, size_t nBufferSize)
Returns the element at the specified position in the given list.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_MetadataDictionary_SetValueW(TPdfTools_MetadataDictionary *pMetadataDictionary, int it, const WCHAR *szValue)
Set the value of the entry at a position in the map.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_MetadataDictionary_SetW(TPdfTools_MetadataDictionary *pMetadataDictionary, const WCHAR *szKey, const WCHAR *szValue)
Set the value of an entry for a given key. This operation invalidates all positions previously return...
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_InitializeW(const WCHAR *szLicense, const WCHAR *szProducerSuffix)
Initialize the product and the license key. Before calling any of the other functions of the SDK,...
PDFTOOLS_EXPORT TPdfTools_ConsumptionData *PDFTOOLS_CALL PdfTools_LicenseInfo_GetConsumptionData(TPdfTools_LicenseInfo *pLicenseInfo)
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_GetUsageTracking(void)
Property denoting whether the usage tracking is enabled or disabled.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_SetLicensingServiceA(const char *szLicensingService)
Licensing service to use for all licensing requests.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProxyA(char *pBuffer, size_t nBufferSize)
Proxy to use for all communication to remote servers.
PDFTOOLS_EXPORT TPdfTools_LicenseInfo *PDFTOOLS_CALL PdfTools_Sdk_GetLicenseInfoSnapshot(void)
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_MetadataDictionary_GetKeyA(TPdfTools_MetadataDictionary *pMetadataDictionary, int it, char *pBuffer, size_t nBufferSize)
Get the key of the entry given a position.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_MetadataDictionary_GetValueW(TPdfTools_MetadataDictionary *pMetadataDictionary, int it, WCHAR *pBuffer, size_t nBufferSize)
Get the value of the entry given a position.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_MetadataDictionary_GetNext(TPdfTools_MetadataDictionary *pMetadataDictionary, int it)
Get the position of the next entry in the map.
PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_Uninitialize()
Uninitializes the library.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_MetadataDictionary_SetA(TPdfTools_MetadataDictionary *pMetadataDictionary, const char *szKey, const char *szValue)
Set the value of an entry for a given key. This operation invalidates all positions previously return...
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_ConsumptionData_GetOverconsumption(TPdfTools_ConsumptionData *pConsumptionData)
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetLicensingServiceW(WCHAR *pBuffer, size_t nBufferSize)
Licensing service to use for all licensing requests.
#define PDFTOOLS_CALL
Definition PdfTools_PdfTools.h:21
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_SetLicensingServiceW(const WCHAR *szLicensingService)
Licensing service to use for all licensing requests.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_ConsumptionData_GetRemainingPages(TPdfTools_ConsumptionData *pConsumptionData)
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_HttpClientHandler_SetClientCertificateW(TPdfTools_HttpClientHandler *pHttpClientHandler, const TPdfToolsSys_StreamDescriptor *pArchive, const WCHAR *szPassword)
Set the SSL/TLS client certificate as PFX (PKCS#12) archive The file must contain the certificate its...
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_MetadataDictionary_GetSize(TPdfTools_MetadataDictionary *pMetadataDictionary)
The number of key-value pairs in the map.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_LicenseInfo_GetExpirationDate(TPdfTools_LicenseInfo *pLicenseInfo, TPdfToolsSys_Date *pExpirationDate)
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_InitializeA(const char *szLicense, const char *szProducerSuffix)
Initialize the product and the license key. Before calling any of the other functions of the SDK,...
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_GetLastErrorMessageA(char *pBuffer, size_t nBufferSize)
Retrieves the last error message.
PDFTOOLS_EXPORT int PDFTOOLS_CALL PdfTools_MetadataDictionary_GetCount(TPdfTools_MetadataDictionary *pMetadataDictionary)
The number of key-value pairs in the map.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_StringList_AddW(TPdfTools_StringList *pStringList, const WCHAR *szString)
Add an element to the end of the list.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_LicenseInfo_IsValid(TPdfTools_LicenseInfo *pLicenseInfo)
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetLicensingServiceA(char *pBuffer, size_t nBufferSize)
Licensing service to use for all licensing requests.
PDFTOOLS_EXPORT TPdfTools_StringList *PDFTOOLS_CALL PdfTools_StringList_New(void)
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_SetProxyA(const char *szProxy)
Proxy to use for all communication to remote servers.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_SetUsageTracking(BOOL bUsageTracking)
Property denoting whether the usage tracking is enabled or disabled.
PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_GetLastErrorMessageW(WCHAR *pBuffer, size_t nBufferSize)
Retrieve last error message.
PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_AddRef(void *pObject)
Increase reference count of object.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_MetadataDictionary_SetValueA(TPdfTools_MetadataDictionary *pMetadataDictionary, int it, const char *szValue)
Set the value of the entry at a position in the map.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_HttpClientHandler_GetSslVerifyServerCertificate(TPdfTools_HttpClientHandler *pHttpClientHandler)
Verify the server certificate for SSL/TLS.
#define PDFTOOLS_EXPORT
Definition PdfTools_Platform.h:138
unsigned short WCHAR
Definition PdfTools_Platform.h:90
struct TPdfTools_LicenseInfo TPdfTools_LicenseInfo
Definition PdfTools_Types.h:2120
struct TPdfTools_StringList TPdfTools_StringList
Definition PdfTools_Types.h:2127
struct TPdfTools_HttpClientHandler TPdfTools_HttpClientHandler
The handler and options for communication to remote server.
Definition PdfTools_Types.h:2172
struct TPdfTools_MetadataDictionary TPdfTools_MetadataDictionary
Definition PdfTools_Types.h:2130
#define BOOL
Definition PdfTools_Types.h:18
struct TPdfTools_ConsumptionData TPdfTools_ConsumptionData
Definition PdfTools_Types.h:2115
TPdfTools_ErrorCode
Definition PdfTools_Types.h:29
Definition PdfTools_Types.h:3208
Structure that groups a set of callbacks that model streams.
Definition PdfTools_PdfToolsSys.h:44