PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() ![]() ![]() Collapse AllThis method creates an active hyperlink area in a PDF document.
|
| HRESULT PDFPAGE_SetURL ( DOUBLE left, DOUBLE top, DOUBLE right, DOUBLE bottom, BSTR url ) |
Parameters
left
X coordinate of the top-left corner of the bounding rectangle
top
Y coordinate of the top-left corner of the bounding rectangle
right
X coordinate of the bottom-right corner of the bounding rectangle
bottom
Y coordinate of the bottom-right corner of the bounding rectangle
url
String containing the URL
Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.
Remarks
This 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
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


