



Collapse All
Syntax| HRESULT PDFPAGE_SetURL ( DOUBLE left, DOUBLE top, DOUBLE right, DOUBLE bottom, BSTR url ) |
RemarksThis method places an active hyperlink area for the rectangle bounded by coordinates (left, top, right, bottom). The URL (Uniform Resource Locator) parameter should be a string specifying a standard URL used in the World Wide Web address specification, such as "http://www.colorpilot.com/" or "mailto:support@colorpilot.com".
Equivalent in new interface: IPDFDocument4::AddHyperLink.
Example{ PDF object is supposed to be created }
PDF.BeginDoc;
PDF.PDFPAGE_SetActiveFont('Verdana', false, false, true, false, 12.0, 0);
txt := 'http://www.google.com'
w := PDF.PDFPAGE_GetTextWidth(txt);
h := PDF.PDFPAGE_GetTextHeight(txt);
PDF.PDFPAGE_TextOut(100, 100, 0.0, txt);
PDF.PDFPAGE_SetURL(100, 100, 100 + w, 100 + h, txt);
PDF.EndDoc;
// PDF object is supposed to be created
PDF->BeginDoc();
PDF->PDFPAGE_SetActiveFont("Verdana", FALSE, FALSE, TRUE, FALSE, 12.0, 0)
CString txt = "http://www.google.com";
DOUBLE w = PDF->PDFPAGE_GetTextWidth(txt);
DOUBLE h = PDF->PDFPAGE_GetTextHeight(txt);
PDF->PDFPAGE_TextOut(100, 100, 0.0, txt);
PDF->PDFPAGE_SetURL(100, 100, 100 + w, 100 + h, txt);
PDF->EndDoc();
// PDF object is supposed to be created
PDF.BeginDoc();
PDF.PDFPAGE_SetActiveFont("Verdana", false, false, true, false, 12.0, 0)
string txt = "http://www.google.com";
double w = PDF.PDFPAGE_GetTextWidth(txt);
double h = PDF.PDFPAGE_GetTextHeight(txt);
PDF.PDFPAGE_TextOut(100, 100, 0.0, txt);
PDF.PDFPAGE_SetURL(100, 100, 100 + w, 100 + h, txt);
PDF.EndDoc();
' PDF object is supposed to be created PDF.BeginDoc PDF.PDFPAGE_SetActiveFont "Verdana", False, False, True, False, 12.0, 0 txt = "http://www.google.com" w = PDF.PDFPAGE_GetTextWidth(txt) h = PDF.PDFPAGE_GetTextHeight(txt) PDF.PDFPAGE_TextOut 100, 100, 0.0, txt PDF.PDFPAGE_SetURL 100, 100, 100 + w, 100 + h, txt PDF.EndDoc
See Also