Skip to content
Browse files

Force HP printers to print in colour

  • Loading branch information
simoncadman committed Aug 4, 2012
1 parent 759181a commit 95b6b39414578d4bd63224c17d5625cf4ab452bd
Showing with 15 additions and 5 deletions.
  1. +15 −5
@@ -67,6 +67,13 @@ def GetPrinter(printer, tokens, proxy=None):
return None

def GetPrinterDetails(printerid, tokens, proxy=None):
printer_id = None
response = Auth.GetUrl('%s/printer?printerid=%s' % (Printer.CLOUDPRINT_URL, printerid), tokens)
return response

def ReadFile(pathname):
"""Read contents of a file and return content.
@@ -201,11 +208,14 @@ def SubmitJob(printerid, jobtype, jobsrc, jobname, tokens):
'jpeg': 'image/jpeg',
'png': 'image/png',
headers = [('printerid', printerid),
('title', title),
('content', content[jobtype]),
('contentType', content_type[jobtype])]
files = [('capabilities', 'capabilities', '{"capabilities":[]}')]
headers = [
('printerid', printerid),
('title', title),
('content', content[jobtype]),
('contentType', content_type[jobtype]),
('capabilities', '{"capabilities":[{"name":"ns1:Colors","type":"Feature","options":[{"name":"Color"}]}]}')
files = []
if jobtype in ['pdf', 'jpeg', 'png']:
edata = Printer.EncodeMultiPart(headers, files, file_type=content_type[jobtype])

0 comments on commit 95b6b39

Please sign in to comment.
You can’t perform that action at this time.