Data extraction from a PDF
PDF is a rich (in terms of containing document features and formatting) document format that can be created, shared, and accessed on any supporting device. It is not an understatement to state that PDF files are everywhere, supported by all kinds of electronic devices and systems. It is also quite useful to know that Word documents, PowerPoint presentations, HTML, Jupyter notebooks, analysis reports from various applications, and many more content types support exporting and saving files as PDF.
We often find various types of data (such as textual, tabular, and images) in a PDF file. In Chapters 3 and 4, we saw how to extract web-based content using Python. Here, we will be using the PyPDF2
Python library to extract data from PDF files.
In the next sections, we will install and explore PyPDF2
from a data extraction perspective.
The PyPDF2 library
PyPDF2
(https://pypdf2.readthedocs.io/en/3.0.0/index.html) is a free, open source (https://github...