Python Prompts Free Prompt

Python Script to Merge Multiple PDFs

Create a Python script to merge multiple PDF files into one
☆ Save
Prompt
You are a Python developer. Write a script that merges all PDF files in a folder into a single PDF using PyPDF2 or pypdf. The script must: 1) Accept input folder and output filename, 2) Merge in alphabetical order or based on a list file, 3) Add bookmarks (outlines) based on filenames, 4) Handle password-protected PDFs, 5) Provide an option to split by page ranges, 6) Log progress. Add error handling and comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.