Convert typed text to realistic handwriting!
npm install --save handwritten.js
const handwritten = require('handwritten.js');
const fs = require('fs');
(async function(text) {
let converted = await handwritten(text);
converted.pipe(fs.createWriteStream('output.pdf'));
})("Hello, world!");
npx handwritten.js "relative/path/to/file.txt"
Note: Use this method only if you plan to use handwritten.js for one time, installing handwritten.js globally (see-below) is recommended for multiple time usages.
npm install handwritten.js -g
Note: DO NOT use sudo to install global packages! The correct way to do it is to tell npm where to install it's global packages:
npm config set prefix ~/.local
. Make sure~/.local/bin
is added toPATH
.
handwritten.js "/absolute/path/to/file.txt"
It takes a single argument as the path to the text file, and, if everything goes smoothly, saves the output pdf as 'output.pdf'.
It takes a single string argument and returns a promise that contains a pdfkit document instance.
👤 Rahil Kabani [email protected]
Give a ⭐️ if this project helped you!
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
GDGVIT/HandWriter - For the cleaned dataset.
🏠 Homepage