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, Top | Position of the upper-left corner of the annotation rectangle in current output units, converted with the document scale and origin |
|---|---|
| Width, Height | Positive dimensions of the annotation rectangle in current output units |
| MovieFileName | Movie file to embed; the bytes are stored verbatim inside the PDF |
| MimeType | MIME subtype recorded on the embedded stream, for example video/mp4; empty omits the entry |
| Operation | Activation operation: 0 play, 1 stop, 2 pause, 3 resume |
| Title | Annotation title, which the /Movie activation action uses to identify its target |
| Contents | Annotation text contents reported by viewers |
Return values
| Index | The 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