因此,我编写了 PHP 组件,它可以通过 IPP(Internet 打印协议)打印文档。但我无法正确打印 HTML 文档 (text|html - mimetype)。打印机已将此类型打印为 RAW。可能有人给出正确请求的例子(标题和正文)?
例如,我的错误请求被打印为 RAW 数据。
标题:
POST /printers/CanonLPR HTTP/1.1
Host: 10.2.2.105:631
Connection: close
Accept-encoding: gzip, deflate
User-agent: EHttpClient
Content-Type: application/ipp
Content-Length: 772
身体:
Gattributes-charsetutf-8Hattributes-natural-languageen_usEprinter-uri'http://10.2.2.105:631/printers/CanonLPRDrequesting-user-name
PHP-SERVERIdocument-format text/html<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="language" content="ru" />
</head>
<body>
<img style="float: left; margin-right: 10px;" src="/static/img/printer.png" />
<h1>Test page</h1>
</body>
</html>