Class PdfRichMediaAnnotation
Represents the rich media annotation.
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.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)
Initializes a new instance of the PdfRichMediaAnnotation class.
Declaration
public PdfRichMediaAnnotation(RectangleF bounds)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | bounds |
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)
Properties
ActivationMode
Gets or sets the rich media activation mode
Declaration
public PdfRichMediaActivationMode ActivationMode { get; set; }
Property Value
Type |
---|
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 |
---|
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 |
---|
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 |
---|
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