API referencePDF/A & Conformance

pdfAttachFileEx

Fully documented elsewhere — cross-referenced here only to satisfy this volume's own completeness (see [Bookmarks, Articles, Page Labels, and Structure-Tree Binding](E01_BookmarksArticlesPageLabelsAndStructureBinding.md)'s scope note: these three happen to share the pdfA-prefix naming accident with this volume's real content, but their authoritative homes are in V17):

Fully documented elsewhere — cross-referenced here only to satisfy this volume's own completeness (see Bookmarks, Articles, Page Labels, and Structure-Tree Binding's scope note: these three happen to share the pdfA-prefix naming accident with this volume's real content, but their authoritative homes are in V17):

  • pdfAppend — append a new blank page to the document (locks the document mutex around the append for thread safety). See V17 Import & Output, E01_DocumentLifecycle.
  • pdfAttachFile / pdfAttachFileEx — attach a file (from a path, or from an in-memory buffer respectively) to the document's embedded-file name tree, with an optional description and compression flag. See V17 Import & Output, E03_EmbeddedFiles.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfAttachFileExA(IntPtr IPDF, IntPtr Buffer, uint BufSize, [MarshalAs(UnmanagedType.LPStr)] string FileName, [MarshalAs(UnmanagedType.LPStr)] string Description, [MarshalAs(UnmanagedType.Bool)] bool Compress);
public static extern int pdfAttachFileExW(IntPtr IPDF, IntPtr Buffer, uint BufSize, [MarshalAs(UnmanagedType.LPWStr)] string FileName, [MarshalAs(UnmanagedType.LPWStr)] string Description, [MarshalAs(UnmanagedType.Bool)] bool Compress);
Area
PDF/A & Conformance
Category

Core

Exported names

pdfAttachFileExA pdfAttachFileExW

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.