# Extracting text/info from a PDF file

**URL:** <https://forum.cmascenter.org/t/extracting-text-info-from-a-pdf-file/2937>\
**Category:** PYTHON\
**Tags:** python, pdf\
**Created:** [December 30, 2021, 1:22pm UTC](https://forum.cmascenter.org/t/extracting-text-info-from-a-pdf-file/2937 "2021-12-30T13:22:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bukim1](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@bukim1](https://forum.cmascenter.org/u/bukim1)\
**Post date:** [December 30, 2021, 1:22pm UTC](https://forum.cmascenter.org/t/extracting-text-info-from-a-pdf-file/2937/1 "2021-12-30T13:22:34Z")

</div>

This code reads a PDF file (see an example pdf input file below and the instruction) and parse texts to produce a list of monitor locations in a csv file.  
[eanet\_site\_info\_pdf\_reader.py](https://forum.cmascenter.org/uploads/short-url/aDAhDg0o0uYfwzpK8XC0E0fCg1o.py) (3.5 KB)  
Note that pdfminder.six should be installed:

> **[GitHub - pdfminer/pdfminer.six: Community maintained fork of pdfminer - we...](https://github.com/pdfminer/pdfminer.six)**
>
> Community maintained fork of pdfminer - we fathom PDF - GitHub - pdfminer/pdfminer.six: Community maintained fork of pdfminer - we fathom PDF

EXAMPLE INPUT FILE  
**NOTE: You will have to change the file extension from “csv” to “pdf” before running the code!!!**  
[all.csv](https://forum.cmascenter.org/uploads/short-url/1OIYHVY7UBobsse3IDlWMgvntf8.csv) (2.6 MB)

EXAMPLE OUTPUT FILE  
[eanet\_mon\_list.csv](https://forum.cmascenter.org/uploads/short-url/lZ3JCIm7B6QZPsF4bA0DQ0njjz5.csv) (2.0 KB)
