Find PDF Dimensions with Camelot

Viewed 2402

I am using Camelot to read complete PDFs and extract about 112 attributes from each one.

I use table areas to extract the attributes

 test_variable = camelot.read_pdf(filename, flavor='stream', 
                 table_areas=['38, 340 ,50, 328']) 

The issue is the table area is not constant for the same attribute across all documents. Sometimes I would find the same attribute a few pixels down in x or y-coordinates i another document.

 test_variable = camelot.read_pdf(filename, flavor='stream', 
                 table_areas=['38,350,50,338']) 

Is there a way to get the exact attribute from the same area regardless of extraction of any document?

2 Answers

Camelot uses opencv's coordinate system, and the dimensions can be obtained using opencv's .shape

See source code for camelot image processing here and opencv's documentation here

Related