# Read PDF Reports and Extract Data

**URL:** <https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286>\
**Category:** Ignition\
**Created:** [April 28, 2020, 9:41pm UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286 "2020-04-28T21:41:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimE](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@TimE](https://forum.inductiveautomation.com/u/TimE)\
**Post date:** [April 28, 2020, 9:41pm UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286/1 "2020-04-28T21:41:08Z")

</div>

Over the years we have created hundreds of PDF reports. We now want to extract the data from these reports and put into a database. I know there are external programs that can do this but if possible I would like to integrate this into my project. Is this wishful thinking?

Thanks,  
Tim

---

<div class="post-metadata">

**Author:** ![Niken\_Panchal](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@Niken\_Panchal](https://forum.inductiveautomation.com/u/Niken_Panchal)\
**Post date:** [October 21, 2022, 9:20am UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286/2 "2022-10-21T09:20:13Z")

</div>

I am also looking something similar to upload the values in pdf file table column and write it to tag. Please acquaint with either scripting or method to execute this application

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 21, 2022, 12:27pm UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286/3 "2022-10-21T12:27:50Z")

</div>

I don't have an answer for you, and I suspect there's not an easy one. Tim didn't get an answer in the past 2½ years. A web search for "java pdf parsers" might get you started, but expect to implement a custom parser for every possible page layout you have in your PDFs.

Or abandon this idea, and go to the data source that _ **produced** _ your PDFs.

---

<div class="post-metadata">

**Author:** ![Niken\_Panchal](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@Niken\_Panchal](https://forum.inductiveautomation.com/u/Niken_Panchal)\
**Post date:** [October 24, 2022, 7:34am UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286/4 "2022-10-24T07:34:40Z")

</div>

Thanks for getting back to me. I am planning to use third party parser like PyPDF2 Library to extract. I hope it works and will post once succeed.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 24, 2022, 12:01pm UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286/5 "2022-10-24T12:01:36Z")

</div>

Be prepared for trouble. From my experience creating PDFs with PHP libraries, the file data order does not have to match the layout order. In other words, the PDF file could start by specifying the footer and header, followed by a table, followed by the heading above it, etc. It all depends on how the rendering engine was programmed. Don't expect to be able to read from top to bottom and left to right. If the layout is fairly simple you may be able to get it to work.

---

<div class="post-metadata">

**Author:** ![Niken\_Panchal](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@Niken\_Panchal](https://forum.inductiveautomation.com/u/Niken_Panchal)\
**Post date:** [November 7, 2022, 11:00am UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286/6 "2022-11-07T11:00:52Z")

</div>

I installed PyPDF2 into Ignition Pylib folder, installation is fairly easy to do. When I import PyPDF2 function into script, the first error was Non-ASCII character in source file and then got it fixed using PEP header line. But I couldn't find solution for second error stating 'Expecting RPAREN ':' Syntax Error', which I think probably needs to rewrite few lines of source code. I abandon PyPDF2 library and working on to use Apache PDFBox Jar file. I'm looking for installing .jar files into Ignition.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 15, 2022, 4:39pm UTC](https://forum.inductiveautomation.com/t/read-pdf-reports-and-extract-data/34286/7 "2022-11-15T16:39:19Z")

</div>

If you just want to load an arbitrary .jar file, you can use either approach here:

> [@YAML payload parsing](https://forum.inductiveautomation.com/t/yaml-payload-parsing/49103/2):
>
> The ‘right’ way to do it would be to create a custom module that brought a Java YAML parser into scope - it looks like the two main candidates are Jackson or ‘snakeyaml’. The ‘easy’ way to do it would be to use the ‘hack’ described here: If you drop the snakeyaml .jar file in the right location, the gateway will automatically load it to the classpath on the next restart, which will then make it available from scripting.
