Skip to content

fix: make PDF HTML output self-contained - #11

Merged
RainLib merged 1 commit into
mainfrom
agent/fix-pdf-standalone-html
Jul 20, 2026
Merged

fix: make PDF HTML output self-contained#11
RainLib merged 1 commit into
mainfrom
agent/fix-pdf-standalone-html

Conversation

@RainLib

@RainLib RainLib commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What changed

  • Make PDF HTML output self-contained by default.
  • Inline every PDF page for CLI, MCP, resident, screenshot, and export paths.
  • Keep lazy page loading only for the watch server.
  • Add regression tests for both standalone and watch-server behavior.

Root cause

The CLI and watch server shared the same lazy-loading HTML path. As a result, officecli view <file.pdf> --mode html emitted fetch(page/{n}/html) requests that only work while the watch server is running.

Impact

HTML generated from a PDF can now be saved and opened independently without an OfficeCLI server. Large watch previews retain their existing lazy-loading behavior.

Validation

  • Real PDF command output inlined /page[1] and contained no fetch.
  • cargo test -p pdf-handler --offline (11/11 passed)
  • cargo clippy --all-targets --offline -- -D warnings
  • cargo test --workspace --offline (including 54 CLI smoke tests)

Fixes #3

@RainLib
RainLib force-pushed the agent/fix-pdf-standalone-html branch from 8b2514f to c7901d7 Compare July 20, 2026 08:05
@RainLib
RainLib force-pushed the agent/fix-pdf-standalone-html branch from c7901d7 to 36d65af Compare July 20, 2026 08:10
@RainLib
RainLib marked this pull request as ready for review July 20, 2026 08:12
@RainLib
RainLib merged commit 931cc58 into main Jul 20, 2026
3 checks passed
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.

BUG:以html模式查看pdf文件,输出的html不是完全独立可运行的

1 participant