LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-25-2012, 10:26 PM   #1
gbro115
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
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.

George
 
Old 01-26-2012, 07:17 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Welcome to LinuxQuestions.

I have never played with ghostpcl (http://www.ghostscript.com/) but it will convert a PCL file to PDF.
 
Old 01-28-2012, 04:36 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
http://www-01.ibm.com/support/docvie...2569c100799559

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.
 
Old 01-28-2012, 06:02 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
The OP did state that the printer was working except for PCL generated reports.
 
Old 01-30-2012, 03:50 PM   #5
gbro115
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.

Thanks again for the suggestions.

George
 
1 members found this post helpful.
Old 01-30-2012, 03:59 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Thanks for the follow up post.
 
Old 12-26-2013, 10:13 PM   #7
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 496

Rep: Reputation: 45
This might be of help: http://welcome.solutions.brother.com...html#MFC-7360N
 
Old 07-11-2014, 10:48 PM   #8
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 496

Rep: Reputation: 45
See this: http://support.brother.com/g/b/downl...=4&type3=10034
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual printer? (take content to custom shell script/program/another printer) dedec0 Programming 7 07-12-2011 06:18 PM
Print to HP P4515 using PCL codes for built-in printer fonts from AIX 5.2 jc2it AIX 1 03-31-2010 05:32 AM
HP laser printer PCL commands novacrasher Linux - Hardware 1 07-09-2009 03:28 PM
How to extract PCL code from printer and replace them jensen123 Linux - Software 1 02-20-2009 03:35 PM
Why can't I find a Generic PCL printer driver on CUPS rickh Linux - Hardware 1 05-05-2006 08:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration