Table of Contents

Class PdfRichMediaAnnotation

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents the rich media annotation.

public class PdfRichMediaAnnotation : PdfAnnotation, INotifyPropertyChanged
Inheritance
PdfRichMediaAnnotation
Implements
Inherited Members

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.

public PdfRichMediaAnnotation(RectangleF bounds)

Parameters

bounds RectangleF

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

public PdfRichMediaActivationMode ActivationMode { get; set; }

Property Value

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.

public PdfAppearance Appearance { get; }

Property Value

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

public PdfRichMediaContent Content { get; set; }

Property Value

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.

public PdfRichMediaPresentationStyle PresentationStyle { get; set; }

Property Value

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()

Initializes annotation object.

protected override void Initialize()

Save()

Saves an annotation.

protected override void Save()