File size: 429 Bytes
240e0a0
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
def get_scale_ratio(model_page_info, page):
    pix = page.get_pixmap(dpi=72)
    pymu_width = int(pix.w)
    pymu_height = int(pix.h)
    width_from_json = model_page_info['page_info']['width']
    height_from_json = model_page_info['page_info']['height']
    horizontal_scale_ratio = width_from_json / pymu_width
    vertical_scale_ratio = height_from_json / pymu_height
    return horizontal_scale_ratio, vertical_scale_ratio