API reference › Import & Output APIs
pdfCreateXFAStream
Add an XFA packet (e.g. template, datasets, config) to
| Exported names | pdfCreateXFAStreamA (UTF-8 name), pdfCreateXFAStreamW |
|---|
Purpose — Add an XFA packet (e.g. template, datasets, config) to the document.
C
int32_t __stdcall pdfCreateXFAStreamA(PPDF IPDF, const char* Name, void* Buffer, uint32_t BufSize);
int32_t __stdcall pdfCreateXFAStreamW(PPDF IPDF, const wchar_t* Name, void* Buffer, uint32_t BufSize);
Return value — The new packet's 0-based index (≥ 0); -1 on an invalid instance handle. A NULL/empty buffer creates an empty packet. The buffer is copied — the caller's memory may be freed immediately.
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
public static extern int pdfCreateXFAStreamA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string Name, IntPtr Buffer, uint BufSize);
public static extern int pdfCreateXFAStreamW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string Name, IntPtr Buffer, uint BufSize);
Area
Import & Output APIs
Category
Object Creation
Exported names
pdfCreateXFAStreamA
pdfCreateXFAStreamW
String variants
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
See working code
Worked examples — complete programs in ten languages.