PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE test_table ( id int, test_parameter varchar(64) );
Copy Clear
Copy Format Clear
<?php $targetlang = "deu"; $originfile = "badfile1.pdf"; $pdf2png = exec("convert -verbose -density 300 -trim " . $originfile . " -quality 100 -format png " . $originfile . "-page.png", $outputPDF2PNG, $return); var_dump($return); if($return === 0) { echo "<h3>PDF converted to PNG images.</h3><br>"; var_dump($outputPDF2PNG); echo "<br>"; $p = count($outputPDF2PNG); echo "Number of generated images: " . $p; $p_number = $p; ocr: checkpages(); function checkpages(){ if($p_number <= $p){ OCR($p_number); } else { goto finish; }; } finish: echo "End of script"; function OCR() { $doOCR = exec("tesseract " . $originfile . "-page-" . $p_number . ".png - -l " . $targetlang, $outputOCR, $return); if($return === 0) { echo "<h3>OCR for page " . $p_number . " done.</h3><br>"; var_dump($outputOCR); echo "<br>"; echo "<h3>Output segments for page " . $p_number . ":</h3><br>"; $l = count($outputOCR); $i = 0; while($i <= $l) { echo $outputOCR[$i] . "<br>"; $i++; } $p_number++; } } } ?>
Show:  
Copy Clear