API referencePDF/A & Conformance

pdfAddRichMediaAsset

Add an embedded asset (e.g. a 3D model, image, or other

C
BOOL32 __stdcall pdfAddRichMediaAssetA(PPDF IPDF, uint32_t Annot, const char* FileName, int32_t AType);
Delphi
function pdfAddRichMediaAssetA(const IPDF: PPDF; Annot: Cardinal; const FileName: PAnsiChar; AType: Integer): LongBool; stdcall;

Purpose. Add an embedded asset (e.g. a 3D model, image, or other resource) to an already-created /RichMedia annotation (3D Annotation Extras, DPart Structure, Article Threads, and Buttons's pdfCreate3DAnnot-adjacent family) — this is the incremental "add-another-asset" call, distinct from pdfRichMediaAnnot (V03), which creates the annotation with its *first* asset already attached.

Description. Reads the whole file into memory and calls AddRichMediaAssetH(Annot, ExtractFileName(fn), data) — the asset's name inside the RichMedia content is always derived from the file's own base name (not independently settable). AType is accepted by the ABI but this chapter did not find it consulted — the asset's declared MIME/subtype in the RichMedia content dictionary appears to be inferred elsewhere (e.g. from the file extension) rather than from this explicit parameter.

Parameters.

ParameterDescription
IPDFDocument handle.
AnnotTarget RichMedia annotation (must already exist).
FileNamePath to the asset file; its base name becomes the asset's internal name.
ATypeAccepted; not observed to be consulted.

Return value. True on success; False if the file doesn't exist.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
PDF/A & Conformance
Category

Content Creation

Exported names

pdfAddRichMediaAssetA pdfAddRichMediaAssetW

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.