[SOLVED] PLC5e file to a non-PCL compatible printer - virtual PCL5e converter?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
PLC5e file to a non-PCL compatible printer - virtual PCL5e converter?
Hi,
I have been lurking on the forums for some time, but have only now had reason to register and request some help.
I have an application used by our business which generates PCL5e reports which are sent via raw printers on CUPS to PCL-compatible printers. The application is server-based and all print jobs are sent to CUPS from the server, not the client machines.
I now have a non-PCL-compatible printer in the mix. It is a Brother MFC-7360n, connected via Ethernet and also to a local machine via USB. CUPS is talking to the printer over the Ethernet connection. I have tried Brother's BINARY_P1 queue as well as the PCL_P1 queue in the URI, but to no avail.
Brother have a CUPS driver which I have installed. This works fine for printing CUPS test pages and other documents, but documents sent from our application simply produce a single blank page. If I configure the CUPS printer with a raw queue, multiple blank pages are printed.
I have been working at this for a few days now & figure that I need something in between the PCL5e output and the Brother driver to convert the document into a format the driver will understand. I have looked into cups-pdf, but cannot get it to work with these generated PCL5e documents either. If I could then write a script to print the PDF (which would be trivial) it would all work nicely. How do I convert from this raw PCL5e document to a PDF with cups-pdf or similar?
I have done a considerable amount of reading up on this over the last couple of days and am not making much progress. Any advice as to how I might set this up would be most appreciated.
It's listed as a host based GDI printer. It probably won't work with anything but micosoft.
Quote:
The terms GDI, Host-based, Host-based (GDI), Host-Based Printing , Proprietary (GDI) , and Windows GDI are generic terms that can refer to any Host-based or Windows-only printer, which use a proprietary printer data stream rather than an industry-standard printer data stream such as IBM Proprinter Data Stream (PPDS), Epson ESC/P2, HP Printer Control Language (PCL), or Adobe PostScript (PS). These printers support printing from Windows, and possibly from Macintosh or Linux, but will not print directly from IBM i, IBM i5/OS, IBM OS/400, UNIX or any other non-PC-based Operating System, even if the printers can be network-attached. Because these printers require a proprietary printer data stream, they will not work with Host Print Transform (HPT) or a PC5250 Printer Definition Table (PDT) File.
Apologies for the delayed reply & thank you all for your suggestions.
Using a combination of a simple Perl server (http://aplawrence.com/MacOSX/macosxcupstofile.html) and GhostPCL, I was able to have CUPS pass on the PCL5e data to the Perl server which then coverts it to a PDF. The host then submits the PDF to the printer & deletes the PCL & PDF files.
I'm starting the script from a remote machine as follows:
ssh x.x.x.x 'nohup perl /Applications/pclConvertServer.pl </dev/null >nohup.out 2>1&1 &'
The server in Perl
Code:
#!/usr/bin/perl
use IO::Socket::INET;
$myport=12000;
$pserve=IO::Socket::INET->new(LocalPort => $myport,Type=>SOCK_STREAM,Reuse=>1,Listen=>1) or die "can't do that $!\n";
while ($pjob=$pserve->accept()) {
open(J,">>/tmp/pclConvertServer/in.pcl") or print "having issues $!\n";
while (<$pjob>) {
print J "$_";
}
close J;
close $pjob;
# Convert the pcl file to a PDF
system("pcl6 -o /tmp/pclConvertServer/PDF/out.pdf -sDEVICE=pdfwrite /tmp/pclConvertServer/in.pcl");
# Send the PDF to the printer via the local CUPS server
system("lp -d CUPS-PRINTER-NAME /tmp/pclConvertServer/PDF/out.pdf");
# Remove temporary files (important!)
system("rm /tmp/pclConvertServer/in.pcl");
system("rm /tmp/pclConvertServer/PDF/out.pdf");
}
I'm running this on an Ubuntu server. Ideally I'd like to be able to convert this to a daemon script and have the ability to start/stop as an Ubuntu service. For now however, this solution is working fine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.