CreateGoToPageAction
IPDFDocument4 :: Actions

See Also Example
Collapse All

This method creates an action that moves the view in a PDF document.

Syntax

LONG CreateGoToPageAction (
LONG pageNumber,
FLOAT topOffset
)
Parameters
pageNumber
Number of an existing page

topOffset
Offset from the top of the page

Return value
Number of the action

Remarks

This method creates an action for moving the view to a new destination in a PDF document, specified by pageNumber and topOffset, the offset (in pixels) from the top of the page.

The return value is an action identifier in the document's actions collection and can be used in OnOpenDocument, AddControlToAction, OnControlMouseDown and other properties (see Annotations).

Example

CreateGotoPageAction Example

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
btn := PDF.AddButton(20, 90, 85, 104, 'Btn1');
PDF.AnnotUnicodeCaption := 'Goto page 2';
PDF.OnControlMouseUp := PDF.CreateGoToPageAction(1, 100);
PDF.NewPage;
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long btn = PDF->AddButton(20, 90, 85, 104, "Btn1");
PDF->AnnotUnicodeCaption = L"Goto page 2";
PDF->OnControlMouseUp = PDF->CreateGoToPageAction(1, 100);
PDF->NewPage();
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long btn = PDF.AddButton(20, 90, 85, 104, "Btn1");
PDF.AnnotUnicodeCaption = "Goto page 2";
PDF.OnControlMouseUp = PDF.CreateGoToPageAction(1, 100);
PDF.NewPage();
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
btn = PDF.AddButton(20, 90, 85, 104, "Btn1")
PDF.AnnotUnicodeCaption = "Goto page 2"
PDF.OnControlMouseUp = PDF.CreateGoToPageAction(1, 100)
PDF.NewPage
PDF.SaveToFile "test.pdf", true

See Also

Reference