54065add4551a2415af574ad558f7c2d6fbeb9a9,pdftotree/TreeVisualizer.py,,get_pdf_dim,#Any#,86

Before Change




def get_pdf_dim(pdf_file):
    html_content = subprocess.check_output(
        "pdftotext -f {} -l {} -bbox "{}" -".format("1", "1", pdf_file), shell=True
    )
    soup = BeautifulSoup(html_content, "html.parser")
    pages = soup.find_all("page")
    page_width, page_height = (
        int(float(pages[0].get("width"))),
        int(float(pages[0].get("height"))),
    )
    return page_width, page_height

After Change


        doc = PDFDocument(parser)
        // Look at the 1st page only.
        page = next(PDFPage.create_pages(doc))
        _, _, page_width, page_height = page.mediabox
    return page_width, page_height
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: HazyResearch/pdftotree
Commit Name: 54065add4551a2415af574ad558f7c2d6fbeb9a9
Time: 2020-09-24
Author: hiromu.hota@hal.hitachi.com
File Name: pdftotree/TreeVisualizer.py
Class Name:
Method Name: get_pdf_dim


Project Name: NifTK/NiftyNet
Commit Name: 791420737470b786992c7a6bc1663ff503977b3e
Time: 2017-08-18
Author: d.shakir@ucl.ac.uk
File Name: setup.py
Class Name:
Method Name:


Project Name: NifTK/NiftyNet
Commit Name: 895187880fb16d41133942aae7a935698c6f0a8c
Time: 2017-08-18
Author: t.doel@ucl.ac.uk
File Name: niftynet/utilities/get_niftynet_version.py
Class Name:
Method Name: get_niftynet_version