Feat/long page export#346
Open
Furinar wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
作者您好,在面试求职过程中我发现一些问题
综合以上多种原因,我提交了本次pr希望能解决类似问题
Summary
Principle
核心思路是将预览区 DOM 克隆到一个离屏容器中,解除高度约束后渲染为完整长图,再按需输出为 PDF 或 PNG:
- 长页 PDF:基于 canvas 高度动态计算页面尺寸,创建自定义高度的 jsPDF 单页文档,将 canvas 作为图片写入
- 长图 PNG:直接通过 canvas.toBlob 导出 PNG 文件
Test plan