Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug][pdf-plugin] pdf.py 引用不存在的 html2pdf.js,convert.html 入口对所有用户失效

Open Beginner friendly
#106 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, python
Domain
cli

Research direction

The stale reference is in pdf.py: the convert.html path (around L1878-1882) builds js_path from html2pdf.js, and a second use near L2086-2088 does the same. Confirm the scripts directory only contains html2pdf-next.js, then point every html2pdf.js reference at html2pdf-next.js. Done when python pdf.py convert.html any.html -o out.pdf produces a PDF instead of the DependencyMissing error.

Written by the indexing model from the issue text.

Description

Description

pdf.py 的 convert.html 命令引用 html2pdf.js,但插件包内的实际文件是 html2pdf-next.js。该入口随包即失效,对所有用户可复现——推测是脚本改名为 -next 版本时未同步更新引用方。

Steps to Reproduce

  1. 进入 pdf skill 的 scripts/ 目录(随 ZCode 安装包内置路径 resources/glm/packages/pdf-plugin/skills/pdf/scripts/,或插件缓存副本);
  2. 执行:python pdf.py convert.html any.html -o out.pdf。

Expected Behavior

convert.html 走通 HTML→PDF 转换。

Actual Behavior

{ "status": "error", "error": "DependencyMissing", "message": "html2pdf.js not found in scripts directory" }

Evidence

上游 main 分支 apps/zcode-cli/packages/pdf-plugin/skills/pdf/scripts/pdf.py:

  • L1878:"""Convert HTML to PDF via node html2pdf.js."""
  • L1882:js_path = _SCRIPT_DIR / "html2pdf.js"
  • L2086/L2088:注释与 js_script = _SCRIPT_DIR / "html2pdf.js"

同目录文件清单只有 html2pdf-next.js,无 html2pdf.js:
https://github.com/zai-org/ZCode/tree/main/apps/zcode-cli/packages/pdf-plugin/skills/pdf/scripts

发行包 0.1.8(随安装程序内置)同样如此。直跑 html2pdf-next.js 可绕开这条入口。

Suggested Fix

将 pdf.py 中全部 html2pdf.js 引用改为 html2pdf-next.js(或在 scripts 目录提供别名文件)。实测 html2pdf-next.js 功能完整,是唯一现存入口。

Environment

  • OS:Windows 11
  • 版本:pdf-plugin 0.1.8(ZCode 安装包内置);上游 main 分支同样存在
Dominant language
Python
Stars
103
Forks
78
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zai-org/zcode-plugins

All issues in zai-org/zcode-plugins

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.