Anthropic has added PDF support to its Claude 3.5 Sonnet AI model in public beta, allowing it to process both text and visual elements within PDF documents.
The model can now analyze financial reports, legal documents, and handle document translation by processing text along with images, charts, and tables. PDF processing takes place in three steps: First, the system extracts text from the document. Then it converts each page into an image for analysis, allowing users to gain insight into the visual elements of a PDF.
Claude's PDF feature can be combined with other features, such as tool usage, to extract specific information from documents for use as tool input. Files must be less than 32 MB and cannot exceed 100 pages. The system doesn't support encrypted or password-protected documents.
Processing costs vary based on document length and content density. Each page typically uses between 1,500 and 3,000 tokens, with no additional charges beyond standard token fees, Anthropic says.
The feature is currently available through the Claude Chat feature preview and via API access using the header "anthropic-beta: pdfs-2024-09-25". Anthropic plans to add support for Amazon Bedrock and Google Vertex AI later.
Claude PDF processing best practices
Anthropic recommends ensuring documents have clear, readable text and properly aligned pages. When referring to specific sections, users should use the page numbers shown in PDF viewers. For API usage, PDFs should be included before text in requests.
For large documents exceeding size limits, Anthropic suggests splitting them into smaller segments. The company also recommends using prompt caching when analyzing the same document multiple times to improve efficiency. Examples of PDF processing are available here.