
Weekend Annoying Task Challenge: Second Reader
I never checked whether the people I send documents to can actually read them. Second Reader plays your document back in the order a screen reader announces it, shows it as a colour-blind reader sees it, and then rebuilds it accessible. Built on Amazon Textract, Polly and Bedrock.
The first document I ever heard was one of my own.
Forty seconds in, my data table started reading out numbers — twelve, four point seven, one hundred and eighteen, three — with nothing to say which column any of them belonged to. Just numbers, into the void, for nine straight seconds.
I built that table. I checked it twice. I checked the spelling, I checked the figures, I checked the logo was the current one.
I had never once checked whether the person receiving it could read it.
That is the annoying task I automated this weekend. Not because it takes a long time — because I never did it at all.

The thing I kept ignoring
Every accessibility checker I have tried hands back the same artefact: a list of rule numbers. 1.3.1 Info and Relationships. 1.4.3 Contrast. Each one correct. Each one impossible to picture. I have closed that panel far more often than I have ever acted on it, and I suspect you have too.
The problem was never that I did not know the rules. It was that a rule number describes a violation, and a violation is an abstraction, and nobody has ever been moved by an abstraction.
So I built the opposite thing.
Vision and What the App Does

Second Reader shows you a document the way a screen-reader user and a colour-blind reader will actually experience it — and then rebuilds it, accessible.
Every other checker hands you rule numbers. This hands you the experience.
Drop in a PDF of up to fifteen pages and you get five things you cannot currently see:

- Reading-order audio — the whole document read aloud in the exact order a screen reader announces it, page after page

- Word-level synced highlighting — each word lights up on the page as Polly speaks it, and the viewer follows the narration from page to page on its own

- The reading-order trail — a numbered line drawn over the page, freezing the announcement order into a single still image

- Colour-blind view — deuteranopia, protanopia and tritanopia, with a slider that crossfades from your version to theirs

- Findings in plain English — what breaks and what it costs a human, plus generated alt text for every figure

The trail is the one I keep coming back to. On a neat three-column layout that line does not flow down the page — it plunges to the bottom of column one, leaps back up to the top of column two, plunges again. Your careful design, announced as three disconnected monologues. You cannot un-see it.
Then the app stops describing the problem and fixes it:
- An accessible version — a Bedrock agent rebuilds the document as clean semantic HTML: one logical reading order, real headings, a table with proper header cells, images carrying the alt text it just wrote

- Edit by voice or by typing — say "add a one-line summary at the top" and the agent applies it. Which matters most for the people least able to reach for a mouse

- Download as HTML, Markdown or plain text

And one toggle that did more than any of it: 1x / 1.75x / 2.5x.
Real screen-reader users listen at two to three times speed. The calm, articulate voice you imagine when you picture assistive technology is a fiction — it is a firehose. Play your own document at 2.5x and the thing you have been imagining for years quietly corrects itself in about four seconds.
How I Built It
I validated the one assumption everything rests on, first. The entire app depends on a single claim: that Textract's
LAYOUT feature returns blocks in genuine reading order. So before writing a line of the app I wrote probe_textract.py , which does nothing but dump the block order for a fixture so I could read it with my own eyes. That is where I learned LAYOUT blocks link down to LINE , which link to WORD , and that the table-header check needs TABLES switched on alongside. Half an hour that saved a rewrite.Then the demo worked perfectly, and proved absolutely nothing.
I ran it against a real document. Sensible reading order. One trivial finding. Technically a success, and completely useless — because a single-column document has no collapse to reveal. I had built a tool whose entire purpose is to expose a failure, and handed it a document with no failure in it.
So I stopped building features and built a document designed to break: three columns that linearise wrongly, a table with no header row, an untagged figure, a legend that encodes meaning in colour alone, and a text box positioned visually first but placed last in the file. That one hour did more for this project than any feature I wrote. The reading-order trail exists because of it — once I had seen the collapse, I needed it to survive as a picture.
Three bugs stood between the audio and the truth.
Polly rejected dense pages outright —
TextLengthExceededException at three thousand billed characters. The fix chunks the spoken stream, synthesises each chunk separately, byte-concatenates the MP3s (raw Polly MP3 carries no header, so they simply join), and offsets each chunk's word timings by the running audio position into one continuous timeline.Then the highlight drifted. I had zipped Polly's word marks against my token list by position, which worked beautifully until a number like 1,240 came back as several marks and every word after it shifted by one — a highlight pointing confidently at the wrong word, which is worse than no highlight at all. The fix: record each token's UTF-8 byte span while building the SSML, then map every speech mark to the token whose span contains its byte offset.
Then a document containing "R&D" threw
InvalidSsmlException . Escaping the ampersand was the obvious part. The non-obvious part is that escaping changes the byte offsets — so the span map has to be measured on the escaped text, or the sync I had just carefully fixed silently breaks all over again. That was the subtlest bug of the weekend.Going multi-page changed the client, not the server. Sync Textract accepts a single-page PDF or an image, nothing else — which is why the browser had always rendered page one to a canvas and posted a PNG. Extending to whole documents meant rendering every page and switching PNG to compressed JPEG, so that many pages fit inside one request. The word index then runs continuously across page boundaries, which is what lets a single audio timeline span the document and the pager follow the narration by itself.
And one bug cost me an hour for a two-word fix. The browser reported only "Load failed" — no status, no detail. My Lambda was adding
Access-Control-Allow-Origin on top of the header the Function URL already sets, and browsers reject duplicate CORS headers outright. The fix was to delete my code and let the Function URL own CORS entirely.Two decisions I am prouder of than any of the code.
My first architecture was async and elaborate: Step Functions, an SNS completion channel, task tokens, EventBridge. For documents this size, that is architecture as decoration. One synchronous Lambda looping the pages is faster, cheaper and dramatically easier to debug at one in the morning. I wrote the async design down as the scale path and deliberately did not build it.
And for remediation I used a direct Bedrock model invocation rather than the managed Bedrock Agents service — same output, ships today, no provisioning. That turned out better founded than I knew: AWS renamed that service Bedrock Agents Classic and moved it toward maintenance mode this month.
AWS Services Used and Architecture Overview
How it is triggered: entirely user-initiated and synchronous. The browser renders the pages, POSTs them to a Lambda Function URL, and holds the connection until the pipeline returns. No queue, no scheduler, no polling. Three further user actions — alt text, remediate, edit — call the same function.

Browser (pdf.js renders every page to JPEGs) | POST { images[] } vAWS Lambda (Function URL - Python 3.12 - four actions) |- analyse per page: Amazon Textract AnalyzeDocument [LAYOUT, TABLES] | linearise: sequence + per-word boxes, index continues across pages | deterministic findings, aggregated per rule | Amazon Polly x2 per chunk: mp3 + word speech marks | byte-offset map: one cross-page timeline |- altFor Amazon Bedrock Nova Lite (vision): alt text for a figure crop |- remediate Amazon Bedrock Nova Lite: accessible semantic HTML |- edit Amazon Bedrock Nova Lite: applies a spoken or typed change | |- mp3 to Amazon S3 (private, presigned 15 min, 1-day expiry) |- JSON to browser: pages, timeline, findings, audioUrl
Frontend: Amazon S3 (private) + Amazon CloudFront with Origin Access ControlInfrastructure: AWS SAM / CloudFormation Logs: Amazon CloudWatch- Amazon Textract — the core, called once per page.
LAYOUTreturns blocks in reading order with a box for every word;TABLESsupplies theCOLUMN_HEADERentities the header check needs
- Amazon Polly — neural voice, twice per chunk: the MP3, and
wordspeech marks carrying byte offsets
- Amazon Bedrock — Nova Lite, four generation jobs: phrasing findings, alt text by vision, rebuilding the document, applying edits
- AWS Lambda — one Python function behind a Function URL, HTTPS with no API Gateway
- Amazon S3 — two private buckets: generated audio, and the static site
- Amazon CloudFront — HTTPS delivery via Origin Access Control, so the whole app lives in AWS and nothing runs from my laptop
- AWS SAM — one
template.yamldeploys all of it
- Amazon CloudWatch — where every bug above was actually found
Everything in us-east-1. A full run costs well under one cent.
The rule I held to throughout: detect deterministically, generate only where generation belongs.
Whether something is a defect — and the document's structure, its reading order, the geometry of every word — is decided by Textract and by rules in code. Never by a model. Bedrock is used only for generation: phrasing a finding, describing an image, rebuilding a document, applying an edit. The phrasing prompt is forbidden from adding, removing or reordering findings, and any response whose count does not match is thrown away in favour of the deterministic wording.
This is also exactly why extraction stays on Textract rather than a vision model. I need precise per-word bounding boxes to drive the highlight and the trail. I need determinism, so a finding can be trusted. And most of all I need a literal linearisation — because a cleverer reader would quietly repair the reading order in its own head and hide the very failure I am trying to show you.
What I Learned
Screen-reader users listen at two to three times speed. I built that toggle as a small convenience and it became the most educational thing in the app.
Reading order is a property of the file, not of the layout. A document can look immaculate and be announced in an order that makes no sense, because visual position and document order are simply different things. You cannot catch this by looking harder — which is precisely why it survives proofreading, every time.
An insight that exists only in audio does not travel. The synchronised highlight is the best thing in this app and it is completely invisible in an article, a screenshot, or a pull request. Building the trail — the same truth, as a still image — was the difference between something I could demo live and something I could show you here.
Knowing where a model belongs is a design decision, not a technical one. The same model that would have degraded extraction turned out to be exactly the right tool for rebuilding the document afterwards.
And one honest limitation. A real screen reader reads a tagged PDF's structure tree; Textract infers order from pixels. On a properly tagged document the two can disagree. What Second Reader gives you is a highly plausible linearisation, not a literal transcript of what NVDA will say — which matters less than it sounds, because the documents that hurt people are the untagged ones, and those are exactly the ones this catches.
Next: run the remediated document back through the same deterministic checks and show the findings drop to zero — verifying the model's work with the rules that found the problems in the first place.
And the lesson I will keep: a demo that never fails proves nothing. The most valuable hour of my weekend went on building a document designed to break.
Try It
The interesting version is this one: upload something you actually sent someone last week.
Press play.
I would genuinely like to know what you hear.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article