From 68d1d6805c2a6843e1c4a47d3edb480beb8cb2bb Mon Sep 17 00:00:00 2001 From: Callum Gare Date: Tue, 9 Nov 2021 10:31:23 +0000 Subject: [PATCH] Generate attributes for colour and paper size --- root/root/airprint-generate.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/root/root/airprint-generate.py b/root/root/airprint-generate.py index 9fb5895..146e3f2 100644 --- a/root/root/airprint-generate.py +++ b/root/root/airprint-generate.py @@ -181,6 +181,16 @@ def generate(self): ptype.text = 'printer-type=%s' % (hex(v['printer-type'])) service.append(ptype) + if attrs['color-supported']: + color = Element('txt-record') + color.text = 'Color=T' + service.append(color) + + if attrs['media-default'] == 'iso_a4_210x297mm': + max_paper = Element('txt-record') + max_paper.text = 'PaperMax=legal-A4' + service.append(max_paper) + pdl = Element('txt-record') fmts = [] defer = []