Skip to content

Instantly share code, notes, and snippets.

@mybeky
mybeky / merge.py
Created March 21, 2023 07:55
A Python script to merge every two pages of a PDF file into one page
# pip install PyMuPDF
# usage: python merge.py input_file.pdf
import sys
import fitz
def merge_pages(input_file, output_file):
with fitz.open(input_file) as doc: