finding on which page a search string is located in a pdf document using python

前端 未结 3 1510
旧巷少年郎
旧巷少年郎 2020-12-15 12:36

Which python packages can I use to find out out on which page a specific “search string” is located ?

I looked into several python pdf packages but couldn\'t figur

3条回答
  •  悲&欢浪女
    2020-12-15 13:09

    In addition to what @user1043144 mentioned,

    To use with python 3.x

    Use PyPDF2

    import PyPDF2
    

    Use open instead of file

    PdfFileReader(open(xFile, 'rb'))
    

提交回复
热议问题