AddRichMediaAnnotationFromEmbeddedFile
Rich media, annotations, associated files, payload reuse
Description
Creates a RichMedia annotation whose asset and instance dictionaries reference an existing embedded-file specification instead of writing a duplicate media stream
Syntax
Delphi
Function TPDFlib.AddRichMediaAnnotationFromEmbeddedFile(Left, Top, Width, Height: Double; EmbeddedFileIndex: Integer; Const AssetName, Title, Description: WideString; MediaType: TPDFlibRichMediaType; Activation: TPDFlibRichMediaActivation; Deactivation: TPDFlibRichMediaDeactivation; PosterImageID: Integer= 0): Integer;ActiveX
Function PDFlib::AddRichMediaAnnotationFromEmbeddedFile(Left As Double, Top As Double, Width As Double, Height As Double, EmbeddedFileIndex As Long, AssetName As String, Title As String, Description As String, MediaType As Long, Activation As Long, Deactivation As Long, PosterImageID As Long) As LongDLL
int DLAddRichMediaAnnotationFromEmbeddedFile(int InstanceID, double Left, double Top, double Width, double Height, int EmbeddedFileIndex, const wchar_t* AssetName, const wchar_t* Title, const wchar_t* Description, int MediaType, int Activation, int Deactivation, int PosterImageID);
int DLAddRichMediaAnnotationFromEmbeddedFileA(int InstanceID, double Left, double Top, double Width, double Height, int EmbeddedFileIndex, const char* AssetName, const char* Title, const char* Description, int MediaType, int Activation, int Deactivation, int PosterImageID);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 |
| EmbeddedFileIndex | One-based embedded-file index that must resolve to an existing file specification, for example from GetAssociatedFileEmbeddedIndex |
| AssetName | Non-empty name of the asset inside the RichMedia annotation |
| Title | Presentation title; it may be empty |
| Description | Description of the media; it must be nonempty in PDF/UA mode |
| MediaType | rmtVideo 0, rmtSound 1, rmtFlash 2, or rmt3D 3 |
| Activation | rmaExplicit 0, rmaPageOpened 1, or rmaPageVisible 2 |
| Deactivation | rmdExplicit 0, rmdPageClosed 1, or rmdPageInvisible 2 |
| PosterImageID | Optional poster image ID; 0, the default, omits the poster, and any other value must identify an image in the selected document |
Return values
| 1 | The annotation was created against the existing embedded-file specification and the document was raised to Adobe Extension Level 3 |
|---|---|
| 0 | No document is loaded, AssetName is empty, a dimension is not positive, PDF/A mode is active, PDF/UA mode has no description, the embedded-file index or poster image is invalid, or Extension Level 3 is unavailable; LastErrorCode 602 reports the missing extension level |
Remarks
EmbeddedFileIndex is one-based and may come from GetAssociatedFileEmbeddedIndex
The method requires Adobe Extension Level 3, rejects PDF/A, and requires a nonempty description in PDF/UA mode
MediaType is 0 to 3, whilst activation and deactivation values are 0 to 2