そこで、IPP (Internet Printing Protocol) 経由でドキュメントを印刷できる PHP コンポーネントを作成します。しかし、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>