...

Convert a Coursework PDF to a Page Your App Can Annotate

Filestack is a file API you add to your own education platform. This page takes one mechanic out of it: turning a handed-in PDF into a page image your app can annotate.

Filestack for EdTech covers the rest of the platform.

coursework · marking
A pen, highlighter, box, arrow and text toolbar above a student write-up that carries a highlighted line, an orange circle around one diagram box, a green arrow and two ticks.

Fairmount College Coursework, a demo we built to show the API, not a Filestack product. Filestack supplies the page image; the toolbar and the marks over it are application code.

Trusted by teams at
The word teachable is written in all lowercase, sans-serif letters with a colon between teach and able, in a light purple color on a light background.
LinkedIn logo followed by the word SlideShare in gray text on a light background.

Coursework Arrives From Any Device

A phone photo, a flatbed scan or a laptop PDF. Filestack’s picker drops into your own hand-in page and also reaches Google Drive and OneDrive.

Each upload returns a handle: the short ID Filestack files it under, and what every URL further down this page is built from.

The picker also opens Transformations UI before the upload finishes, so a student crops or straightens a phone photo of a handwritten page and Filestack stores the edited version. It is a marketplace add-on, switched on with transformationsUI: true, and the demo runs without it.

coursework · hand in
The Filestack picker open over a hand-in page, offering My Device, Link, Google Drive and OneDrive as sources.

Four Steps From Set to Marked

The route the demo takes. Filestack stores the file on the way in, converts it for marking and serves every view of it. The class list, the due date and the score belong to the app.

01
Set the work
A typed brief, a worksheet or a scan
02
Hand in
Photos, scans and PDFs from a phone or laptop
03
Mark the page
Pen, highlighter, box, arrow and text on the page
04
Read it back
Score, comments and marks return together

How the Demo Annotates a Page

Filestack returns the submission as a page image. Your app puts an HTML canvas over that image and the lecturer draws on the canvas, so the pen, the highlighter and the tick are your app’s code, not a Filestack UI. The submission Filestack stores keeps the bytes the student uploaded.

A page of the student write-up as Filestack returns it, with no marks on it.
The page image Filestack returns from the stored submission
The same page with a highlighted sentence, an orange circle around one diagram box, a green arrow and two ticks drawn over it.
The same image with the app's canvas layer composited over it

The Marks Save as Their Own File

Saving uploads the app’s canvas to Filestack as a transparent PNG the size of the page. The submission gets one handle, the marks get another.

The browser stacks the two at display time, so the original is never rewritten and a mark can be cleared or redrawn.

The four files behind one marked submission in the demo.

submission PNG 1425×1754 · 179 KB
page for marking PNG · 194 KB
marks layer PNG with alpha · 69 KB
list thumbnail WebP · 1.8 KB
marks · transparent PNG
The lecturer's marks on their own, with nothing behind them: a pink highlight bar, an orange circle, a green arrow and a green tick over a transparency check.

Converting a PDF Page to an Image

A browser cannot draw on a PDF. Filestack reads the stored PDF for its page count, then converts any single page to a PNG on request, which is an image the app can put a canvas over.

Page one of a two page PDF converted to an image in the marking view, with the endpoint table legible and the pen, highlighter and arrow tools above it.

page 1 of 2, converted from the stored PDF at density 150

The Page Is a URL

Filestack takes no build step and stores no second copy. You ask for a page or a thumbnail by writing the tasks into the URL in front of the handle. Filestack computes it on the first request and serves it from the edge cache after that.

CDN cdn.filestackcontent.com
/
Task output=format:png,page:1,density:150
/
Task resize=width:1600,fit:max
/
Handle 49N2JIL0ScaQYEKVgEES
cdn.filestackcontent.com/pdfinfo/49N2JIL0ScaQYEKVgEES
{
  "pages": 2,
  "pagesize": { "paper": "A4", "width": 595.276, "height": 841.89 },
  "encrypted": false,
  "protected": false
}

Read the Processing API docs →

Frequently Asked Questions

Can students hand in work from a phone?

Yes. The picker uploads photos, scans and PDFs from a phone or a laptop, and it also reaches Google Drive and OneDrive. Uploads are chunked and resumable, so a large scan survives a weak connection.

How do I convert a PDF page to an image?

A browser cannot draw on a PDF, so the Processing API converts a single page to a PNG when you ask for it. The page number is a task written into the URL, so page two is a different URL on the same stored file rather than a second upload.

Does marking change the student's original file?

No. Marking happens on an HTML canvas your app draws over the page image. Saving uploads that canvas to Filestack as a separate transparent PNG the size of the page, and the browser stacks the two at display time, so the original is never rewritten and a mark can be cleared or redrawn later.

How many pages can one submission have?

The page count comes back from pdfinfo on the stored PDF. The app requests and saves each page separately, so multi page documents are marked one page at a time.

Can the same file serve a phone and a laptop?

Yes. A thumbnail, a full page and a phone sized WebP are three transformation URLs on the same handle. Filestack computes each one on its first request and serves it from the edge cache from then on.

How is student work kept private?

Signed URLs and access policies scope a file to a user, a session or an expiry, so a submission URL does not work for anyone the policy does not name. Filestack publishes no FERPA, COPPA or HIPAA certification. Institutions that need specific terms named in the contract can request them through Filestack.

Does this work with an LMS like Canvas or Moodle?

Filestack ships no LMS plugin and no LTI tool. It is an HTTP API with SDKs, called from whatever code you already run, which is why the demo here is a standalone app. Filestack for EdTech covers integration across a platform; this page covers one mechanic inside it.