Trying to find certain things in text can be done quite easily if you have the real text, and not a scanned document that is a PDF or even an image. This is actually quite a big topic and can become quite difficult.
If you have pure text, you can parse out parts you need using custom regular expressions, e.g. to find a date, you might use this:
^(19|20)\d\d[- /.](0[1-9]|1)[- /.](0[1-9]|[0-9]|3)$
matches a date in yyyy-mm-dd format from 1900-01-01 through 2099-12-31, with a choice of four separators (source).
I believe there are even a few libraries that specifically find dates for you within text.
There are actually many types of PDF, i.e. there are many ways a pdf can be encoded behind the scenes. Some types are easier to parse that others, but luckily there are libraries that can help with that. For example, check out PDFMiner.
After using such a library, you will hopefully be left with the pure text, and can maybe go back to using methods from that section.
If you are unlucky enough to have an image as a starting point, then you are now in the realms of OCR - Optical Character Recognition. I would recommend reading this blog post for a more complete description of possible methods,but in a nutshell, you can try using either:
- a traditional algorithm from compute vision (applying filters and looking for edges etc.)
- a trained model specialised for text (e.g. EAST: an Efficient and Accurate Scene Text Detector)
- a general model
A nice model to help out with OCR is the Tesseract library.
You said you are learning NLP, so actually extracting tokens from a PDF might not be the best example with which to start. I would recommend first deciding exactly what you really want to learn and follow a course or a tutorial on that topic.area.