diff --git a/src/eynollah/eynollah.py b/src/eynollah/eynollah.py index 54f603e..dad2d53 100644 --- a/src/eynollah/eynollah.py +++ b/src/eynollah/eynollah.py @@ -2325,6 +2325,7 @@ class Eynollah: pcgts = writer.build_pagexml_no_full_layout( found_polygons_text_region=[], page_coord=page_coord, + page_slope=slope_deskew, order_of_texts=[], all_found_textline_polygons=[], found_polygons_images=[], @@ -2614,6 +2615,7 @@ class Eynollah: found_polygons_text_region=polygons_of_textregions, found_polygons_text_region_h=polygons_of_textregions_h, page_coord=page_coord, + page_slope=slope_deskew, order_of_texts=order_text_new, all_found_textline_polygons=all_found_textline_polygons, all_found_textline_polygons_h=all_found_textline_polygons_h, @@ -2642,6 +2644,7 @@ class Eynollah: pcgts = writer.build_pagexml_no_full_layout( found_polygons_text_region=polygons_of_textregions, page_coord=page_coord, + page_slope=slope_deskew, order_of_texts=order_text_new, all_found_textline_polygons=all_found_textline_polygons, found_polygons_images=polygons_of_images, diff --git a/src/eynollah/writer.py b/src/eynollah/writer.py index dd39bac..b867d9e 100644 --- a/src/eynollah/writer.py +++ b/src/eynollah/writer.py @@ -73,6 +73,7 @@ class EynollahXmlWriter: *, found_polygons_text_region, page_coord, + page_slope, order_of_texts, all_found_textline_polygons, found_polygons_images, @@ -100,6 +101,7 @@ class EynollahXmlWriter: found_polygons_text_region=found_polygons_text_region, found_polygons_text_region_h=[], page_coord=page_coord, + page_slope=page_slope, order_of_texts=order_of_texts, all_found_textline_polygons=all_found_textline_polygons, all_found_textline_polygons_h=[], @@ -132,6 +134,7 @@ class EynollahXmlWriter: found_polygons_text_region, found_polygons_text_region_h, page_coord, + page_slope, order_of_texts, all_found_textline_polygons, all_found_textline_polygons_h, @@ -168,6 +171,7 @@ class EynollahXmlWriter: pcgts = self.pcgts if self.pcgts else create_page_xml( self.image_filename, self.image_height, self.image_width) page = pcgts.get_Page() + page.set_orientation(-page_slope) if len(cont_page): page.set_Border(BorderType(Coords=CoordsType(points=self.calculate_points(cont_page[0]))))