I am doing OCR on Raw PDF file where in i am converting into png images and doing OCR on that. My objective is to extract coordinates for a certain keyword from png and showcase those coordinates on actual raw pdf.
I have already tried showing those coordinates on png images using opencv but i am not able to showcase those coordinates on actual raw pdf since the coordinate system of both format are different. Can anyone please helpme on how to showcase bounding box on actual raw pdf based on the coordinates generated from png images.
All you need to do is map the coordinates of the OCR token (which would be given for the image) to that of the pdf page. 
For instance, 
image_dimensions = [1800, 2400] # width, height
pdf_page_dimension = [595, 841] # these are coordinates of the specific page of the pdf
Assuming, on OCRing the image, a word has coordinates  = [400, 700, 450, 720] , the same can be rendered on the pdf by multiplying them with scale on each axis
x_scale = pdf_page_dimension[0] / image_dimensions[0]
y_scale = pdf_page_dimension[1] / image_dimensions[1]
scaled_coordinates = [400*x_scale, 700*y_scale, 450*x_scale, 720*y_scale]
Pdf page dimensions can be obtained from any of the packages: poppler, pdfparser, pdfminer, pdfplumber
Showing text coordinate from png on raw .pdf file