Belval / pdf2image

A python module that wraps the pdftoppm utility to convert PDF to PIL Image object
MIT License
1.51k stars 187 forks source link

pdf2image Increased text and border spacing #236

Closed edgeTurbo closed 1 year ago

edgeTurbo commented 1 year ago

Increased text and border spacing the code:

pages = convert_from_path(inpath, 500, size=(1300, 1500))
    pagecount = 1
    for page in pages:
        outputname = '%s/%s.png' % (imgsdir, pagecount)
        m_ls.append(outputname)
        page.save(outputname, 'PNG')
        pagecount += 1

the result: 75961657190068_ pic

edgeTurbo commented 1 year ago

test2.pdf.zip the pdf demo ,thanks

edgeTurbo commented 1 year ago
image
Belval commented 1 year ago

This issue is caused by the mediabox not being the same as the cropbox. If you always want to use the cropbox you can add use_cropbox=True to your function call.

Without: without

With:

with