Class PdfGoToAction
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents an action which goes to a destination in the current document.
public class PdfGoToAction : PdfAction
- Inheritance
-
PdfGoToAction
- Inherited Members
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Font = font;
submitButton.Text = "Goto";
submitButton.BackColor = new PdfColor(181, 191, 203);
//Create a new page and adds it as the last page of the document
PdfPage pdfPages = document.Pages.Add();
//Create a new PdfGoToAction
PdfGoToAction gotoAction = new PdfGoToAction(pdfPages);
//Add the gotoAction
submitButton.Actions.GotFocus = gotoAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("GoToAction.pdf");
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 font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F, PdfFontStyle.Bold)
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Font = font
submitButton.Text = "Goto"
submitButton.BackColor = New PdfColor(181, 191, 203)
'Create a new page and adds it as the last page of the document
Dim pdfPages As PdfPage = document.Pages.Add()
'Create a new PdfGoToAction
Dim gotoAction As New PdfGoToAction(pdfPages)
'Add the gotoAction
submitButton.Actions.GotFocus = gotoAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("GoToAction.pdf")
document.Close(True)
Remarks
This PdfGoToAction class is used to display the specified page in the current document. Please refer the UG docuemntation link
Constructors
PdfGoToAction(PdfDestination)
Initializes a new instance of the PdfGoToAction class with specified destination page.
public PdfGoToAction(PdfDestination destination)
Parameters
destination
PdfDestinationThe destination to jump to.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Font = font;
submitButton.Text = "Goto";
submitButton.BackColor = new PdfColor(181, 191, 203);
//Create a new page and adds it as the last page of the document
PdfPage pdfPages = document.Pages.Add();
//Create a new PdfDestination
PdfDestination destination = new PdfDestination(pdfPages);
//Set the PdfDestinationMode
destination.Mode = PdfDestinationMode.FitToPage;
//Create a new PdfGoToAction
PdfGoToAction gotoAction = new PdfGoToAction(destination);
//Add the gotoAction
submitButton.Actions.GotFocus = gotoAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("GoToAction.pdf");
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 font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F, PdfFontStyle.Bold)
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Font = font
submitButton.Text = "Goto"
submitButton.BackColor = New PdfColor(181, 191, 203)
'Create a new page and adds it as the last page of the document
Dim pdfPages As PdfPage = document.Pages.Add()
'Create a new PdfDestination
Dim destination As New PdfDestination(pdfPages)
'Set the PdfDestinationMode
destination.Mode = PdfDestinationMode.FitToPage
'Create a new PdfGoToAction
Dim gotoAction As New PdfGoToAction(destination)
'Add the gotoAction
submitButton.Actions.GotFocus = gotoAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("GoToAction.pdf")
document.Close(True)
- See Also
PdfGoToAction(PdfPage)
Initializes a new instance of the PdfGoToAction class with specified page.
public PdfGoToAction(PdfPage page)
Parameters
page
PdfPageThe page to navigate.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Font = font;
submitButton.Text = "Goto";
submitButton.BackColor = new PdfColor(181, 191, 203);
//Create a new page and adds it as the last page of the document
PdfPage pdfPages = document.Pages.Add();
//Create a new PdfGoToAction
PdfGoToAction gotoAction = new PdfGoToAction(pdfPages);
//Add the gotoAction
submitButton.Actions.GotFocus = gotoAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("GoToAction.pdf");
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 font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F, PdfFontStyle.Bold)
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Font = font
submitButton.Text = "Goto"
submitButton.BackColor = New PdfColor(181, 191, 203)
'Create a new page and adds it as the last page of the document
Dim pdfPages As PdfPage = document.Pages.Add()
'Create a new PdfGoToAction
Dim gotoAction As New PdfGoToAction(pdfPages)
'Add the gotoAction
submitButton.Actions.GotFocus = gotoAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("GoToAction.pdf")
document.Close(True)
- See Also
Properties
Destination
Gets or sets the destination to be navigated.
public PdfDestination Destination { get; set; }
Property Value
- PdfDestination
The PdfDestination to navigate.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Font = font;
submitButton.Text = "Goto";
submitButton.BackColor = new PdfColor(181, 191, 203);
//Create a new page and adds it as the last page of the document
PdfPage pdfPages = document.Pages.Add();
//Create a new PdfDestination
PdfDestination destination = new PdfDestination(pdfPages);
//Set the PdfDestinationMode
destination.Mode = PdfDestinationMode.FitToPage;
//Create a new PdfGoToAction
PdfGoToAction gotoAction = new PdfGoToAction(pdfPages);
//Set the destination
gotoAction.Destination = destination;
//Add the gotoAction
submitButton.Actions.GotFocus = gotoAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("GoToAction.pdf");
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 font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F, PdfFontStyle.Bold)
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Font = font
submitButton.Text = "Goto"
submitButton.BackColor = New PdfColor(181, 191, 203)
'Create a new page and adds it as the last page of the document
Dim pdfPages As PdfPage = document.Pages.Add()
'Create a new PdfDestination
Dim destination As New PdfDestination(pdfPages)
'Set the PdfDestinationMode
destination.Mode = PdfDestinationMode.FitToPage
'Create a new PdfGoToAction
Dim gotoAction As New PdfGoToAction(pdfPages)
'Set the destination
gotoAction.Destination = destination
'Add the gotoAction
submitButton.Actions.GotFocus = gotoAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("GoToAction.pdf")
document.Close(True)
- See Also
Methods
Initialize()
Initializes instance.
protected override void Initialize()
- See Also