Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ocr-document-classification

Package Overview
Dependencies
Maintainers
0
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ocr-document-classification - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

26

dist/index.js

@@ -5,3 +5,3 @@ // src/functions.ts

// src/convert.js
// src/convert.ts
import * as pdfjsLib from "pdfjs-dist";

@@ -15,3 +15,2 @@ pdfjsLib.GlobalWorkerOptions.workerSrc = "https://cdn.jsdelivr.net/npm/pdfjs-dist@4.4.168/build/pdf.worker.min.mjs";

let blobArray = [];
console.log(`PDF loaded with ${numPages} pages`);
for (let i = 1; i <= totalPages; i++) {

@@ -33,10 +32,14 @@ const page = await doc.getPage(i);

const blob = await new Promise((resolve, reject) => {
canvas.toBlob((blob2) => {
if (blob2) {
console.log("Converted PDF to Blob!");
resolve(blob2);
} else {
reject(new Error("Failed to convert canvas to blob"));
}
}, "image/png");
canvas.toBlob(
(blob2) => {
if (blob2) {
console.log("Converted PDF to Blob!");
resolve(blob2);
} else {
reject(new Error("Failed to convert canvas to blob"));
}
},
"image/png",
1
);
});

@@ -47,3 +50,4 @@ blobArray.push(blob);

} catch (error) {
console.error("Failed to load PDF:", error);
console.error("Failed to load or process PDF:", error);
throw error;
}

@@ -50,0 +54,0 @@ }

{
"name": "ocr-document-classification",
"version": "1.3.3",
"version": "1.3.4",
"description": "Document classification using tesseract.js and string-similarity-js.",

@@ -5,0 +5,0 @@ "main": "./dist/index.cjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc