Skip to content

Set output types #197

Open
Open
@devdras

Description

@devdras

Hi, can you add the option for output types please? Could look something like this:
`async function getTextFromImage(filePath, outputType) {
await (0, _tar.extract)({
file: inputPath,
cwd: '/tmp'
});

if (outputType !== 'stdout' || outputType !== 'txt' || outputType !== 'pdf'|| outputType !== 'hocr'|| outputType !== 'tsv') {
return "BAD_OUTPUT_TYPE"
}

const stdout = (0, _child_process.execFileSync)(outputPath, [filePath, outputType, '-l', 'eng'], {
cwd: '/tmp/tesseract-standalone',
env: {
LD_LIBRARY_PATH: './lib',
TESSDATA_PREFIX: './tessdata'
}
});
(0, _child_process.execSync)(rm ${filePath});
return stdout.toString();
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions