Como converter o arquivo pdf em formato JSON no Python

#PDF to JSON using Python 3+ 
 
# package to install  
# pip install Fitz  
# pip install pymupdf  
 
import fitz  
import json  
 
document  = fitz.open('filename.pdf') 
page  = document.loadPage(14)#enter page 
text = page.getText('dict')  
#print(text) 
 
with open('data.json', 'w') as f: 
    text_data = json.dump(text, f)
Stupid Shrike