How to print pdf file in python? thanks | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

How to print pdf file in python? thanks

15th Feb 2017, 11:48 AM
‏‪Mungunkhuyag Zesnee
‏‪Mungunkhuyag Zesnee - avatar
4 Antworten
+ 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
15th Feb 2017, 1:00 PM
Elite
Elite - avatar
+ 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 ^^
15th Feb 2017, 3:20 PM
visph
visph - avatar
0
I'd like to silent print the file.pdf to myself printers
15th Feb 2017, 1:06 PM
‏‪Mungunkhuyag Zesnee
‏‪Mungunkhuyag Zesnee - avatar
- 1
Hello everyone. how to get status of LPT printer port from python 27.
22nd May 2017, 1:11 PM
‏‪Mungunkhuyag Zesnee
‏‪Mungunkhuyag Zesnee - avatar