pankajr141 / pdf2jpg

Utility to convert PDF into JPG files
51 stars 21 forks source link

get an error on centos7 #3

Closed HazyGuo closed 5 years ago

HazyGuo commented 5 years ago

I use this module on centos 7, but get an error that "expected str, bytes or os.PathLike object, not int", what can I do to run it on centos 7?

HazyGuo commented 5 years ago

My code like this: t_start = time.time() pdf2jpg.convert_pdf2jpg(pdffile, output, dpi=300, pages="ALL") t_stop = time.time() print("cost: {}".format(t_stop - t_start))

pankajr141 commented 5 years ago

Can you post the value of

  1. pdffile
  2. output
manishdash12 commented 5 years ago

I am also getting the same error. I am on Ubuntu 16.04.5.

I tried the running the .jar file directly and it is working as expected. Maybe some error in the python bindings?

HazyGuo commented 5 years ago

I resolve it by change dpi=300 to dpi="300", it works for me.

pankajr141 commented 5 years ago

yes looks like its due to this line

    cmd = 'java -jar %s -i "%s" -o "%s" -d %s -p %s' % (jarPath, inputpath, outputpath, dpi, pages)    

here dpi being converted into %s which might be throwing error.

pankajr141 commented 5 years ago

Closing as updated a recent patch