
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
a11ycat-ocr
Advanced tools
OCR PDF documents in Node.js 🐱
Optional:
This is only needed if you are testing out the tess
method on the OCR
class. This is much faster than the recognize
method on the OCR
class since it uses tesseract.js, but yeilds less information.
IMPORTANT:
a11ycat-ocr
expects the ImageMagick tools to be availabe in$PATH
. If you are testing thetess
method on theOCR
class, thentesseract
must also be in$PATH
git clone https://github.com/devnoot/a11ycat-ocr.git a11ycat-ocr
cd a11ycat-ocr
npm install
npm build
const { A11yCat } = require('../../dist/index')
const { resolve } = require('path')
const ocr = new A11yCat.OCR()
async function main() {
try {
// Set the path to the pdf you want to OCR
const pdfPath = '/path/to/my.pdf'
// Set a destination directory for the pdf images
const destinationDir = resolve(process.cwd() + '/tmp')
// Convert a pdf to a series of images
const generatedImages = await ocr.convertPdfToImages(pdfPath, destinationDir)
// Run OCR on one of the generated images
const textFile = await ocr.tess(generatedImages[0])
} catch (error) {
throw error
}
}
main()
Tests are located in test/spec
. Tests should use data from test/data/images
and test/data/pdfs
Because there are some large PDFs in the test dataset, this can take a very long time depending on the host computer.
npm test
FAQs
**OCR PDF documents in Node.js 🐱**
The npm package a11ycat-ocr receives a total of 9 weekly downloads. As such, a11ycat-ocr popularity was classified as not popular.
We found that a11ycat-ocr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.