Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OcrVision in NodeJs
// Define your HTML/CSS
const data = {
html: "<div class='box'>Success ✅</div>",
css: ".box { border: 4px solid #03B875; padding: 20px; font-family: 'Roboto'; }",
font: "Roboto"
}
// Create an image by sending a POST to the API.
const image = await request
.post({ url: 'https://api.ocr.vision', form: data})
.auth(process.env.API_ID, process.env.API_KEY)
const { url } = JSON.parse(image)
console.log(url) // generated URL
url + ".jpeg" // show an image preview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.