Tuesday 2 March 2010

ALTO Viewer



I've just put some code on Github for a very simple ALTO Viewer which I knocked up to debug my AbbyyFineReader to ALTO XML conversion scripts (awaiting confirmation from Abbyy before I release as Open Source). It's a very simple page which scales the vertical and horizontal asxis of the source image and plots transparent layers for the Strings, TextLines, TextBlocks and PrintSpace elements. I've not added full features of ALTO yet as we don't use them ourselves but it should be trivial.

Requires PHP5 and uses JQuery 1.4 (bundled)

Configuration is currently done in the index.php file where you should provide 2 arguments to the constructor to point it at your alto and image files.
e.g.


$altoViewer = new AltoViewer( '/Users/dof/Development/Source/altoview/alto',
'/Users/dof/Development/Source/altoview/images',
$image, $vScale, $hScale);
Modify the first 2 arguments as required.

Use the toggle buttons in the right hand menu to toggle individual layers on and off as required. You can have any combination of layers selected at any given time.

Head on over to GitHub to grab the code and have a play.