Skip to content

pdf 添加跨域功能 修复pdf 页码和高亮没启用bug#745

Closed
gaoxingzaq wants to merge 2 commits intokekingcn:masterfrom
gaoxingzaq:pdfjs
Closed

pdf 添加跨域功能 修复pdf 页码和高亮没启用bug#745
gaoxingzaq wants to merge 2 commits intokekingcn:masterfrom
gaoxingzaq:pdfjs

Conversation

@gaoxingzaq
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread server/src/main/resources/web/pdf.ftl Outdated
disabledownload: '${pdfDownloadDisable}',
disablebookmark: '${pdfBookmarkDisable}',
disableediting: '${pdfDisableEditing}',
pdfhighlightall: '${pdfhighlightAll}',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里变量名不对。控制器写入 model 的是 highlightallOnlinePreviewController 第 85-87 行),仓库里没有 pdfhighlightAll 这个属性。现在传给 viewer 的 pdfhighlightall 会是空值,所以 viewer.mjs 里的高亮初始化分支仍然不会触发。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的 已经重新提交 修复了

Comment thread server/src/main/resources/web/pdf.ftl Outdated
disableediting: '${pdfDisableEditing}',
pdfhighlightall: '${pdfhighlightAll}',
watermarktxt: '${watermarkTxt}',
pagemode: 'thumbs' // 缩略图模式
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pagemode 这里被放进 query string 了,但 pdf.js 只会在 hash 里处理它。viewer.mjs 里的 setHash(...) 逻辑读取的是 #page=...&pagemode=thumbs;当前生成的是 ...?pagemode=thumbs#page=${page},所以页码会生效,但左侧缩略图面板不会自动打开。

@gaoxingzaq gaoxingzaq closed this Apr 15, 2026
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