PDFs are converted to per-page JPEG images instead of using document content blocks
Resolved 💬 2 comments Opened Mar 4, 2026 by adamnemecek Closed Apr 2, 2026
Problem
When a PDF is sent to Claude Code, each page is converted to a separate JPEG image and sent as individual image content blocks with type: "base64". This means a 20-page PDF counts as 20 images against the API's 100-image limit.
The Anthropic API supports a document content block type where a PDF is sent as a single document. The Claude desktop/web app uses this, so a PDF counts as 1 document rather than N images.
Impact
- A conversation with a few PDFs easily hits the
too many images and documents: 105 + 0 > 100error and becomes completely unusable - In my case, ~5 PDF page batches (totaling 105 page-images) bricked the conversation
- The per-page JPEG conversion also bloats the conversation history file (my
.jsonlwent to 12MB, mostly base64 image data) - Image quality is likely worse than native PDF rendering
Expected behavior
PDFs should be sent using the API's document content block type (like the desktop app does), so each PDF counts as 1 document rather than N images.
Reproduction
- Send a 20+ page PDF to Claude Code (e.g.
cat paper.pdf | claudeor reference it in conversation) - Send a few more PDFs or images in the same conversation
- Conversation fails with
too many images and documentserror
Workaround
Manually edit the conversation .jsonl file to remove image blocks, then resume the conversation.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗