AddMovieAnnotationFromFile

Annotations

Description

Adds a Movie annotation playing an embedded movie file with an activation action

Syntax

Delphi

Function AddMovieAnnotationFromFile(Left, Top, Width, Height: Double; Const MovieFileName, MimeType: WideString; Operation: Integer; Const Title, Contents: WideString): Integer;

Parameters

Left, TopPosition of the upper-left corner of the annotation rectangle in current output units, converted with the document scale and origin
Width, HeightPositive dimensions of the annotation rectangle in current output units
MovieFileNameMovie file to embed; the bytes are stored verbatim inside the PDF
MimeTypeMIME subtype recorded on the embedded stream, for example video/mp4; empty omits the entry
OperationActivation operation: 0 play, 1 stop, 2 pause, 3 resume
TitleAnnotation title, which the /Movie activation action uses to identify its target
ContentsAnnotation text contents reported by viewers

Return values

IndexThe 1-based annotation index, or 0 when the file cannot be read

Remarks

The movie embeds as an embedded-file stream referenced through a file specification, and the annotation carries an /S /Movie activation action identifying the target by annotation title (ISO 32000-1 12.6.4.9, Table 190)

The action parses back through the akMovie action reader, so annotation title and operation survive a save and reload cycle

Movie annotations date from PDF 1.2 with the action entry requiring PDF 1.3; new documents should prefer RichMedia annotations for modern multimedia

See also

AddSoundAnnotationFromFile, AddRichMediaAnnotationFromFile, GetAnnotActionInfo