API reference › Import & Output APIs
pdfSetEmbeddedFileStrProperty
Change a string property of an existing attachment.
| Exported names | pdfSetEmbeddedFileStrProperty (bare = ANSI), pdfSetEmbeddedFileStrPropertyA, pdfSetEmbeddedFileStrPropertyW |
|---|
Purpose — Change a string property of an existing attachment.
Description — Index is the 1-based attachment handle. Tag selects the property:
| Tag | Property written at serialization |
|---|---|
0 | /Desc (description) |
1 | /AFRelationship (name — e.g. Data, Source, Alternative; setting it makes the file an associated file) |
2 | /F and /UF (file name) |
Any other tag fails. The W variant is narrowed to 8-bit storage.
int32_t __stdcall pdfSetEmbeddedFileStrPropertyA(PPDF IPDF, int32_t Index, int32_t Tag, const char* NewValue);
int32_t __stdcall pdfSetEmbeddedFileStrPropertyW(PPDF IPDF, int32_t Index, int32_t Tag, const wchar_t* NewValue);
Return value — 1 on success, 0 on failure (invalid instance handle, index out of range, unknown tag). Integer, not BOOL32.
C# (P/Invoke)
public static extern int pdfSetEmbeddedFileStrPropertyW(IntPtr IPDF, int Index, int Tag, IntPtr NewValue);
public static extern int pdfSetEmbeddedFileStrProperty(IntPtr IPDF, int Index, int Tag, IntPtr NewValue);
public static extern int pdfSetEmbeddedFileStrPropertyA(IntPtr IPDF, int Index, int Tag, IntPtr NewValue);
Setters
pdfSetEmbeddedFileStrPropertyW
pdfSetEmbeddedFileStrProperty
pdfSetEmbeddedFileStrPropertyA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.