Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why i meet a byte problem #52

Open
jilinsunkun opened this issue Apr 12, 2019 · 7 comments
Open

Why i meet a byte problem #52

jilinsunkun opened this issue Apr 12, 2019 · 7 comments

Comments

@jilinsunkun
Copy link

what do I mean by string

C:\Users\dell\Desktop\水印删除>C:\Users\dell\Desktop\水印删除\pdf-watermark-removal.py
Traceback (most recent call last):
  File "C:\Users\dell\Desktop\水印删除\pdf-watermark-removal.py", line 3, in <module>
    pdf = pdfparanoia.scrub(open("天勤2019数据结构计算机考研复习指导电子版PDF.pdf", "rb"))
  File "D:\ProgramData\Anaconda3\lib\site-packages\pdfparanoia-0.0.16-py3.6.egg\pdfparanoia\core.py", line 53, in scrub
    content = plugin.scrub(content, verbose=verbose)
  File "D:\ProgramData\Anaconda3\lib\site-packages\pdfparanoia-0.0.16-py3.6.egg\pdfparanoia\plugins\aip.py", line 25, in scrub
    pdf = parse_content(content)
  File "D:\ProgramData\Anaconda3\lib\site-packages\pdfparanoia-0.0.16-py3.6.egg\pdfparanoia\parser.py", line 44, in parse_content
    stream = StringIO(content)
TypeError: initial_value must be str or None, not bytes``
@carlcrott
Copy link
Collaborator

Could you provide a link to the file you're parsing?

@jilinsunkun
Copy link
Author

jilinsunkun commented Apr 14, 2019

Could you provide a link to the file you're parsing?

The origin file is too big to upload,So I change a file , and i think it may not change...

Traceback (most recent call last):
File "C:\Users\dell\Desktop\水印删除\pdf-watermark-removal.py", line 3, in
pdf = pdfparanoia.scrub(open("document.pdf", "rb"))
File "D:\ProgramData\Anaconda3\lib\site-packages\pdfparanoia-0.0.16-py3.6.egg\pdfparanoia\core.py", line 53, in scrub
content = plugin.scrub(content, verbose=verbose)
File "D:\ProgramData\Anaconda3\lib\site-packages\pdfparanoia-0.0.16-py3.6.egg\pdfparanoia\plugins\aip.py", line 25, in scrub
pdf = parse_content(content)
File "D:\ProgramData\Anaconda3\lib\site-packages\pdfparanoia-0.0.16-py3.6.egg\pdfparanoia\parser.py", line 44, in parse_content
stream = StringIO(content)
TypeError: initial_value must be str or None, not bytes]

document.pdf

@udayhasan
Copy link

I'm facing a similar issue. Can anyone help?
Or, did any of you found any workaround?

@fanshao
Copy link

fanshao commented Sep 10, 2020

I'm facing a similar issue.

@slarrain
Copy link

Similar issue

@sylph520
Copy link

similar here.

@seanbenhur
Copy link

Oh, similar here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants