Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfRichMediaAnnotation

    Show / Hide Table of Contents

    Class PdfRichMediaAnnotation

    Represents the rich media annotation.

    Inheritance
    System.Object
    PdfAnnotation
    PdfRichMediaAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfAnnotation.SetAppearance(Boolean)
    PdfAnnotation.CalculateBounds(RectangleF, PdfPage, PdfLoadedPage)
    PdfAnnotation.SetValues(String, String)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean, PdfGraphics)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean)
    PdfAnnotation.CheckFlatten()
    PdfAnnotation.Color
    PdfAnnotation.Opacity
    PdfAnnotation.InnerColor
    PdfAnnotation.Border
    PdfAnnotation.Bounds
    PdfAnnotation.Location
    PdfAnnotation.Size
    PdfAnnotation.Page
    PdfAnnotation.Text
    PdfAnnotation.Author
    PdfAnnotation.Subject
    PdfAnnotation.ModifiedDate
    PdfAnnotation.AnnotationFlags
    PdfAnnotation.Flatten
    PdfAnnotation.FlattenPopUps
    PdfAnnotation.PdfTag
    PdfAnnotation.Layer
    PdfAnnotation.Rotate
    PdfAnnotation.Name
    PdfAnnotation.PropertyChanged
    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)

    Declaration
    public PdfRichMediaAnnotation(RectangleF bounds)
    Parameters
    Type Name Description
    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
    PdfAnnotation.Initialize()

    Save()

    Declaration
    protected override void Save()
    Overrides
    PdfAnnotation.Save()

    Implements

    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved