PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
attachments.h
Go to the documentation of this file.
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_CORE_ATTACHMENTS_H_INCLUDED_
4#define PDFSDK_CORE_ATTACHMENTS_H_INCLUDED_
5
11#include <pdfsdk/core/api_macro.h>
12#include <pdfsdk/core/atoms.h>
13#include <pdfsdk/core/content.h>
15#include <pdfsdk/errors.h>
16#include <pdfsdk/math_types.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23typedef enum {
24 kPDAttachmentOpAdd,
25 kPDAttachmentOpRemove,
26 kPDAttachmentOpUpdate
27} PDAttachmentOperation;
28
29typedef PDErrCode(PDFSDK_CALLCONV* PDAttachmentEnumProc)(const wchar_t* name, PDFileSpec fileSpec, void* clientData);
30typedef void(PDFSDK_CALLCONV* PDAttachmentChangedProc)(const wchar_t* name, PDAttachmentOperation operation, void* clientData);
31
32typedef bool(PDFSDK_CALLCONV* PDFileSpecOnNumericCIProc)(PDAtom key, double value, const wchar_t* prefix, void* clientData);
33typedef bool(PDFSDK_CALLCONV* PDFileSpecOnStringCIProc)(PDAtom key, const wchar_t* value, const wchar_t* prefix, void* clientData);
34typedef bool(PDFSDK_CALLCONV* PDFileSpecOnDateCIProc)(PDAtom key, const PDDateTime* value, const wchar_t* prefix, void* clientData);
35
36PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocAttachAttachmentChangedCallback(PDDoc doc, PDAttachmentChangedProc proc, void* clientData);
37PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocDetachAttachmentChangedCallback(PDDoc doc, PDAttachmentChangedProc proc, void* clientData);
38PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocNotifyAttachmentChanged(PDDoc doc, const wchar_t* name, PDAttachmentOperation operation);
39
40PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetAttachment(PDDoc doc, const wchar_t* name, PDFileSpec* pFileSpec);
41PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocEnumAttachments(PDDoc doc, PDAttachmentEnumProc proc, void* clientData);
42PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocAddAttachment(PDDoc doc, const wchar_t* name, PDFileSpec fileSpec);
43PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocRemoveAttachment(PDDoc doc, const wchar_t* name);
44PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNumAttachments(PDDoc doc, size_t* pNumAttachments);
45PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocAttachmentNameByIndex(PDDoc doc, size_t index, wchar_t* buffer, size_t bufsize, size_t* pSize);
46PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocCreateEmbeddedFile(PDDoc doc, const wchar_t* path, PDFileSpec* pFileSpec);
47
48PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecCreate(PDDoc doc, PDAtom fileSys, const wchar_t* path, PDFileSpec* pFileSpec);
49PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecCreateFromPDObject(PDObject obj, PDFileSpec* pFileSpec);
50PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetPDObject(PDFileSpec fileSpec, PDObject* pObject);
51PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSetFileSystem(PDFileSpec fileSpec, PDAtom fileSys);
52PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetFileSystem(PDFileSpec fileSpec, PDAtom* pFileSys);
53PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSetPath(PDFileSpec fileSpec, const wchar_t* buffer, size_t bufSize);
54PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetPath(PDFileSpec fileSpec, wchar_t* buffer, size_t bufSize, size_t* pSize);
55PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSetDesc(PDFileSpec fileSpec, const wchar_t* buffer, size_t bufSize);
56PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetDesc(PDFileSpec fileSpec, wchar_t* buffer, size_t bufSize, size_t* pSize);
57PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetCreateDate(PDFileSpec fileSpec, PDDateTime* pDateTime);
58PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetModDate(PDFileSpec fileSpec, PDDateTime* pDateTime);
59PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetFileSize(PDFileSpec fileSpec, int64_t* pFileSize);
60PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetThumbnail(PDFileSpec fileSpec, PDDoc doc, PDEXObject* pThumb);
61PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSetThumbnail(PDFileSpec fileSpec, PDEXObject thumb);
62PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSaveToFile(PDFileSpec fileSpec, const wchar_t* path);
63
64PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetEncryptedPayload(PDDoc doc, const wchar_t* path, PDAtom filter, PDAtom version);
65
66PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetEncryptedPayload(PDDoc doc, PDFileSpec* pFileSpec);
67PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocRemoveEncryptedPayload(PDDoc doc);
68PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDEncryptedPayloadGetEncryptionProps(PDFileSpec fileSpec, PDAtom* filter, PDAtom* version);
69
70PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecRemoveCollectionItem(PDFileSpec fileSpec, PDAtom key);
71
72PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecEnumCollectionItem(PDFileSpec fileSpec,
73 const PDFileSpecOnNumericCIProc numProc,
74 const PDFileSpecOnStringCIProc stringProc,
75 const PDFileSpecOnDateCIProc dateProc,
76 void* clientData);
77
78PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetNumericCollectionItemValue(PDFileSpec fileSpec,
79 PDAtom key,
80 double* value,
81 wchar_t* prefix,
82 size_t bufferSize,
83 size_t* pSize);
84
85PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetDateCollectionItemValue(PDFileSpec fileSpec,
86 PDAtom key,
87 PDDateTime* value,
88 wchar_t* prefix,
89 size_t bufferSize,
90 size_t* pSize);
91
92PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecGetTextCollectionItemValue(PDFileSpec fileSpec,
93 PDAtom key,
94 wchar_t* value,
95 size_t valBufferSize,
96 size_t* vSize,
97 wchar_t* prefix,
98 size_t bufferSize,
99 size_t* pSize);
100
101PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSetNumericCollectionItemValue(PDFileSpec fileSpec,
102 PDAtom key,
103 double value,
104 const wchar_t* prefix);
105
106PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSetDateCollectionItemValue(PDFileSpec fileSpec,
107 PDAtom key,
108 const PDDateTime* value,
109 const wchar_t* prefix);
110
111PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDFileSpecSetTextCollectionItemValue(PDFileSpec fileSpec,
112 PDAtom key,
113 const wchar_t* value,
114 const wchar_t* prefix);
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif // PDFSDK_CORE_ATTACHMENTS_H_INCLUDED_
Atom API.
Content API.
Document API.
Error codes.
int32_t PDErrCode
Definition errors.h:44
Math types.
Progress Monitor API.
Definition types.h:23
Definition objects.h:80