CreateGoToPageAction
IPDFDocument3 :: Actions

See Also Example
Collapse All

Creates an action that moves the view to a new destination in a PDF document.

Syntax

LONG CreateGoToPageAction (
LONG pageIndex,
LONG topOffset
)
Parameters
pageIndex
Index of an existing page

topOffset
Offset from the top of the page

Return value
Index of the created action.

Remarks

CreateGoToPageAction creates an action for moving the view to a new destination in a PDF document. The destination page is specified by pageIndex. The vertical location is specified by topOffset, which is measured in pixels from the top of pageIndex.

The return value is an action identifier in the document's actions collection and can be used in AddControlToAction, OpenDocumentAction, PDFANNOTATION_OnBeforeFormatting, PDFANNOTATION_OnChange, PDFANNOTATION_OnKeyPress, PDFANNOTATION_OnSetFocus, PDFANNOTATION_OnLostFocus, PDFANNOTATION_OnMouseDown, PDFANNOTATION_OnMouseUp, PDFANNOTATION_OnMouseEnter, PDFANNOTATION_OnMouseExit, PDFANNOTATION_OnOtherControlChanged, PDFPAGE_SetAction, PDFANNOTATION_Action, PDFOUTLINENODE_Action.

Equivalent in new interface: IPDFDocument4::CreateGoToPageAction.

Example

How to Create an Action (Associated with a Button) that Moves the View to Page 2, near the Center of the Page

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.PDFPAGE_CreateControl_Button ('Btn1', 20, 90, 65, 105);
PDF.PDFANNOTATION_Caption := 'Alert demo';
PDF.PDFANNOTATION_OnMouseUp := PDF.CreateGoToPageAction(0, 400);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->PDFPAGE_CreateControl_Button("Btn1", 20, 90, 65, 105);
PDF->PDFANNOTATION_Caption = "Alert demo";
PDF->PDFANNOTATION_OnMouseUp = PDF->CreateGoToPageAction(0, 400);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.PDFPAGE_CreateControl_Button("Btn1", 20, 90, 65, 105);
PDF.PDFANNOTATION_Caption = "Alert demo";
PDF.PDFANNOTATION_OnMouseUp = CreateGoToPageAction(0, 400);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.PDFPAGE_CreateControl_Button "Btn1", 20, 90, 65, 105
PDF.PDFANNOTATION_Caption = "Alert demo"
PDF.PDFANNOTATION_OnMouseUp = PDF.CreateGoToPageAction(0, 400)

See Also

Reference