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 * Notice: By downloading and using this artifact, you accept PDF Tools AG's
13 * [license agreement](https://www.pdf-tools.com/license-agreement/),
14 * [privacy policy](https://www.pdf-tools.com/privacy-policy/),
15 * and allow PDF Tools AG to track your usage data.
16 *
17 *****************************************************************************/
18
19#ifndef PDFTOOLS_PDFTOOLS_H__
20#define PDFTOOLS_PDFTOOLS_H__
21
22#ifndef PDFTOOLS_CALL
23#if defined(WIN32)
24#define PDFTOOLS_CALL __stdcall
25#else
26#define PDFTOOLS_CALL
27#endif
28#endif
29
30#include "PdfTools_Types.h"
32
33#ifdef __cplusplus
34extern "C"
35{
36#endif
37
38#ifdef _UNICODE
39#define PdfTools_GetLastErrorMessage PdfTools_GetLastErrorMessageW
40#define PdfTools_Sdk_Initialize PdfTools_Sdk_InitializeW
41
42#define PdfTools_Sdk_GetVersion PdfTools_Sdk_GetVersionW
43
44#define PdfTools_Sdk_GetProducerFullName PdfTools_Sdk_GetProducerFullNameW
45
46#define PdfTools_Sdk_GetProxy PdfTools_Sdk_GetProxyW
47#define PdfTools_Sdk_SetProxy PdfTools_Sdk_SetProxyW
48#define PdfTools_Sdk_GetLicensingService PdfTools_Sdk_GetLicensingServiceW
49#define PdfTools_Sdk_SetLicensingService PdfTools_Sdk_SetLicensingServiceW
50
51#define PdfTools_StringList_Get PdfTools_StringList_GetW
52#define PdfTools_StringList_Add PdfTools_StringList_AddW
53
54#define PdfTools_MetadataDictionary_Get PdfTools_MetadataDictionary_GetW
55#define PdfTools_MetadataDictionary_GetKey PdfTools_MetadataDictionary_GetKeyW
56#define PdfTools_MetadataDictionary_GetValue PdfTools_MetadataDictionary_GetValueW
57#define PdfTools_MetadataDictionary_Set PdfTools_MetadataDictionary_SetW
58#define PdfTools_MetadataDictionary_SetValue PdfTools_MetadataDictionary_SetValueW
59
60#define PdfTools_HttpClientHandler_SetClientCertificate PdfTools_HttpClientHandler_SetClientCertificateW
61#define PdfTools_HttpClientHandler_SetClientCertificateAndKey PdfTools_HttpClientHandler_SetClientCertificateAndKeyW
62
63#else
64#define PdfTools_GetLastErrorMessage PdfTools_GetLastErrorMessageA
65#define PdfTools_Sdk_Initialize PdfTools_Sdk_InitializeA
66
67#define PdfTools_Sdk_GetVersion PdfTools_Sdk_GetVersionA
68
69#define PdfTools_Sdk_GetProducerFullName PdfTools_Sdk_GetProducerFullNameA
70
71#define PdfTools_Sdk_GetProxy PdfTools_Sdk_GetProxyA
72#define PdfTools_Sdk_SetProxy PdfTools_Sdk_SetProxyA
73#define PdfTools_Sdk_GetLicensingService PdfTools_Sdk_GetLicensingServiceA
74#define PdfTools_Sdk_SetLicensingService PdfTools_Sdk_SetLicensingServiceA
75
76#define PdfTools_StringList_Get PdfTools_StringList_GetA
77#define PdfTools_StringList_Add PdfTools_StringList_AddA
78
79#define PdfTools_MetadataDictionary_Get PdfTools_MetadataDictionary_GetA
80#define PdfTools_MetadataDictionary_GetKey PdfTools_MetadataDictionary_GetKeyA
81#define PdfTools_MetadataDictionary_GetValue PdfTools_MetadataDictionary_GetValueA
82#define PdfTools_MetadataDictionary_Set PdfTools_MetadataDictionary_SetA
83#define PdfTools_MetadataDictionary_SetValue PdfTools_MetadataDictionary_SetValueA
84
85#define PdfTools_HttpClientHandler_SetClientCertificate PdfTools_HttpClientHandler_SetClientCertificateA
86#define PdfTools_HttpClientHandler_SetClientCertificateAndKey PdfTools_HttpClientHandler_SetClientCertificateAndKeyA
87
88#endif
89
90/******************************************************************************
91 * Library
92 *****************************************************************************/
93
101
109
118
132PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_GetLastErrorMessageA(char* pBuffer, size_t nBufferSize);
133
148
157PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfTools_SetLastErrorA(TPdfTools_ErrorCode iErrorCode, const char* szErrorMessage);
158
168
169/******************************************************************************
170 * Object
171 *****************************************************************************/
181
190
202
213/******************************************************************************
214 * ConsumptionData
215 *****************************************************************************/
250
251/******************************************************************************
252 * LicenseInfo
253 *****************************************************************************/
285 TPdfToolsSys_Date* pExpirationDate);
303
304/******************************************************************************
305 * Sdk
306 *****************************************************************************/
334PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_InitializeA(const char* szLicense, const char* szProducerSuffix);
362PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfTools_Sdk_InitializeW(const WCHAR* szLicense, const WCHAR* szProducerSuffix);
363
379PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetVersionA(char* pBuffer, size_t nBufferSize);
395PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetVersionW(WCHAR* pBuffer, size_t nBufferSize);
413PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProducerFullNameA(char* pBuffer, size_t nBufferSize);
468PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfTools_Sdk_GetProxyA(char* pBuffer, size_t nBufferSize);
505PDFTOOLS_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);
768
769/******************************************************************************
770 * StringList
771 *****************************************************************************/
781
817 char* pBuffer, size_t nBufferSize);
840 WCHAR* pBuffer, size_t nBufferSize);
875
876/******************************************************************************
877 * MetadataDictionary
878 *****************************************************************************/
888
982 int it);
1003 const char* szKey);
1024 const WCHAR* szKey);
1047 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, char* pBuffer, size_t nBufferSize);
1070 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, WCHAR* pBuffer, size_t nBufferSize);
1093 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, char* pBuffer, size_t nBufferSize);
1116 TPdfTools_MetadataDictionary* pMetadataDictionary, int it, WCHAR* pBuffer, size_t nBufferSize);
1138 const char* szKey, const char* szValue);
1160 const WCHAR* szKey, const WCHAR* szValue);
1179PdfTools_MetadataDictionary_SetValueA(TPdfTools_MetadataDictionary* pMetadataDictionary, int it, const char* szValue);
1231 int it);
1232
1233/******************************************************************************
1234 * HttpClientHandler
1235 *****************************************************************************/
1248
1275 const TPdfToolsSys_StreamDescriptor* pArchive, const char* szPassword);
1301 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pArchive,
1302 const WCHAR* szPassword);
1329 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pCert,
1330 const TPdfToolsSys_StreamDescriptor* pKey, const char* szPassword);
1357 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pCert,
1358 const TPdfToolsSys_StreamDescriptor* pKey, const WCHAR* szPassword);
1381 TPdfTools_HttpClientHandler* pHttpClientHandler, const TPdfToolsSys_StreamDescriptor* pCert);
1382
1426 TPdfTools_HttpClientHandler* pHttpClientHandler, BOOL bSslVerifyServerCertificate);
1427
1428#ifdef __cplusplus
1429}
1430#endif
1431
1432#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:26
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:143
unsigned short WCHAR
Definition PdfTools_Platform.h:95
#define BOOL
Definition PdfTools_Types.h:23
TPdfTools_ErrorCode
Definition PdfTools_Types.h:34
The handler and options for communication to remote server.
Definition PdfTools_Types.h:3322
Structure that groups a set of callbacks that model streams.
Definition PdfTools_PdfToolsSys.h:49