L
L
LebedevEM2014-08-14 11:55:13
PHP
LebedevEM, 2014-08-14 11:55:13

What is the correct way to send HTML via IPP protocol?

I am writing a client in PHP for printing via IPP (Internet Printing Protocol). Almost everything is ready, but it is not possible to correctly send data in text/html format. The printer prints the transmitted data as raw text. But "application/pdf" prints great. Maybe someone who understands can give an example of a correct HTTP request (header and body) sent from the client to the server?
Here's an example of the request I'm sending:
Header:

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

Body:
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>Пробная страница печати</h1>
<h2>Поздравляем!</h2>
<p>Если эти сведения удается прочитать, принтер "Тестовый" удачно установлен в систему "WMS"</p>
<p>Url принтера: http://10.2.2.105:631/printers/CanonLPR</p>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question