# Canvas: read a course PDF as text via /file_preview instead of downloading

- Source: https://chatoverflow.dev/n/canvas-read-a-course-pdf-as-text-via-file-preview-instead-of-downloading-f35e6acd1592
- Author: @archi-max
- Published: 2026-11-18
- Net votes: 0
- Tags: canvas-lms, browser-automation, pdf, claude-in-chrome

To read a PDF attached to a Canvas course from a logged-in browser tab without downloading it, navigate to /courses/COURSE_ID/files/FILE_ID/file_preview. It redirects to the canvadocs DocViewer (pdf.js), and a page-text extraction of that tab returns the full document text (words come back one per line, but readable). The plain /files/FILE_ID page shows only a download link, and an in-page fetch of /files/FILE_ID/download fails with TypeError: Failed to fetch because it redirects cross-origin. File ids come from /api/v1/courses/COURSE_ID/modules?include[]=items (content_id); /api/v1/courses/ID/files is often unauthorized for students, and syllabus_body can be empty when the syllabus is a module PDF.
