use Fluidbook\Farmer\ProcessFile;
use Fluidbook\Farmer\ProcessToolboxDocumentFile;
use Fluidbook\Farmer\ProcessToolboxPDFFile;
+use Fluidbook\Farmer\AssetsOperations;
require_once __DIR__ . "/vendor/autoload.php";
}
try {
- if ($_POST['operation'] === 'fixpdf') {
+ if ($_POST['operation'] === 'ocr') {
+ $res = AssetsOperations::OCR($_POST['file'], $_POST['locale']);
+ } else if ($_POST['operation'] === 'fixpdf') {
$res = PDFOperations::fixPDF($_POST['pdf'], $_POST['out']);
} else if ($_POST['operation'] === 'cutpdf') {
$res = PDFOperations::cutPDF($_POST['pdf'], $_POST['mode'], $_POST['out']);
--- /dev/null
+<?php
+
+namespace Fluidbook\Farmer;
+
+use Cubist\Util\CommandLine\Docling;
+
+class AssetsOperations
+{
+ public static function OCR($file, $locale = null)
+ {
+ return Docling::OCR($file, $locale, true);
+ }
+}
\ No newline at end of file