Assignments at college sometimes had to be handwritten. I kept forgetting. So I built a tool that takes typed text and generates a PDF that looks handwritten - with configurable fonts, spacing, and margins. The PDFs are properly structured too, not just image screenshots, so you can still select and copy the text.
Features
- Converts typed text to a handwritten-style PDF
- Properly structured PDFs via pdf-lib - text is selectable and copyable
- Configurable margin, font size, and line spacing
- Minimal UI
Neural handwriting generation
I also built a second version using TensorFlow and a recurrent neural network (Flask + Docker) that generates much more realistic handwriting by learning stroke patterns from a dataset. It works locally - the RNN learns to vary character spacing and slant in ways that look more natural than a static font mapping. Deployment is blocked by the Docker/ML model hosting cost, so the live site runs the font-based version.
Key decisions
- pdf-lib over canvas-to-image export — a properly structured PDF keeps the text selectable and copyable; exporting a canvas screenshot produces an image that looks the same but throws away the semantic content
- Configurable spacing and margins — different page sizes and line rulings have different requirements; making these parameters rather than constants lets the output match the actual assignment format
Built with
- Next.js
- pdf-lib - PDF generation
- tailwindcss
- Deployed on Vercel