{"id":80,"date":"2014-08-24T15:24:18","date_gmt":"2014-08-24T13:24:18","guid":{"rendered":"http:\/\/andreberger.eu\/?p=80"},"modified":"2015-07-24T12:41:56","modified_gmt":"2015-07-24T10:41:56","slug":"rlpr","status":"publish","type":"post","link":"https:\/\/andreberger.eu\/?p=80","title":{"rendered":"rlpr"},"content":{"rendered":"<p>Remote printing\u00a0(org.dyndns.hvkls.rlpr) \u00a0\/\/<em>\u00a0configuration<\/em><!--more--><\/p>\n<p>BSD-compatible, enhanced replacements for lpr, lpq, and lprm. Includes the <a href=\"http:\/\/andreberger.eu\/?p=26\">hvkls.dyndns.org<\/a> script &#8220;tlpr&#8221; to fix stair-stepping plain-text printouts.<\/p>\n<ul>\n<li><a href=\"http:\/\/truffula.com\/rlpr\" target=\"_blank\">http:\/\/truffula.com\/rlpr<\/a><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">Version History<\/span><\/p>\n<ul>\n<li>2.0.6-6\u00a0Added dependency\u00a0to org.dyndns.hvkls.repository<\/li>\n<\/ul>\n<p>Usage<\/p>\n<p>rlpr can transport files to remote print queues. The corresponding printer driver needs to be installed on the server (typically a remote computer), or the printer itself.<\/p>\n<p>Once set up as described below, printing from iOS is as easy as &#8220;lpr\u00a0<em>\/path\/to\/file<\/em>&#8221; or &#8220;stdout|rlpr&#8221;.<\/p>\n<p>Network Printer<\/p>\n<p>To print text files on a Brother HL-2070N laser printer (LPD queue), set $RLPR_PRINTHOST to its IP address, and $PRINTER to TEXT_P1. With &#8220;laser&#8221; pointing to the printer&#8217;s IP address through\u00a0<em>\/etc\/hosts<\/em>, the following will get you going:<\/p>\n<ul>\n<li># run this code just once, as root (su -)!<br \/>\necho &#8216;export PRINTER=&#8221;TEXT_P1&#8243;&#8216; &gt;&gt;\u00a0<em>\/etc\/profile<br \/>\n<\/em>echo &#8216;RLPR_PRINTHOST=&#8221;laser&#8221;&#8216; &gt;&gt;\u00a0<em>\/etc\/profile<br \/>\n<\/em>killall Terminal<\/li>\n<li># Example of printer laser at 192.168.111.222<br \/>\n#\u00a0run this code just once, as root (su -)!<br \/>\necho &#8216;192.168.111.222 laser&#8217; &gt;&gt;\u00a0<em>\/etc\/hosts<\/em><\/li>\n<\/ul>\n<p>Print Server<\/p>\n<p>Instead of direct printing, you could also set up queue with a print server like CUPS. This print server must accept LPD connections (port 515; cups-lpd man page). It must also have the appropriate filters to process input, like foomatic with Brother-HL-1250-hl1250.ppd for the aforementioned printer, referenced as laser in\u00a0<em>\/etc\/hosts<\/em>\u00a0on both systems.<\/p>\n<p>Printer setup of iOS client<\/p>\n<ul>\n<li># run this code just once, as root (su -)!<br \/>\necho &#8216;export PRINTER=&#8221;laser&#8221;&#8216; &gt;&gt; \/etc\/profile<br \/>\necho &#8216;RLPR_PRINTHOST=&#8221;ls&#8221;&#8216; &gt;&gt; \/etc\/profile<br \/>\nkillall Terminal<\/li>\n<\/ul>\n<p>Print Server Setup<\/p>\n<p>On the server, set up\u00a0<em>\/etc\/cups\/lpoptions<\/em>\u00a0for (only) plain text output adjustment on printer laser. Thereafter, restart CUPS.<\/p>\n<ul>\n<li># run this code as root (su -)!<br \/>\nlpadmin -p laser -o PageSize=A4 -o job-sheets=none -o cpi=12 -o lpi=8 -o page-left=36 -o page-top=36 -o page=right=36 -o page-bottom=36<br \/>\nkillall -HUP cupsd<\/li>\n<\/ul>\n<p>Thanks to CUPS&#8217;s MIME capacities\u00a0<em>\/etc\/cups\/mime.*<\/em>, it should be able to detect the filetype automatically.<\/p>\n<p>Fix Stair-Stepping Output<\/p>\n<p>Two ways to solve this:<\/p>\n<ul>\n<li>Preferably, on the server, edit\u00a0<em>\/usr\/lib\/cups\/filter\/foomatic-rip<\/em>\u00a0and change my $added_lf = &#8220;\\n&#8221;; to my $added_lf = &#8220;\\r\\n&#8221;;<\/li>\n<li>Alternatively, on iPhoneApple iPhone, employ the (included) wrapper script tlpr to fix eventual &#8216;stairs&#8217; in plain-text printouts. Use tlpr for plain-text files, rlpr for other file-types.tlpr<br \/>\ntlpr: Fix stair-stepping in plain-text input, and output to rlpr<br \/>\nUsage: &#8216;tlpr\u00a0<em>\/path\/to\/file<\/em>&#8216;, or &#8216;tlpr -&#8216; for stdin processing<br \/>\nPass non-plain-text input to rlpr instead.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Remote printing\u00a0(org.dyndns.hvkls.rlpr) \u00a0\/\/\u00a0configuration<\/p>\n","protected":false},"author":2,"featured_media":339,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-configuration","category-hvkls-ios-repository","excerpt","zoom","full-without-featured","even","excerpt-0"],"publishpress_future_action":{"enabled":false,"date":"2026-06-27 23:32:18","action":"change-status","newStatus":"private","terms":[],"taxonomy":"category","extraData":[]},"publishpress_future_workflow_manual_trigger":{"enabledWorkflows":[]},"_links":{"self":[{"href":"https:\/\/andreberger.eu\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andreberger.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andreberger.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andreberger.eu\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/andreberger.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":14,"href":"https:\/\/andreberger.eu\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":241,"href":"https:\/\/andreberger.eu\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions\/241"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/andreberger.eu\/index.php?rest_route=\/wp\/v2\/media\/339"}],"wp:attachment":[{"href":"https:\/\/andreberger.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andreberger.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andreberger.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}