2

I'm trying to print-to-pdf an image(e.g. Raspberry-Pi-Logo.png) using cups. I set everything fine and can make my pdf file using command from terminal (its requesting an id of the pdf file and i have found the file in the directory) .

sudo lp Raspberry-Pi-Logo.png

But when i'm trying to do that using python, its not working properly. Its requesting an id like before but no output file in the directory.

#!/usr/bin/python

import os
os.chdir("/home/pi/pdf")
os.system("sudo lp Raspberry-Pi-Logo.png")
syed zayed
  • 21
  • 4

0 Answers0