Skip to content

Fix TableAnnotation position when a PDF table is linked to the line a… - #568

Open
FedyaBadyilo wants to merge 1 commit into
ispras:developfrom
FedyaBadyilo:fix/table-annotation-caption-end
Open

Fix TableAnnotation position when a PDF table is linked to the line a…#568
FedyaBadyilo wants to merge 1 commit into
ispras:developfrom
FedyaBadyilo:fix/table-annotation-caption-end

Conversation

@FedyaBadyilo

Copy link
Copy Markdown

Summary

  • When a PDF table is linked to the line above it (a caption), TableAnnotation is now placed at the end of that line instead of the start.
  • When the table is linked to the line below, the annotation stays at the start, as before.

Closes #567

Test plan

  • python -m unittest tests.unit_tests.test_misc_line_object_linker
  • flake8 .

@NastyBoget
NastyBoget self-requested a review September 8, 2026 13:25
else:
annotation = TableAnnotation(value=page_object.uid, start=0, end=len(best_line.line))
elif isinstance(page_object, PdfImageAttachment):
annotation = AttachAnnotation(attach_uid=page_object.uid, start=0, end=len(best_line.line))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

См. комментарий #567 (comment)
аналогично нужно сделать для AttachAnnotation. А также для других ридеров, которые могут добавлять TableAnnotation или AttachAnnotation

@NastyBoget

Copy link
Copy Markdown
Collaborator

Нужно исправить упавшие тесты. Проверка всех тестов:

test="true" docker compose up --build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TableAnnotation стоит в начале подписи, хотя таблица на странице идёт после неё

2 participants