在 PHP 中使用 PCL 和 PJL 打印 PDF [英] PRINT PDF using PCL AND PJL in PHP

查看:51
本文介绍了在 PHP 中使用 PCL 和 PJL 打印 PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的办公室里有一些理光打印机,我们想使用一个简单的套接字从 php 打印,但有些文档是预先打印好的,位于托盘 2 中,默认纸张位于托盘 1 中.我希望能够使用 PJL PDF 和 PJL PCL 语言的组合来选择该打印机的托盘.有人有想法吗?我在论坛上找到了这个:

we have some ricoh printers in our offices and we want to print from php using a simple socket but some documents are pre printed and are located in tray 2 the default sheets are in tray 1 . i want to be able to select a tray of that printer using a combination of the PJL PDF and PJL PCL language . anyone has an idea maybe? i've found this on the forum :

<ESC>%-12345X@PJL<CR><LF>
@PJL SET STAPLE=LEFTTOP<CR><LF>
@PJL    [... more PJL commands if required ...]
@PJL ENTER LANGUAGE = PDF<CR><LF>
[... all bytes of the PDF file, starting with '%PDF-1.' ...]
[... all bytes of the PDF file ............................]
[... all bytes of the PDF file ............................]
[... all bytes of the PDF file, ending with '%%EOF' .......]
<ESC>%-12345X

它打印我的 pdf ,但是当我添加

it prints my pdf , however when i add the

@PJL ENTER LANGUAGE = PCL<CR><LF>
<ESC>&l1H <CR><LF>

围绕该代码.我得到了一些奇怪的结果...... 1 个 pdf 分成了 5 篇论文,只有流数据(奇怪的迹象).

around that code . i get some strange results... 1 pdf splits up over 5 papers with nothing but stream data (weird signs).

所以我做了以下

<ESC>%-12345X@PJL<CR><LF>
@PJL ENTER LANGUAGE = PCL<CR><LF>
<ESC>&l1H <CR><LF>
<ESC>%-12345X@PJL<CR><LF>
@PJL SET STAPLE=LEFTTOP<CR><LF>
@PJL    [... more PJL commands if required ...]
@PJL ENTER LANGUAGE = PDF<CR><LF>
[... all bytes of the PDF file, starting with '%PDF-1.' ...]
[... all bytes of the PDF file ............................]
[... all bytes of the PDF file ............................]
[... all bytes of the PDF file, ending with '%%EOF' .......]
<ESC>%-12345X

然而,这再次从托盘 1 打印文件,似乎在尝试打印 pdf 文件时丢失了设置...

however this printed the file from tray 1 again , it seems that it lost the settings when trying to print the pdf file ...

有人给我任何提示或可以进行更正吗?我想我快到了...

anyone got any tips for me or can make a correction? i think i'm nearly there ...

推荐答案

将纸张类型设置为纸盘选择的解决方法:

Set paper type as workaround for tray selection:

并非所有具有 PDF 直接打印功能的打印机都支持 PJL 媒体源指令;例如理光 aficio 打印机没有.经过数周的努力,我终于拿到了理光支持的与 PJL 指令相关的 Ricoh 手册.理光支持@PJL SET MEDIATYPE=SPECIAL – special 是为特定托盘定义的纸张.您可以为纸盘指定特定的纸张类型,因此需要特定的纸张会导致使用特定的纸盘.如果打印机配置正确(托盘需要设置为自动选择"),这终于可以工作了.

Not all printers with PDF Direct Print feature support the PJL mediasource instruction; e.g. Ricoh aficio printers do not. After weeks of struggling, I finally managed to get hold of the Ricoh manuals relating to PJL instructions supported by Ricoh. Ricoh supports the @PJL SET MEDIATYPE=SPECIAL – special is the paper as defined for a specific tray. You can assign a specific paper type for a tray, so requiring a specific paper results in using a specific tray. And provided the printer is properly configured (trays need to be set to "automatically selected"), this finally works.

来源:http://www.tachytelic.net/2010/10/hp-direct-pdf-printing-and-printer-tray-control/

我也对使用 PJL 来包装 pdf 的无驱动打印感兴趣,并且还使用 Ricoh 打印机,请让我了解最新情况.您正在使用哪些理光模型?

I'm also interested in driverless printing using PJL to wrap pdf, and also working with Ricoh printers, plase keep me updated. Wich Ricoh models are you working with ?

TIA

这篇关于在 PHP 中使用 PCL 和 PJL 打印 PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆