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,104 @@
"""Dialogue Creer un livret."""
from PyQt6.QtWidgets import (QDialog, QVBoxLayout, QHBoxLayout, QLabel,
QComboBox, QGroupBox, QRadioButton, QSpinBox,
QDialogButtonBox, QDoubleSpinBox)
from app.engine.pdf_utils import PAGE_SIZES
class BookletDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("Creer un livret")
self.setMinimumWidth(400)
self._setup_ui()
def _setup_ui(self):
layout = QVBoxLayout(self)
# Type de reliure
grp_binding = QGroupBox("Type de reliure")
bl = QVBoxLayout(grp_binding)
self.rb_saddle = QRadioButton("Piqure a cheval (livret agrafe)")
self.rb_saddle.setChecked(True)
self.rb_perfect = QRadioButton("Dos carre colle (livre)")
self.rb_continuous = QRadioButton("Continu (pages sequentielles)")
self.rb_cut_stacks = QRadioButton("Cut stacks (couper et empiler)")
bl.addWidget(self.rb_saddle)
bl.addWidget(self.rb_perfect)
bl.addWidget(self.rb_continuous)
bl.addWidget(self.rb_cut_stacks)
layout.addWidget(grp_binding)
# Taille signature (perfect bound)
sig_layout = QHBoxLayout()
sig_layout.addWidget(QLabel("Pages par cahier :"))
self.spin_signature = QSpinBox()
self.spin_signature.setRange(4, 128)
self.spin_signature.setValue(32)
self.spin_signature.setSingleStep(4)
self.spin_signature.setEnabled(False)
sig_layout.addWidget(self.spin_signature)
sig_layout.addStretch()
layout.addLayout(sig_layout)
self.rb_perfect.toggled.connect(self.spin_signature.setEnabled)
# Taille de feuille
grp_sheet = QGroupBox("Taille de la feuille")
sl = QHBoxLayout(grp_sheet)
sl.addWidget(QLabel("Format :"))
self.combo_sheet = QComboBox()
self.combo_sheet.addItem("Automatique (2x page)")
for name in PAGE_SIZES:
self.combo_sheet.addItem(name)
sl.addWidget(self.combo_sheet)
layout.addWidget(grp_sheet)
# Alignement
grp_align = QGroupBox("Alignement")
al = QVBoxLayout(grp_align)
self.rb_center = QRadioButton("Centrer")
self.rb_center.setChecked(True)
self.rb_pull = QRadioButton("Vers le dos (centre)")
self.rb_bl = QRadioButton("Bas-gauche")
al.addWidget(self.rb_center)
al.addWidget(self.rb_pull)
al.addWidget(self.rb_bl)
layout.addWidget(grp_align)
# Boutons OK/Annuler
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):
"""Retourner les parametres selectionnes."""
if self.rb_saddle.isChecked():
binding = "saddle_stitch"
elif self.rb_perfect.isChecked():
binding = "perfect_bound"
elif self.rb_continuous.isChecked():
binding = "continuous"
else:
binding = "cut_stacks"
sheet_text = self.combo_sheet.currentText()
sheet_size = PAGE_SIZES.get(sheet_text, None)
if self.rb_center.isChecked():
alignment = "center"
elif self.rb_pull.isChecked():
alignment = "pull_center"
else:
alignment = "bottom_left"
return {
"binding": binding,
"sheet_size": sheet_size,
"signature_size": self.spin_signature.value(),
"alignment": alignment,
}