@embedpdf/plugin-link (英语)
EmbedPDF的链接:使一个PDF的网页链接和网站可以点击.
此插件与每个 EmbedPDF 框架包相伴而来 。 从您使用的那个导入 :
| 框架 | 从 | 文档 |
|---|---|---|
| 反应 | @embedpdf/react/link | 链接 |
| 阴道 | @embedpdf/vue/link | 链接 |
| 丝绒 | @embedpdf/svelte/link | 链接 |
| 角质 | @embedpdf/angular/link | 链接 |
在反应中
大多数PDF都有链接:一个跳到一章的目录,一个网站的脚注. 登记册
linkPlugin() 设置 <LinkLayer> 在每一页,它们的工作:
link-layer.tsx
import { interactionPlugin } from '@embedpdf/react/interaction';
import { LinkLayer, linkPlugin } from '@embedpdf/react/link';
import { RenderLayer, renderPlugin } from '@embedpdf/react/render';
import { Viewer } from '@embedpdf/react/runtime';
import { Stage, stagePlugin } from '@embedpdf/react/stage';
import { engine } from './pdf';
const plugins = [stagePlugin(), renderPlugin(), interactionPlugin(), linkPlugin()];
export function Reader() {
return (
<Viewer engine={engine} plugins={plugins}>
<Stage>
{() => (
<>
<RenderLayer />
<LinkLayer />
</>
)}
</Stage>
</Viewer>
);
}
指针会变成一个手递的链接, 用 Tab 键可以到达链接并跟踪 输入.
许可证
阿帕奇 - 2.0