I want to divide PDFs into specified pages and save them with the specified name.

Asked 1 years ago, Updated 1 years ago, 302 views

The PDF is 62 pages in total.
For this PDF, we have created a dictionary similar to the following:The contents are the name and the number of pages to save.

pdf_dic={
    'tokyocaffe': 3,
    'yokohamabook': 10,
    'saitamahouse': 5,
    'tokyoshline': 19,
    'aichicoffee': 7,
    'Fukuokfood': 9,
    'tokyobook': 3,
    'kyotocaffe': 2,
    'shigafood': 3,
    'tokyogoods' : 1
}

I would like to create PDFs in order such as pages 1-3 and pages 4-13 as yokohamabook.pdf.

I can split each page using PyPDF2, but I don't know how to handle the contents of the dictionary.
If you understand, please let me know.

python pdf

2022-12-30 22:36

1 Answers

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.