Skip to content

Instantly share code, notes, and snippets.

@DavidKuennen
Created November 9, 2018 21:05
Show Gist options
  • Save DavidKuennen/81f0642ea1cc4f5fac0cfc632322fc43 to your computer and use it in GitHub Desktop.
Save DavidKuennen/81f0642ea1cc4f5fac0cfc632322fc43 to your computer and use it in GitHub Desktop.
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