Skip to content

alias-rahil/handwritten.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to handwritten.js 👋

Version License: MIT

Convert typed text to realistic handwriting!

In your code:

Installation

npm install --save handwritten.js

Usage

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!");

Command line usage:

Using without installation

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.

Installation

npm install handwritten.js -g

Note: DO NOT use sudo to install global packages! The correct way is to tell npm where to install its global packages: npm config set prefix ~/.local. Make sure ~/.local/bin is added to PATH.

Usage after installation

handwritten.js "/absolute/path/to/file.txt"

API

Command line

It takes a single argument as the path to the text file, and, if everything goes smoothly, saves the output pdf as 'output.pdf'.

In code

It takes a single string argument and returns a promise that contains a pdfkit document instance.

Screenshot

lorem-ipsum.jpeg

Author

👤 Rahil Kabani [email protected]

Show your support

Give a ⭐️ if this project helped you!

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Credits

GDGVIT/HandWriter - For the cleaned dataset.

Handwritten.JS

🏠 Homepage

License

MIT