Erste lauffähige Version
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from pathlib import Path
|
||||
|
||||
from pypdf import PdfWriter
|
||||
|
||||
|
||||
def merge_pdfs(pdfs: list[Path], out_path: Path) -> Path:
|
||||
writer = PdfWriter()
|
||||
for pdf in pdfs:
|
||||
writer.append(str(pdf))
|
||||
out_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with out_path.open("wb") as f:
|
||||
writer.write(f)
|
||||
writer.close()
|
||||
return out_path
|
||||
Reference in New Issue
Block a user