fix(core): update

This commit is contained in:
2024-04-18 16:43:32 +02:00
parent 871f152f2d
commit 1ddb442661
12 changed files with 2618 additions and 31865 deletions

View File

@ -1,16 +1,16 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartocr from '../ts/index';
import { expect, tap } from '@push.rocks/tapbundle';
import * as smartocr from '../ts/index.js';
let testOcrInstance: smartocr.SmartOcr;
tap.test('should create a valid instance of Smartocr', async () => {
testOcrInstance = await smartocr.SmartOcr.createAndInit();
expect(testOcrInstance).to.be.instanceOf(smartocr.SmartOcr);
expect(testOcrInstance).toBeInstanceOf(smartocr.SmartOcr);
});
tap.test('should ocr a pdfBuffer', async () => {
const smartfile = await import('@pushrocks/smartfile');
const pdfBuffer = (await smartfile.Smartfile.fromFilePath('./test/demo_without_textlayer.pdf'))
const smartfile = await import('@push.rocks/smartfile');
const pdfBuffer = (await smartfile.SmartFile.fromFilePath('./test/demo_without_textlayer.pdf'))
.contentBuffer;
const resultBuffer = await testOcrInstance.processPdfBuffer(pdfBuffer);
console.log(resultBuffer);