



Collapse All
Syntax| HRESULT PDFPAGE_SetLinkToPage ( DOUBLE left, DOUBLE bottom, DOUBLE right, DOUBLE top, LONG pageIndex, LONG topOffset ) |
RemarksThis method places an active hyperlink area for the rectangle with left-top corner at (left, top) and right-bottom corner at (right, bottom). The destination is a page in the current PDF document with the pageIndex index. The topOffset parameter depends on the location of the display window for that page, offset from top of the page.
Equivalent in new interface: IPDFDocument4::AddLinkToPage.
Example{ PDF object is supposed to be created }
PDF.BeginDoc;
txt := 'Link to page''s bottom.';
for i := 1 to 3 do
begin
PDF.PDFPAGE_SetActiveFont('Helvetica', false, false, false, false, 12.0, 0);
r := 100 + PDF.PDFPAGE_GetTextWidth(txt);
b := 100 + PDF.PDFPAGE_GetTextHeight(txt);
PDF.PDFPAGE_TextOut(100, 100, 0.0, txt);
PDF.PDFPAGE_Rectangle(100, 100, r, b);
PDF.PDFPAGE_Stroke;
PDF.PDFPAGE_SetLinkToPage(100, b, r, 100, PDF.PageNumber, 20);
if i < 2 then do
PDF.NewPage;
end;
PDF.EndDoc;
// PDF object is supposed to be created
PDF->BeginDoc();
string txt = "Link to page's bottom.";
for (int i = 0; i < 3; i++)
{
PDF->PDFPAGE_SetActiveFont("Helvetica", FALSE, FALSE, FALSE, FALSE, 12.0, 0);
DOUBLE r = 100 + PDF->PDFPAGE_GetTextWidth(txt);
DOUBLE b = 100 + PDF->PDFPAGE_GetTextHeight(txt);
PDF->PDFPAGE_TextOut(100, 100, 0.0, txt);
PDF->PDFPAGE_Rectangle(100, 100, r, b);
PDF->PDFPAGE_Stroke();
PDF->PDFPAGE_SetLinkToPage(100, b, r, 100, PDF.PageNumber, 20);
if (i < 2)
PDF->NewPage();
}
PDF->EndDoc();
// PDF object is supposed to be created
PDF.BeginDoc();
string txt = "Link to page's bottom.";
for (int i = 0; i < 3; i++)
{
PDF.PDFPAGE_SetActiveFont("Helvetica", false, false, false, false, 12.0, 0);
double r = 100 + PDF.PDFPAGE_GetTextWidth(txt);
double b = 100 + PDF.PDFPAGE_GetTextHeight(txt);
PDF.PDFPAGE_TextOut(100, 100, 0.0, txt);
PDF.PDFPAGE_Rectangle(100, 100, r, b);
PDF.PDFPAGE_Stroke();
PDF.PDFPAGE_SetLinkToPage(100, b, r, 100, PDF.PageNumber, 20);
if (i < 2)
PDF.NewPage();
}
PDF.EndDoc();
' PDF object is supposed to be created
PDF.BeginDoc
txt = "Link to page's bottom."
For i=1 To 3
PDF.PDFPAGE_SetActiveFont "Helvetica", False, False, False, False, 12.0, 0
r = 100 + PDF.PDFPAGE_GetTextWidth(txt)
b = 100 + PDF.PDFPAGE_GetTextHeight(txt)
PDF.PDFPAGE_TextOut 100, 100, 0.0, txt
PDF.PDFPAGE_Rectangle 100, 100, r, b
PDF.PDFPAGE_Stroke
PDF.PDFPAGE_SetLinkToPage 100, b, r, 100, PDF.PageNumber, 20
If i<3 Then PDF.NewPage
Next
PDF.EndDoc
See Also