File Formats

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

    Show / Hide Table of Contents

    Class PdfDestination

    Inheritance
    System.Object
    PdfDestination
    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 PdfDestination : IPdfWrapper

    Constructors

    PdfDestination(PdfPageBase)

    Initializes a new instance of the PdfDestination class with specified page.

    Declaration
    public PdfDestination(PdfPageBase page)
    Parameters
    Type Name Description
    PdfPageBase page

    The page where the destination should be placed.

    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Create the destination
    PdfDestination destination = new PdfDestination(page);
    //Set the destination page.
    bookmark.Destination = destination;
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Create the destination
    Dim destination As PdfDestination = New PdfDestination(page)
    'Set the destination page.
    bookmark.Destination = destination
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)
    See Also
    PdfPage
    PdfBookmark

    PdfDestination(PdfPageBase, PointF)

    Initializes a new instance of the PdfDestination class with specified page base and location.

    Declaration
    public PdfDestination(PdfPageBase page, PointF location)
    Parameters
    Type Name Description
    PdfPageBase page

    The page where the destination should be placed.

    System.Drawing.PointF location

    The location of the page.

    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Create the destination.
    PdfDestination destination = new PdfDestination(page,new PointF(0, 100));
    //Set the destination page.
    bookmark.Destination = destination;
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Create the destination
    Dim destination As PdfDestination = New PdfDestination(page,new PointF(0, 100))
    'Set the destination page.
    bookmark.Destination = destination
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)
    See Also
    PdfPage
    PdfBookmark

    Properties

    IsValid

    Gets a value indicating whether this instance is valid.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is valid; otherwise, false.

    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Create the destination
    PdfDestination destination = new PdfDestination(page);
    //Gets a value indicating whether this instance is valid.
    bool isValid = destination.IsValid;
    //Set the destination page.
    bookmark.Destination = destination;
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Create the destination
    Dim destination As PdfDestination = New PdfDestination(page)
    'Gets a value indicating whether this instance is valid.
    bool isValid = destination.IsValid
    'Set the destination page.
    bookmark.Destination = destination
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)
    See Also
    PdfPage
    PdfBookmark

    Location

    Gets or sets a location of the destination.

    Declaration
    public PointF Location { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF
    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Create the destination
    PdfDestination destination = new PdfDestination(page);
    //Set the location of the destination.
    destination.Location = new PointF(20, 20);
    //Set the destination page.
    bookmark.Destination = destination;
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Create the destination
    Dim destination As PdfDestination = New PdfDestination(page)
    'Set the location of the destinatioin.
    destination.Location = new PointF(20, 20)
    'Set the destination page.
    bookmark.Destination = destination
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)
    See Also
    PdfPage
    PdfBookmark

    Mode

    Gets or sets mode of the destination.

    Declaration
    public PdfDestinationMode Mode { get; set; }
    Property Value
    Type Description
    PdfDestinationMode
    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Create the destination.
    PdfDestination destination = new PdfDestination(page,new PointF(0, 100));
    //Set the destination mode.
    destination.Mode = PdfDestinationMode.FitToPage;
    //Set the destination page.
    bookmark.Destination = destination;
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Create the destination.
    Dim destination As PdfDestination = New PdfDestination(page,new PointF(0, 100))
    'Set the destination mode.
    destination.Mode = PdfDestinationMode.FitToPage
    'Set the destination page.
    bookmark.Destination = destination
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)
    See Also
    PdfPage
    PdfBookmark

    Page

    Gets or sets a page where the destination is situated.

    Declaration
    public PdfPageBase Page { get; set; }
    Property Value
    Type Description
    PdfPageBase

    PageIndex

    Declaration
    public int PageIndex { get; }
    Property Value
    Type Description
    System.Int32

    Zoom

    Gets or sets zoom factor.

    Declaration
    public float Zoom { get; set; }
    Property Value
    Type Description
    System.Single
    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Create the destination.
    PdfDestination destination = new PdfDestination(page,new PointF(0, 100));
    //Set the zoom factor.
    destination.Zoom = 100;
    //Set the destination page.
    bookmark.Destination = destination;
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Create the destination
    Dim destination As PdfDestination = New PdfDestination(page,new PointF(0, 100))
    'Set the zoom factor.
    destination.Zoom = 100
    'Set the destination page.
    bookmark.Destination = destination
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)
    See Also
    PdfPage
    PdfBookmark
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved