创建超链接并在 Python 中给它起一个吸引人的名字
Create hyperlink and give it an appealing name in Python
我正在尝试重命名我的 hyperlink 以放入 pdf 文件中。因此,我不想给用户一个巨大的 long link。
假设我的 link 是这样的:
我希望它在 pdf 中显示为:
"Link 到图片"
My code:
texto_body=f"Hi,<br> <br> This is a test with a link {link} <br> <br> Thanks,"
body=f"""\
<html>
<body>
<p style="color:black;"> {texto_body}</p>
<img src="cid:image1" alt="Logo" style="width:90px;height:90px;"><br>
</body>
</html>
"""
已解决。我发现 <a href="where/you/want/the/link/to/go">text of the link</a>
是建立具有给定名称的超链接的方法
我正在尝试重命名我的 hyperlink 以放入 pdf 文件中。因此,我不想给用户一个巨大的 long link。 假设我的 link 是这样的:
我希望它在 pdf 中显示为: "Link 到图片"
My code:
texto_body=f"Hi,<br> <br> This is a test with a link {link} <br> <br> Thanks,"
body=f"""\
<html>
<body>
<p style="color:black;"> {texto_body}</p>
<img src="cid:image1" alt="Logo" style="width:90px;height:90px;"><br>
</body>
</html>
"""
已解决。我发现 <a href="where/you/want/the/link/to/go">text of the link</a>
是建立具有给定名称的超链接的方法