Class PdfRichMediaAnnotation
Represents the rich media annotation.
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfRichMediaAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create the new rich media annotation
PdfRichMediaAnnotation richMediaAnnotation = new PdfRichMediaAnnotation(rect);
//Create the rich media content
PdfRichMediaContent content = new PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video);
richMediaAnnotation.Content = content;
//Set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click;
//Set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed;
//Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation);
//Save the document to disk.
document.Save("RichMediaAnnotation.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new rich media annotation.
Dim richMediaAnnotation As New PdfRichMediaAnnotation(rectangle)
'Create a rich media annotation content
Dim content As New PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video)
richMediaAnnotation.Content = content
'Set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click
'set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed
'Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation)
'Save the document to disk.
document.Save("RichMediaAnnotation.pdf")
'close the document
document.Close(True)
Constructors
PdfRichMediaAnnotation(RectangleF)
Declaration
public PdfRichMediaAnnotation(RectangleF bounds)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | bounds |
Properties
ActivationMode
Gets or sets the rich media activation mode
Declaration
public PdfRichMediaActivationMode ActivationMode { get; set; }
Property Value
Type | Description |
---|---|
PdfRichMediaActivationMode |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//create the new rich media annotation
PdfRichMediaAnnotation richMediaAnnotation = new PdfRichMediaAnnotation(rect);
//create the rich media content
PdfRichMediaContent content = new PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video);
richMediaAnnotation.Content = content;
//set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click;
//set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed;
//Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation);
//Save the document to disk.
document.Save("RichMediaAnnotation.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new rich media annotation.
Dim richMediaAnnotation As New PdfRichMediaAnnotation(rectangle)
'Create a rich media annotation content
Dim content As New PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video)
richMediaAnnotation.Content = content
'set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click
'set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed
'Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation)
'Save the document to disk.
document.Save("RichMediaAnnotation.pdf")
'close the document
document.Close(True)
Appearance
Get the annotation appearance.
Declaration
public PdfAppearance Appearance { get; }
Property Value
Type | Description |
---|---|
PdfAppearance |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create the new rich media annotation
PdfRichMediaAnnotation richMediaAnnotation = new PdfRichMediaAnnotation(rect);
//Create the rich media content
PdfRichMediaContent content = new PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video);
richMediaAnnotation.Content = content;
//Draw rectangle of the appearance.
richMediaAnnotation.Appearance.Normal.Graphics.DrawRectangle(PdfPens.Red, annot.Bounds);
//Set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click;
//Set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed;
//Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation);
//Save the document to disk.
document.Save("RichMediaAnnotation.pdf");
//close the document
document.Close(true);
Content
Gets or sets the rich media content
Declaration
public PdfRichMediaContent Content { get; set; }
Property Value
Type | Description |
---|---|
PdfRichMediaContent |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//create the new rich media annotation
PdfRichMediaAnnotation richMediaAnnotation = new PdfRichMediaAnnotation(rect);
//create the rich media content
PdfRichMediaContent content = new PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video);
richMediaAnnotation.Content = content;
//set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click;
//set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed;
//Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation);
//Save the document to disk.
document.Save("RichMediaAnnotation.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new rich media annotation.
Dim richMediaAnnotation As New PdfRichMediaAnnotation(rectangle)
'Create a rich media annotation content
Dim content As New PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video)
richMediaAnnotation.Content = content
'set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click;
'set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed
'Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation)
'Save the document to disk.
document.Save("RichMediaAnnotation.pdf")
'close the document
document.Close(True)
PresentationStyle
Gets or sets the presentation style.
Declaration
public PdfRichMediaPresentationStyle PresentationStyle { get; set; }
Property Value
Type | Description |
---|---|
PdfRichMediaPresentationStyle |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//create the new rich media annotation
PdfRichMediaAnnotation richMediaAnnotation = new PdfRichMediaAnnotation(rect);
//create the rich media content
PdfRichMediaContent content = new PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video);
richMediaAnnotation.Content = content;
//set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click;
//set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed;
//Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation);
//Save the document to disk.
document.Save("RichMediaAnnotation.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new rich media annotation.
Dim richMediaAnnotation As New PdfRichMediaAnnotation(rectangle)
'Create a rich media annotation content
Dim content As New PdfRichMediaContent("Video.mp4", PdfRichMediaContentType.Video)
richMediaAnnotation.Content = content
'set the rich media activation mode
richMediaAnnotation.ActivationMode = PdfRichMediaActivationMode.Click
'set the rich media presentation
richMediaAnnotation.PresentationStyle = PdfRichMediaPresentationStyle.Windowed
'Add this annotation to a new page.
page.Annotations.Add(richMediaAnnotation)
'Save the document to disk.
document.Save("RichMediaAnnotation.pdf")
'close the document
document.Close(True)
Methods
Initialize()
Declaration
protected override void Initialize()
Overrides
Save()
Declaration
protected override void Save()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged