PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllCreates a hyper link active area in a PDF document.
|
| HRESULT PDFPAGE_SetURL ( DOUBLE left, DOUBLE top, DOUBLE right, DOUBLE bottom, BSTR url ) |
Parameters
left
X coordinate of the left-top corner of the bounding rectangle.
top
Y coordinate of the left-top corner of the bounding rectangle.
right
X coordinate of the right-bottom corner of the bounding rectangle.
bottom
Y coordinate of the right-bottom corner of the bounding rectangle.
url
URL string.
Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.
Remarks
This procedure places an active hyper-link 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 World Wide Web address specification such as "http://www.colorpilot.com/" or "mailto:support@colorpilot.com".
Analogue in new interface: IPDFDocument4::AddHyperLink.
Example
Creating a link
Delphi
[copy to clipboard]
{ 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;
C/C++
[copy to clipboard]
// 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();
C#
[copy to clipboard]
// 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();
Visual Basic
[copy to clipboard]
' 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


