Skip to Content

How to Analyze PDFs vs Images in Claude API Attachments?

Claude PDF Processing: Document Type vs Image Differences?

Use type “document” and media_type “application/pdf” for Claude PDF analysis—key distinction from image attachments for accurate document handling.

Question

You want Claude to analyze a PDF document. What’s the main difference from sending an image?

A. Change the type to “document” and media_type to “application/pdf”
B. PDFs cost more to process
C. You can only send text, not images in PDFs
D. PDFs require special permission

Answer

A. Change the type to “document” and media_type to “application/pdf”

Explanation

When analyzing a PDF document with Claude via the Messages API, the main difference from sending an image is specifying type: “document” and media_type: “application/pdf” in the attachment object (e.g., {“type”: “document”, “media_type”: “application/pdf”, “source”: {…}}), enabling native text extraction, layout preservation, and semantic understanding of multi-page content. Images use type: “image” with MIME types like “image/jpeg”, triggering vision processing instead—PDFs leverage document-specific OCR and structure parsing without higher costs (B, same token pricing), text limitations (C, full content accessible), or permissions (D, standard API feature), ensuring accurate analysis of reports, contracts, or research papers.