I have some .pdf files with more than 500 pages, but I need only a few pages in each file. It is necessary to preserve document`s title pages. I know exactly the numbers of the pages that program should remove. How I can do it using Python 2.7 Environment, which is installed upon MS Visual Studio?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Use pyPDF2:
https://github.com/mstamy2/PyPDF2
Documentation is at:
https://pythonhosted.org/PyPDF2/
It seems pretty intuitive.
Try using PyPDF2.
Instead of deleting pages, create a new document and add all pages which you don't want to delete.
Some sample code (originally adapted from BinPress which is dead, archived here).
or