![]() ![]() Go ahead and download the file to follow the tutorial, or you can simply use any PDF file you like. The sample file we will be working with in this tutorial is sample.pdf. Great! You now have PyPDF2 installed, and you're ready to start playing with PDF documents. PyPDF2 now can be simply installed by typing the following command (in Mac OS X's Terminal): You can follow the steps mentioned in the Python Packaging User Guide for installing pip, but if you have Python 2.7.9 and higher, or Python 3.4 and higher, you already have pip! Many packages can be found in the Python Package Index (PyPI). For that, we will be using pip, which is (based on Wikipedia): A package management system used to install and manage software packages written in Python. As it is an external module, the first normal step we have to take is to install that module. The module we will be using in this tutorial is PyPDF2. PyPDF2Īs we mentioned above, using an external module would be the key. ![]() ![]() That doesn't mean that it is hard to work with PDF documents using Python, it is rather simple, and using an external module solves the issue. PDF documents are binary files and more complex than just plaintext files, especially since they contain different font types, colors, etc. We are mainly talking about Python here, aren't we? And we are interested in tying that to working with PDF documents. Well, you may say that's so simple, especially if you have used Python with text files (txt) before. I remember the days when such files solved any formatting issues while exchanging files due to some differences in Word versions, or for other reasons. I really admire Portable Document Format (PDF) files. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |