pjl

Printing to port 9100 with PJL and Python

試著忘記壹切 提交于 2021-01-28 05:23:44
问题 I believe this code should work to print a PDF directly to most printers on port 9100. This source and this one among others seems to agree on the details. My printer wakes up and seems to "spool a job" for a moment, but then just goes quiet again. The socket code is very crude of course, but still.. Maybe it's just my particular printer *. Grateful if somebody could test this or point out any errors or improvements. import socket job = [ b'\x1b%-12345X@PJL JOB NAME = "My Print Job Name"\r\n'

Add PJL command into PDF file with PHP code

无人久伴 提交于 2020-01-29 07:55:21
问题 How can I insert a PJL command into PDF without having to convert PDF to PostScript *STARTPJL @PJL SET STAPLE=LEFTTOP *ENDPJL after I send it to printer via FTP or LPR. I'm using Zend_Pdf to create PDF documents. **I tried unsuccessfully this code $a .= "<ESC>%-12345X@PJL<CR><LF>"; $a .= "@PJL SET OUTBIN=OUTBIN101<CR><LF>"; $a .= "@PJL SET STAPLE=LEFTTOP<CR><LF>"; $a .= "@PJL ENTER LANGUAGE = PDF<CR><LF>"; $a .= file_get_contents("/www/zendsvr/htdocs/GDA/public/pdf/test.pdf"); $a .= "<ESC>%

Add PJL command into PDF file with PHP code

元气小坏坏 提交于 2020-01-29 07:54:10
问题 How can I insert a PJL command into PDF without having to convert PDF to PostScript *STARTPJL @PJL SET STAPLE=LEFTTOP *ENDPJL after I send it to printer via FTP or LPR. I'm using Zend_Pdf to create PDF documents. **I tried unsuccessfully this code $a .= "<ESC>%-12345X@PJL<CR><LF>"; $a .= "@PJL SET OUTBIN=OUTBIN101<CR><LF>"; $a .= "@PJL SET STAPLE=LEFTTOP<CR><LF>"; $a .= "@PJL ENTER LANGUAGE = PDF<CR><LF>"; $a .= file_get_contents("/www/zendsvr/htdocs/GDA/public/pdf/test.pdf"); $a .= "<ESC>%

Add PJL command into PDF file with PHP code

这一生的挚爱 提交于 2020-01-29 07:54:07
问题 How can I insert a PJL command into PDF without having to convert PDF to PostScript *STARTPJL @PJL SET STAPLE=LEFTTOP *ENDPJL after I send it to printer via FTP or LPR. I'm using Zend_Pdf to create PDF documents. **I tried unsuccessfully this code $a .= "<ESC>%-12345X@PJL<CR><LF>"; $a .= "@PJL SET OUTBIN=OUTBIN101<CR><LF>"; $a .= "@PJL SET STAPLE=LEFTTOP<CR><LF>"; $a .= "@PJL ENTER LANGUAGE = PDF<CR><LF>"; $a .= file_get_contents("/www/zendsvr/htdocs/GDA/public/pdf/test.pdf"); $a .= "<ESC>%

Java printing PDF with options (staple, duplex, etc)

守給你的承諾、 提交于 2019-12-20 06:20:05
问题 I have a java program that prints PDFs. It uses Apache PDFBox to create a PDDocument object (from a pdf document or from a stream in some cases) and then sends it to the printer using the javax.print API: private boolean print(File pdf, String printer) { boolean success = false; try (PDDocument document = PDDocument.load(pdf)) { PrintService[] printServices = PrinterJob.lookupPrintServices(); PrintService printService = PrintServiceLookup.lookupDefaultPrintService(); PrinterJob job =

Java printing PDF with options (staple, duplex, etc)

喜夏-厌秋 提交于 2019-12-02 08:34:34
I have a java program that prints PDFs. It uses Apache PDFBox to create a PDDocument object (from a pdf document or from a stream in some cases) and then sends it to the printer using the javax.print API: private boolean print(File pdf, String printer) { boolean success = false; try (PDDocument document = PDDocument.load(pdf)) { PrintService[] printServices = PrinterJob.lookupPrintServices(); PrintService printService = PrintServiceLookup.lookupDefaultPrintService(); PrinterJob job = PrinterJob.getPrinterJob(); job.setPageable(new PDFPageable(document)); // set printer if (printer != null) {

How to programmatically achieve editing of the spool file header of the normal windows print queue 'spool file' before it is sent to the printer?

孤街浪徒 提交于 2019-11-29 12:44:52
How to intercept and change the windows 7 print spool file (.SPL) to add some additional information in the header like '@PJL SET NAME="PainPoint" ' before this file is sent to the printer during the execution of the print job? The .SPL file partial extract from top is : %-12345X@PJL SET STRINGCODESET=UTF8 @PJL COMMENT DATE=02/08/2017 @PJL ENTER LANGUAGE=PCLXL ) HP-PCL XL;2;1;FXXPL2-1.0.0,WINNT-6.1,XPL2DRV-6.9.1.1 ?X???........ Nick Westgate Editing the spool file is obviously trivial. The trick is how to get access to the spool file. I can think of a few ways offhand: Pause the print job

How to programmatically achieve editing of the spool file header of the normal windows print queue 'spool file' before it is sent to the printer?

£可爱£侵袭症+ 提交于 2019-11-28 06:05:50
问题 How to intercept and change the windows 7 print spool file (.SPL) to add some additional information in the header like '@PJL SET NAME="PainPoint" ' before this file is sent to the printer during the execution of the print job? The .SPL file partial extract from top is : %-12345X@PJL SET STRINGCODESET=UTF8 @PJL COMMENT DATE=02/08/2017 @PJL ENTER LANGUAGE=PCLXL ) HP-PCL XL;2;1;FXXPL2-1.0.0,WINNT-6.1,XPL2DRV-6.9.1.1 ?X???........ 回答1: Editing the spool file is obviously trivial. The trick is