Create a link annotation object for embedding URLs.
(gc, x, y, width, height, angle=0)
| 266 | |
| 267 | |
| 268 | def _get_link_annotation(gc, x, y, width, height, angle=0): |
| 269 | """ |
| 270 | Create a link annotation object for embedding URLs. |
| 271 | """ |
| 272 | quadpoints, rect = _get_coordinates_of_block(x, y, width, height, angle) |
| 273 | link_annotation = { |
| 274 | 'Type': Name('Annot'), |
| 275 | 'Subtype': Name('Link'), |
| 276 | 'Rect': rect, |
| 277 | 'Border': [0, 0, 0], |
| 278 | 'A': { |
| 279 | 'S': Name('URI'), |
| 280 | 'URI': gc.get_url(), |
| 281 | }, |
| 282 | } |
| 283 | if angle % 90: |
| 284 | # Add QuadPoints |
| 285 | link_annotation['QuadPoints'] = quadpoints |
| 286 | return link_annotation |
| 287 | |
| 288 | |
| 289 | # PDF strings are supposed to be able to include any eight-bit data, except |
no test coverage detected
searching dependent graphs…