-
Notifications
You must be signed in to change notification settings - Fork 219
Links
Defining links in PDF ties a certain area in a document to a link. Pressing that area leads to the target of the link.
The PDFWriter class allows you to add link through calling the following method:
EStatusCode AttachURLLinktoCurrentPage(const wstring& inURL,const PDFRectangle& inLinkClickArea);
The AttachURLLinkToCurrentPage
method will attach a certain area in a page to the input URL. The page which the link will be created on is the next page that will be written (By calling either WritePage
or WritePageAndRelease
).
It accepts two parameters:
-
inURL
a string URL. -
inLinkClickArea
a rectangle defining the area where in a click would trigger accessing the URL. (on most system this would mean that a browser window is opened).
Note that PDF does not contain a native method for attaching links to text. Hence to place a link on a text you must posit the link on the area of the text.
The following is a simple usage example:
pdfWriter.AttachURLLinktoCurrentPage(L"http://www.soundcloud.com",PDFRectangle(90.024,200,367.524,375));
This call attached the URL www.soundcloud.com, to the area defined by the rectangle [90.024, 200, 367.524, 375].
For a complete code example see Links Test
- First Steps In Creating a PDF file
- Creating PDF Pages
- Images Support
- Text Support
- Adding Content to PDF Pages
- Links
- Unicode and UnicodeString class
- PDF Embedding
- Custom input and output
- Using Form XObjects
- Forward Referencing
- JPG Images Support
- TIFF Images Support
- PNG Images support