Hi @andnesper,
Check this post explaining how to read PDF files and taking some decision :
~Diego Turati