Go to file
15549494042 5daea20eb4 modify install script -Signed-off-by dongzhengkuan@huawei.com
Signed-off-by: 15549494042 <dongzhengkuan@huawei.com>
2023-10-21 11:02:56 +08:00
backport-Also-fix-cupsfilter.patch fix master failed 2022-06-15 17:23:07 +08:00
backport-CVE-2022-26691.patch fix CVE-2022-26691 2022-06-10 16:56:36 +08:00
backport-CVE-2023-4504.patch fix CVE-2023-4504 Signed-off-by:caizihua1@huawei.com 2023-09-26 21:54:57 +08:00
backport-CVE-2023-32324.patch fix CVE-2023-32324 2023-06-05 16:22:29 +08:00
backport-CVE-2023-34241.patch fix CVE-2023-34241 2023-06-28 14:32:26 +08:00
backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch fix master failed 2022-06-15 17:23:07 +08:00
BUILD.gn modify install script -Signed-off-by dongzhengkuan@huawei.com 2023-10-21 11:02:56 +08:00
bundle.json Adaptable printer driver Singed-off-by:dongzhengkuan@huawei.com 2023-09-01 10:07:10 +08:00
config.h Adaptable printer driver Singed-off-by:dongzhengkuan@huawei.com 2023-09-06 10:51:11 +08:00
cups-2.4.0-source.tar.gz upgrade to cups-2.4.0 2021-12-09 20:24:57 +08:00
cups-banners.patch Package init 2019-09-30 10:36:23 -04:00
cups-direct-usb.patch Package init 2019-09-30 10:36:23 -04:00
cups-driverd-timeout.patch version update 2020-07-27 18:06:26 +08:00
cups-freebind.patch Package init 2019-09-30 10:36:23 -04:00
cups-ipp-multifile.patch Package init 2019-09-30 10:36:23 -04:00
cups-multilib.patch version update 2020-07-27 18:06:26 +08:00
cups-system-auth.patch Package init 2019-09-30 10:36:23 -04:00
cups-uri-compat.patch version update 2020-07-27 18:06:26 +08:00
cups-usb-paperout.patch Package init 2019-09-30 10:36:23 -04:00
cups-web-devices-timeout.patch version update 2020-07-27 18:06:26 +08:00
cups.gni modify install script -Signed-off-by dongzhengkuan@huawei.com 2023-10-20 17:00:22 +08:00
cups.spec add license header Signed-off-by:dongzhengkuan@huawei.com 2023-08-17 17:07:32 +08:00
cups.yaml add license header Signed-off-by:dongzhengkuan@huawei.com 2023-08-17 17:07:32 +08:00
cupsprinter.png Package init 2019-09-30 10:36:23 -04:00
fix-httpAddrGetList-test-case-fail.patch fix build error 2023-06-09 06:55:30 +00:00
generate_mime_convs.py update readme Signed-off-by:dongzhengkuan@huawei.com 2023-07-19 09:32:44 +08:00
install.py modify install script -Signed-off-by dongzhengkuan@huawei.com 2023-10-20 17:00:22 +08:00
LICENSE 增加readme和license文件 Signed-off-by:dongzhengkuan@huawei.com 2023-07-06 11:45:25 +08:00
OAT.xml update OAT.xml. 2023-07-25 13:48:22 +00:00
ohos-add-openssl.patch add tls protocol Signed-off-by:dongzhengkuan@huawei.com 2023-08-14 15:57:28 +08:00
ohos-modify-pthread.patch add tls protocol Signed-off-by:dongzhengkuan@huawei.com 2023-08-14 15:57:28 +08:00
ohos-multi-file-print.patch add tls protocol Signed-off-by:dongzhengkuan@huawei.com 2023-08-14 15:57:28 +08:00
README_zh.md modified oat.xml Signed-off-by:dongzhengkuan@huawei.com 2023-07-25 21:00:36 +08:00
README.md 修改readme Signed-off-by:dongzhengkuan@huawei.com 2023-07-20 09:55:22 +08:00
README.OpenSource update README.OpenSource. 2023-07-25 13:03:16 +00:00

CUPS

Introduction

OpenPrinting CUPS is the most current version of CUPS, a standards-based, open source printing system for Linux® and other Unix®-like operating systems. CUPS supports printing to:

  • AirPrint™ and IPP Everywhere™ printers,
  • Network and local (USB) printers with Printer Applications, and
  • Network and local (USB) printers with (legacy) PPD-based printer drivers.

You can also learn more about the CUPS project through the official website

Background Brief

In the process of OpenHarmony's southward ecological development, it is necessary to be compatible with printers in the stock market. The use of CUPS printing system can directly connect with most printers in the market, which also reduces the difficulty for printer manufacturers to adapt to OpenHarmony.

How to use

1、Header file import

#include <cups/cups-private.h>

2、Add Compilation Dependency

Add in the bundle. json file

"deps": {
  "third_part": [
    "cups"
  ]
}

Add dependencies where needed in BUILD.gn

deps += [ "//third_party/cups:cups" ]

3、Example of interface usage

// Example of using CUPS interface to query printer capabilities
ipp_t *request; /* IPP Request */
ipp_t *response; /* IPP response */
http_t *http = NULL;
char scheme[HTTP_MAX_URI]; // Protocol 
char username[HTTP_MAX_URI];
char host[HTTP_MAX_URI];
int port;
// Declare which printer capabilities need to be queried, here are all
static const char * const pattrs[] = {
    "all"
};

// Connect to printer
http = httpConnect2(host, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_IF_REQUESTED, 1, TIME_OUT, NULL);
if (http == nullptr) {
    return;
}
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printerUri.c_str());
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes",
(int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
response = cupsDoRequest(http, request, "/");
// parse response
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING) {
    ippDelete(response);
    return;
}
// close http
httpClose(http);

Repositories Involved

third_party_cups-filters

print_print_fwk

Contribution

How to involve

Commit message spec