+ 1
How to print pdf file in python? thanks
4 Answers
+ 2
file = open("newfile.pdf", "w")
file.write("This has been written to a file")
file.close()
file = open("newfile.pdf", "r")
print(file.read())
file.close()
try this
let me know if it works
+ 2
'Pdf' files format is a binary format, not a text format. To open if for read/write operations you need to open it in the binary mode, and know how encoding is done to manage it by yourself: let say that without library to handle / bind operations of read/write ^^
0
I'd like to silent print the file.pdf to myself printers
- 1
Hello everyone. how to get status of LPT printer port from python 27.