Skip to content

Console programm to merge two ore more PDFs into one PDF

Notifications You must be signed in to change notification settings

WhatGravity/PDFMerger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDFMerger

Methode to merge pdfs

def merge_pdfs(result_name):
    pdf_writer = PdfFileWriter()
    root = tkinter.Tk()
    files = filedialog.askopenfilenames(parent=root, title='PDFs auswählen!')
    for file in root.tk.splitlist(files):
        pdf_reader = PdfFileReader(file)
        for page in range(pdf_reader.getNumPages()):
            pdf_writer.addPage(pdf_reader.getPage(page))
    print("PDFs zusammengefügt.")
    with open(result_name, 'wb') as out:
        pdf_writer.write(out)
        print("PDF-Datei erfolgreich erstellt.")
merge_pdfs('merged.pdf')

About

Console programm to merge two ore more PDFs into one PDF

Topics

Resources

Stars

Watchers

Forks

Languages