简体   繁体   中英

Read pdf file from downloads directory with python using pdfrw library

I want to manipulate pdf file using PDFRW library, so when I try to get the source of the pdf file I can't get the file and read it so please help.

  from pdfrw import pdfreader
  import os
  import pathlib

  pdf_file = pdfreader('C:\\Users/4488\\Downloads\\Life-of-Muhammad.pdf')


  print(pdf_file.Keys())


        this is the error that I am getting

        Traceback (most recent call last):
        File "c:\Users\4488\desktop\Xhamar-Project\xhamar.py", line 8, in 
        <module>
        get_file = pdfreader(pdf_file)
        TypeError: 'module' object is not callable

I know... I'm a bit late, but in case you didn't figured it out:

Try to use pdfrw.PdfReader() instead of pdfrw.pdfreader()

Have a nice day

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM