fix(core): update
This commit is contained in:
BIN
test/demo_without_textlayer.pdf
Normal file
BIN
test/demo_without_textlayer.pdf
Normal file
Binary file not shown.
14
test/test.ts
14
test/test.ts
@ -1,8 +1,18 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartocr from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(smartocr.standardExport);
|
||||
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);
|
||||
});
|
||||
|
||||
tap.test('should ocr a pdfBuffer', async () => {
|
||||
const smartfile = await import('@pushrocks/smartfile');
|
||||
const pdfBuffer = (await smartfile.Smartfile.fromFilePath('./test/demo_without_textlayer.pdf'))
|
||||
.contentBuffer;
|
||||
testOcrInstance.processPdfBuffer(pdfBuffer);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user