Environment Requirements
-
#Python 3.6+
-
#Install the
<span>PyPDF2</span>
library
Step 1: Install the Dependency Library
Open the terminal or command prompt and run the following command to install <span>PyPDF2</span>
:
Step 2: Prepare the Python Script
Copy the following code and save it as <span>deepseek</span><span>_</span><span>_python_20250422_pdf.py</span>
:
Step 3: Modify the Input Path
-
Set the path in the script to: the actual path of your PDF file.
Please open in the WeChat client
Step 4: Run the Script
Execute the following command in the terminal:
deepseek<span>_</span><span>_python_20250422_pdf.py</span>
Step 5: Check the Results
After the script runs:
-
A folder named “Processed Files” will be automatically generated in the current path.
-
Open this folder to see the split single-page PDF files (naming format: Page 1…).
Here is a demonstration of the operation results:
Notes
-
1. Ensure that the input PDF file is not encrypted.
-
2. If you encounter a path error, please check the direction of the slashes in the path (use
<span>/</span>
or<span>\</span>
for Windows). -
3. If you need to process multiple PDFs in batch, you can modify the script logic to add a loop.