adsfolio.gui.annotation_merge

Interactive review dialog for moving annotations between PDF editions.

class adsfolio.gui.annotation_merge.AnnotationMergeDialog(target, source, parent=None)[source]

Bases: PySide6.QtWidgets.QDialog

Review each source annotation and write a verified merged copy.

The target PDF is canonical and is never modified. Each source annotation is placed on the target, or, if its type cannot be copied, explicitly waived. The copy is saved to a new path chosen by the user.

Parameters:
  • target (Path)

  • source (Path)

  • parent (QWidget | None)

accept_and_next()[source]

Accept the visible candidate and review the next unresolved item.

Return type:

None

accept_suggestion()[source]

Accept the currently displayed text or sentence candidate.

Return type:

str | None

cleanup_originals()[source]

Let the reader remove originals after verifying the saved output.

Return type:

None

copy_saved
property current: adsfolio.pdf.annotation_merge.AnnotationItem | None[source]

Return the selected source annotation.

eventFilter(watched, event)[source]
Parameters:
Return type:

bool

Waive source hyperlinks together after an explicit user decision.

Parameters:

confirmed (bool | None)

Return type:

int

find_target_text()[source]

Show all target occurrences of the reader’s search text.

Return type:

None

item_state(item)[source]

Return a short status for item.

Parameters:

item (adsfolio.pdf.annotation_merge.AnnotationItem)

Return type:

str

next_unresolved()[source]

Select the next annotation that still needs a placement or waiver.

Return type:

None

originals_trashed
place_area(x0, y0, x1, y1)[source]

Place the selected markup on the target words inside the dragged box.

Parameters:
Return type:

str | None

place_point(x, y)[source]

Place the selected note or shape with its top-left corner at (x, y).

Parameters:
Return type:

str | None

save_copy(output=None)[source]

Write the merged copy to a new path and show an honest summary.

Parameters:

output (pathlib.Path | None)

Return type:

adsfolio.pdf.annotation_merge.MergeReport | None

select_item(row)[source]

Show the selected annotation on the source page and offer a placement.

Parameters:

row (int)

Return type:

None

start_sentence_matching()[source]

Find closest wording locally while the reader continues reviewing.

Return type:

None

staticMetaObject = PySide6.QtCore.QMetaObject("AnnotationMergeDialog" inherits "QDialog": Methods:   #41 type=Signal, signature=copy_saved(QString), parameters=QString   #42 type=Signal, signature=originals_trashed(PyObject), parameters=PyObject )

Show source hyperlinks separately from the annotation review queue.

Return type:

None

undo_decision()[source]

Return the current placement or waiver to the review queue.

Return type:

None

waive_current(confirmed=None)[source]

Exclude the selected annotation after explicit confirmation.

Parameters:

confirmed (bool | None)

Return type:

bool

class adsfolio.gui.annotation_merge.PdfPageView(parent=None)[source]

Bases: PySide6.QtWidgets.QLabel

Render one PDF page and report clicks and drags in PDF points.

Parameters:

parent (QWidget | None)

area_selected
attach_scroll(scroll)[source]

Fit the page to this viewport and follow its size changes.

Parameters:

scroll (PySide6.QtWidgets.QScrollArea)

Return type:

None

eventFilter(watched, event)[source]
Parameters:
Return type:

bool

focus_rect(rect)[source]

Center the selected annotation in its page viewport.

Parameters:

rect (tuple[float, float, float, float])

Return type:

None

mouseMoveEvent(event)[source]
Parameters:

event (PySide6.QtGui.QMouseEvent)

Return type:

None

mousePressEvent(event)[source]
Parameters:

event (PySide6.QtGui.QMouseEvent)

Return type:

None

mouseReleaseEvent(event)[source]
Parameters:

event (PySide6.QtGui.QMouseEvent)

Return type:

None

overlays: list[tuple[tuple[float, float, float, float], PySide6.QtGui.QColor, bool]]
paintEvent(event)[source]
Return type:

None

point_clicked
set_fit_mode(mode)[source]

Display the page at pane width, pane height, or 100 percent.

Parameters:

mode (str)

Return type:

None

set_overlays(overlays)[source]

Set boxes (PDF points, colour, dashed) drawn above the page.

Parameters:

overlays (list[tuple[tuple[float, float, float, float], PySide6.QtGui.QColor, bool]])

Return type:

None

show_page(path, page_number)[source]

Draw a page as displayed (rotation and crop box applied).

Returns the page rectangle in the unrotated coordinates used by annotations and text; overlays and mouse events use those coordinates.

Parameters:
Return type:

tuple[float, float, float, float]

staticMetaObject = PySide6.QtCore.QMetaObject("PdfPageView" inherits "QLabel": Methods:   #42 type=Signal, signature=point_clicked(double,double), parameters=double, double   #43 type=Signal, signature=area_selected(double,double,double,double), parameters=double, double, double, double )