Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ENH]: Better URL support for PDF backend #23152

Open
@oscargus

Description

@oscargus

Problem

The SVG backend supports URLs for all objects, which is quite easy as the URL is connected to the object in SVG (if I understand things correctly).

The PDF backend supports URLs for texts, but not for any other objects. One problem here is that the link seems to be connected to an area rather than an object.

It should be reasonably feasible to add support for images, markers, and bars.

Proposed solution

This is the code for adding an URL to a text object:

ifgc.get_url()isnotNone:
link_annotation= {
'Type':Name('Annot'),
'Subtype':Name('Link'),
'Rect': (x,y,x+width,y+height),
'Border': [0,0,0],
'A': {
'S':Name('URI'),
'URI':gc.get_url(),
},
}
self.file._annotations[-1][1].append(link_annotation)

Basically, if one knows the coordinates, it should just be to copy this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp