Initial commit — Copydev Imposing Tool

Outil d'imposition PDF desktop (PyQt6) remplacant Quite Imposing Plus.
9 fonctions : livret, n-up, step & repeat, imposition manuelle,
jointure pages, pages blanches, numerotation, masquage, fonds perdus.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jules
2026-03-20 10:54:02 +01:00
commit e3dfd90933
30 changed files with 2364 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
"""Dialogue Repetition (Step & Repeat)."""
from PyQt6.QtWidgets import (QDialog, QVBoxLayout, QHBoxLayout, QLabel,
QComboBox, QGroupBox, QSpinBox, QCheckBox,
QDialogButtonBox, QDoubleSpinBox)
from app.engine.pdf_utils import PAGE_SIZES, mm_to_pt
class StepRepeatDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("Repetition (Step & Repeat)")
self.setMinimumWidth(400)
self._setup_ui()
def _setup_ui(self):
layout = QVBoxLayout(self)
# Taille feuille
grp_sheet = QGroupBox("Taille de la feuille")
sl = QHBoxLayout(grp_sheet)
sl.addWidget(QLabel("Format :"))
self.combo_sheet = QComboBox()
for name in PAGE_SIZES:
self.combo_sheet.addItem(name)
self.combo_sheet.setCurrentText("A3 Paysage")
sl.addWidget(self.combo_sheet)
layout.addWidget(grp_sheet)
# Nombre de copies
grp_copies = QGroupBox("Nombre de copies")
cl = QVBoxLayout(grp_copies)
self.chk_auto = QCheckBox("Automatique (remplir la feuille)")
self.chk_auto.setChecked(True)
cl.addWidget(self.chk_auto)
manual = QHBoxLayout()
manual.addWidget(QLabel("Horizontal :"))
self.spin_h = QSpinBox()
self.spin_h.setRange(1, 20)
self.spin_h.setValue(2)
self.spin_h.setEnabled(False)
manual.addWidget(self.spin_h)
manual.addWidget(QLabel("Vertical :"))
self.spin_v = QSpinBox()
self.spin_v.setRange(1, 20)
self.spin_v.setValue(2)
self.spin_v.setEnabled(False)
manual.addWidget(self.spin_v)
cl.addLayout(manual)
layout.addWidget(grp_copies)
self.chk_auto.toggled.connect(lambda checked: self.spin_h.setEnabled(not checked))
self.chk_auto.toggled.connect(lambda checked: self.spin_v.setEnabled(not checked))
# Espacement
grp_spacing = QGroupBox("Espacement (mm)")
spl = QHBoxLayout(grp_spacing)
spl.addWidget(QLabel("Horizontal :"))
self.spin_sp_h = QDoubleSpinBox()
self.spin_sp_h.setRange(0, 50)
self.spin_sp_h.setValue(0)
self.spin_sp_h.setSuffix(" mm")
spl.addWidget(self.spin_sp_h)
spl.addWidget(QLabel("Vertical :"))
self.spin_sp_v = QDoubleSpinBox()
self.spin_sp_v.setRange(0, 50)
self.spin_sp_v.setValue(0)
self.spin_sp_v.setSuffix(" mm")
spl.addWidget(self.spin_sp_v)
layout.addWidget(grp_spacing)
# Options
self.chk_crop = QCheckBox("Reperes de coupe")
layout.addWidget(self.chk_crop)
# Boutons
buttons = QDialogButtonBox(
QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel
)
buttons.accepted.connect(self.accept)
buttons.rejected.connect(self.reject)
layout.addWidget(buttons)
def get_settings(self):
sheet_text = self.combo_sheet.currentText()
sheet_size = PAGE_SIZES[sheet_text]
return {
"sheet_size": sheet_size,
"copies_h": None if self.chk_auto.isChecked() else self.spin_h.value(),
"copies_v": None if self.chk_auto.isChecked() else self.spin_v.value(),
"spacing_h": mm_to_pt(self.spin_sp_h.value()),
"spacing_v": mm_to_pt(self.spin_sp_v.value()),
"crop_marks": self.chk_crop.isChecked(),
}