RUB-NDS / PRET

Printer Exploitation Toolkit - The tool that made dumpster diving obsolete.
http://hacking-printers.net
GNU General Public License v2.0
3.8k stars 605 forks source link

can only concatenate str (not "bytes") to str while using the print function #69

Open aleperuz opened 1 year ago

aleperuz commented 1 year ago

When i try to print a photo with pret the program crush with error. can only concatenate str (not "bytes") to str i modified the program to make sure that the given variable is a string. self.send(c.UEL + str(data) + c.UEL) If I print simple text it prints without errors. So I understood that with pret you can only print text, even if I don't understand why since there is the variable that converts pdf and images into files that the printer understands. Hope this problem is solved.

deFr0ggy commented 1 year ago

Hey @aleperuz,

I tried the same, although i am getting the following.

image

Fixed the line as below.

image

How had you fixed this?

aleperuz commented 1 year ago

@deFr0ggy yes use python 2 and add the fixes from another issue

aleperuz commented 1 year ago

@deFr0ggy

Try this one:

edit the script that will send commands in the language of your printer (pjl.py, pcl.py or postscript.py) Add this: import sys reload(sys) sys.setdefaultencoding('iso-8859-1')

deFr0ggy commented 1 year ago

Thanks @aleperuz , just got it to resolve this, it's printing the data from "*.ps" file provided now!

deFr0ggy commented 1 year ago

it the script that will send commands in the language of your printer (pjl.py, pcl.py or postscript.py) Add this: import sys reload(sys) sys.setdefaultencoding('iso-8859-1')

Makes sense! Thanks!

muhammedakinci0 commented 1 month ago

@aleperuz can you help me on discord? discord:defacermaster

muhammedakinci0 commented 1 month ago

@deFr0ggy help me on discord please discord:defacermaster