Skip to content

Commit 425b191

Browse files
fix: Add text direction to export_to_textlines (#338)
added option to export_to_textlines Signed-off-by: Peter Staar <[email protected]>
1 parent 77a3f51 commit 425b191

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docling_core/types/doc/page.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ def export_to_textlines(
649649
add_location: bool = True,
650650
add_fontkey: bool = False,
651651
add_fontname: bool = True,
652+
add_text_direction: bool = True,
652653
) -> List[str]:
653654
"""Export text cells as formatted text lines.
654655
@@ -676,6 +677,9 @@ def export_to_textlines(
676677
if add_fontname and isinstance(cell, PdfTextCell):
677678
line += f"{cell.font_name:>10} "
678679

680+
if add_text_direction and isinstance(cell, PdfTextCell):
681+
line += f"{cell.text_direction} "
682+
679683
line += f"{cell.text}"
680684
lines.append(line)
681685

0 commit comments

Comments
 (0)