Skip to content

fix: write pdf captures to .pdf files in boxel screenshot - #6146

Open
lukemelia wants to merge 1 commit into
mainfrom
fix-boxel-cli-pdf-capture-extension
Open

lukemelia wants to merge 1 commit into
mainfrom
fix-boxel-cli-pdf-capture-extension

Conversation

@lukemelia

Copy link
Copy Markdown
Contributor

Summary

The boxel screenshot command passes a --spec file's captureSpec through to POST /_screenshot-card verbatim, so a spec requesting captureSpec: { type: "pdf" } gets back contentType: application/pdf — but EXTENSION_BY_CONTENT_TYPE mapped only the three image types and fell back to png, landing the paged document in a .png file. Map application/pdf to a .pdf extension.

Testing

  • tests/commands/screenshot.test.ts: a pdf capture response writes its bytes to a .pdf file — green locally along with the rest of the screenshot command suite.

🤖 Generated with Claude Code

The POST /_screenshot-card surface can answer a --spec file's
captureSpec: { type: 'pdf' } with contentType: application/pdf, and the
extension map's png fallback landed those bytes in a .png file. Map the
content type to a .pdf extension and pin it with a test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant