Link
Wraps any layout content in a clickable hyperlink. The link is active in PDF viewers that support annotations.
Attributes
Section titled “Attributes”| Attribute | Type | Default | Description |
|---|---|---|---|
href |
URL | — | Required. Link destination |
gap |
spacing | — | Gap between child elements |
Text link
Section titled “Text link”<link href="https://lpdf.io"> <text color="#1a73e8" font-size="m">Visit lpdf.io</text></link>L.link({ href: 'https://lpdf.io' }, [ L.text({ color: '#1a73e8', fontSize: 'm' }, ['Visit lpdf.io']),])L.link(LinkAttr(href='https://lpdf.io'), [ L.text(TextAttr(color='#1a73e8', font_size='m'), ['Visit lpdf.io'])])L::link(new LinkAttr(href: 'https://lpdf.io'), [ L::text(new TextAttr(color: '#1a73e8', fontSize: 'm'), ['Visit lpdf.io']),])L.Link(new() { Href = "https://lpdf.io" }, [ L.Text(new() { Color = "#1a73e8", FontSize = "m" }, ["Visit lpdf.io"]),])Image link
Section titled “Image link”<link href="https://lpdf.io"> <img name="logo" width="80pt"/></link>L.link({ href: 'https://lpdf.io' }, [ L.img({ name: 'logo', width: '80pt' }),])L.link(LinkAttr(href='https://lpdf.io'), [ L.img(ImgAttr(name='logo', width='80pt'))])L::link(new LinkAttr(href: 'https://lpdf.io'), [ L::img(new ImgAttr(name: 'logo', width: '80pt')),])L.Link(new() { Href = "https://lpdf.io" }, [ L.Img(new() { Name = "logo", Width = "80pt" }),])The destination is fixed in the XML: data-value does not change href. Text inside the link can still be bound.
<link href="https://example.com"> <text data-value="product.name" color="#1a73e8">Product</text></link>