summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Kamppeter <till.kamppeter@gmail.com>2016-08-09 18:11:29 +0200
committerDidier Raboud <odyx@debian.org>2019-09-02 09:14:43 +0200
commitb0989f1215cb3e800182d1232a3d91f132ddd7dd (patch)
tree1a6a2aaf83403661f3dbbd66f273c310556d5a8c
parente9e9beee5a6b3c36aa9e9507e90ec43a8158e45e (diff)
Patch to support Apple AirPrint (printing from iPhone, iPad, iPod Touch to a CUPS server)
Bug-Ubuntu: https://bugs.launchpad.net/bugs/711779 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1054495 Bug-Debian: http://bugs.debian.org/700961 Bug: https://cups.org/str.php?L4341 Last-Update: 2015-02-10 Patch-Name: airprint-support.patch Gbp-Pq: Name airprint-support.patch
-rw-r--r--conf/mime.convs.in3
-rw-r--r--conf/mime.types3
-rw-r--r--scheduler/conf.c2
-rw-r--r--scheduler/dirsvc.c6
-rw-r--r--scheduler/printers.c4
5 files changed, 16 insertions, 2 deletions
diff --git a/conf/mime.convs.in b/conf/mime.convs.in
index 57b459d73..e042e0129 100644
--- a/conf/mime.convs.in
+++ b/conf/mime.convs.in
@@ -44,6 +44,9 @@ application/postscript application/vnd.cups-postscript 66 pstops
application/vnd.cups-raster image/pwg-raster 100 rastertopwg
application/vnd.cups-raster image/urf 100 rastertopwg
+# Needed for printing from iOS (AirPrint) clients
+image/urf application/pdf 100 -
+
########################################################################
#
# Raw filter...
diff --git a/conf/mime.types b/conf/mime.types
index fcd6b6eff..ebb05257e 100644
--- a/conf/mime.types
+++ b/conf/mime.types
@@ -108,6 +108,9 @@ image/x-alias pix short(8,8) short(8,24)
image/x-bitmap bmp string(0,BM) + !printable(2,14)
image/x-icon ico
+# Needed for printing from iOS (AirPrint) clients
+image/urf urf string(0,UNIRAST<00>)
+
########################################################################
#
# Text files...
diff --git a/scheduler/conf.c b/scheduler/conf.c
index bb6049b2c..bb4f9d215 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -745,7 +745,7 @@ cupsdReadConfiguration(void)
DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED;
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
- cupsdSetString(&DNSSDSubTypes, "_cups,_print");
+ cupsdSetString(&DNSSDSubTypes, "_cups,_print,_universal");
cupsdClearString(&DNSSDHostName);
#endif /* HAVE_DNSSD || HAVE_AVAHI */
diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c
index ddd3701e0..fb2a30526 100644
--- a/scheduler/dirsvc.c
+++ b/scheduler/dirsvc.c
@@ -440,6 +440,12 @@ dnssdBuildTxtRecord(
keyvalue[count ][0] = "pdl";
keyvalue[count++][1] = p->pdl ? p->pdl : "application/postscript";
+ /* iOS 6 does not accept this printer as AirPrint printer if there is
+ no URF txt record or "URF=none", "DM3" is the minimum needed found
+ by try and error */
+ keyvalue[count ][0] = "URF";
+ keyvalue[count++][1] = "DM3";
+
if (get_auth_info_required(p, air_str, sizeof(air_str)))
{
keyvalue[count ][0] = "air";
diff --git a/scheduler/printers.c b/scheduler/printers.c
index 542523760..b366bf588 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -3806,7 +3806,9 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
}
else if (!_cups_strcasecmp(type->super, "image"))
{
- if (!_cups_strcasecmp(type->type, "jpeg"))
+ if (!_cups_strcasecmp(type->type, "urf"))
+ strlcat(pdl, "image/urf,", sizeof(pdl));
+ else if (!_cups_strcasecmp(type->type, "jpeg"))
strlcat(pdl, "image/jpeg,", sizeof(pdl));
else if (!_cups_strcasecmp(type->type, "png"))
strlcat(pdl, "image/png,", sizeof(pdl));