0

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
  • Please make your question clearer, what errors do you get? What is the expected result? What have you tried already? – incarnadine Sep 07 '20 at 16:41
  • Also, whilst I don't believe it actually makes a difference, it is best to be consistent with whether you use `/` or `\ ` in your filepaths. For backwards compatibility reasons on windows, I would recommend `\ ` (`\\ `). – incarnadine Sep 07 '20 at 16:42

1 Answers1

1

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

anom
  • 11
  • 1