I am trying to Print to USB HP printer through python. I was successfull in printing a text file using Ctrl-P command through gui after setting up CUPS using the WEB method.
Now I am trying to print using python-cups library and this python script,
conn=cups.Connection()
printers=conn.getPrinter()
printer_name=printers.keys()[0]
conn.printFile(printer_name,filename,"print test",{}) .
but I get error
cups.IPPError: (1042,'client-error-document-access-error')
What can I do to fix this?
After fixing the print problem I am now stuck at the print formatting . IT does not printas can viewed in the text file and prints everything on the same line and overlaps the next line data on the same line . cant file any docs in CUPS to determine , print formats such as A4 size , or landscapes .
filename
variable contains something wrong.