Skip to content

feat: improve PDF links, pagination, margins, and scroll rendering - #69

Open
BugCreators wants to merge 7 commits into
lmn1919:mainfrom
BugCreators:main
Open

feat: improve PDF links, pagination, margins, and scroll rendering#69
BugCreators wants to merge 7 commits into
lmn1919:mainfrom
BugCreators:main

Conversation

@BugCreators

@BugCreators BugCreators commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 为 HTML <a> 元素生成可点击的 PDF 超链接注解,并支持加密 PDF。
    Add clickable PDF hyperlink annotations for HTML <a> elements, including encrypted PDF support.
  • 当图片可完整放入单页时,将跨页图片整体移动到下一页,避免图片被裁剪。
    Move fitting images intact to the next page instead of clipping them across pages.
  • CID 字体仅提供常规字重时,通过合成粗体保留文本加粗效果。
    Preserve bold styling by synthesizing bold text when only regular CID fonts are available.
  • 根据根元素的 CSS marginpadding 自动计算每页 PDF 边距。
    Derive PDF page margins from the root element's CSS margin and padding.
  • 导出滚动根元素的完整内容,不再只渲染当前可视区域。
    Export complete content from scrolled root elements instead of only the visible viewport.
  • 重新生成内联 WASM,并增加超链接及图片分页回归验证。
    Rebuild the embedded WASM binary and add regression coverage for hyperlinks and image pagination.

Testing

  • npm test
  • npm run build
  • Manual verification for affected example page(s)

Notes

  • 快照格式升级至版本 11,同时保持对版本 7 至 10 的兼容。
    The snapshot format is updated to version 11 while retaining compatibility with versions 7 through 10.
  • 已验证生成的 PDF 包含正确的超链接注解,并确认符合条件的图片会完整移动到下一页。
    Verified that generated PDFs contain valid hyperlink annotations and that fitting images move intact to the next page.

@lmn1919

lmn1919 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

麻烦您将

  1. 为 HTML 元素生成可点击的 PDF 超链接注解,并支持加密 PDF;
  2. CID 字体仅提供常规字重时,通过合成粗体保留文本加粗效果;
  3. 导出滚动根元素的完整内容,不再只渲染当前可视区域

这三个单独提PR,我先合这些代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants