<document xmlns="http://www.abbyy.com/FineReader_xml/FineReader10-schema-v1.xml" version="1.0" producer="kraken">
	<page width="{{ page.size[0] }}" height="{{ page.size[1] }}" resolution="0" originalCoords="1">
		<block blockType="Text">
			<text>
				<par>
				{% for line in page.lines %}
				<line baseline="{{ ((line.bbox[1] + line.bbox[3]) / 2)|int }}" l="{{ line.bbox[0] }}" r="{{ line.bbox[2] }}" t="{{ line.bbox[1] }}" b="{{ line.bbox[3] }}"><formatting lang="">
					{% for segment in line.recognition %}
					{% for char in segment.recognition %}
					{% if loop.first %}
					<charParams l="{{ char.bbox[0] }}" r="{{ char.bbox[2] }}" t="{{ char.bbox[1] }}" b="{{ char.bbox[3] }}" wordStart="1" charConfidence="{{ [char.confidence]|rescale(0, 100)|int }}">{{ char.text }}</charParams>
					{% else %}
					<charParams l="{{ char.bbox[0] }}" r="{{ char.bbox[2] }}" t="{{ char.bbox[1] }}" b="{{ char.bbox[3] }}" wordStart="0" charConfidence="{{ [char.confidence]|rescale(0, 100)|int }}">{{ char.text }}</charParams>
					{% endif %}
					{% endfor %}
		                        {% endfor %}
				</formatting>
				</line>
				{% endfor %}
				</par>
			</text>
		</block>
	</page>
</document>

