Skip to content

Python-Remove-Watermark requires poppler and Unable to get page count #8

@metapea

Description

@metapea

I tried ben0i0d version i got two errors:

Traceback (most recent call last):
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 581, in pdfinfo_from_path
    proc = Popen(command, env=env, stdout=PIPE, stderr=PIPE)
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1327, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "watermark.py", line 51, in <module>
    imgs = np.array(convert_from_path(args.source))
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 127, in convert_from_path
    page_count = pdfinfo_from_path(
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 607, in pdfinfo_from_path
    raise PDFInfoNotInstalledError(
pdf2image.exceptions.PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH? 

And:

Traceback (most recent call last):
  File "watermark.py", line 51, in <module>
    imgs = np.array(convert_from_path(args.source))
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 127, in convert_from_path
    page_count = pdfinfo_from_path(
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 607, in pdfinfo_from_path
    raise PDFInfoNotInstalledError(
pdf2image.exceptions.PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?
PS D:\code\Python-Remove-Watermark-master> python watermark.py --source  **_(pdf in the same folder as the .py script)_**.pdf --target out
Traceback (most recent call last):
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 602, in pdfinfo_from_path
    raise ValueError
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "watermark.py", line 51, in <module>
    imgs = np.array(convert_from_path(args.source))
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 127, in convert_from_path
    page_count = pdfinfo_from_path(
  File "C:\Users\X\AppData\Local\Programs\Python\Python38\lib\site-packages\pdf2image\pdf2image.py", line 611, in pdfinfo_from_path
    raise PDFPageCountError(
pdf2image.exceptions.PDFPageCountError: Unable to get page count.

The last error is in this version of Python-Remove-Watermark as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions