This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from pypdf import PdfWriter | |
from pypdf.generic._data_structures import StreamObject | |
books_directory = Path("books") | |
export_directory = Path("export") | |
for input_filepath in books_directory.glob("*.pdf"): | |
output_filepath = export_directory / input_filepath.name | |
print("=====", output_filepath, "=====") |