Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PJL/PCL, Brother HL-L2375DW, Graphics and direct text printing issues 2

Status
Not open for further replies.

AlexElov

Programmer
Dec 7, 2018
4
GB
Hi,
I use none Windows based hardware to print plain ascii text
to Brother HL-L2375DW printer from my embedded controller.
This works well, I do send plain ascii text and printer renders it itself
and prints with monospaced fonts fine.

The issues started when I been asked to add the logo in front of that page.
Logo now prints but I lost the whole text, which I print now after the graphics.

I tried at lot of approaches using PCL commands and basically came to the conclusion
that by some reason I may only use or graphics (and ascii text but rendered to
graphics by windows driver) within one print job, what is one page,
or just a ascii text which the printer renders itself but with no graphics at all.

I still a bit doubt if this is final answer to my situation.
I tried to look for any example, showing the print of some graphics and then
direct ascii text at the same page after the graphics.
I use PJL, then PCL, turn to HP-GL2, send graphic bytes, then exit from HP-GL2,
then send text then exit from PJL.

If anybody may help, I may also provide more info, just very curious if it could be done
in general using the Brother HL-L2375DW.

Alex

 
If this is a PCL5 printer, it is easy and I do it every day. Typically, a logo is an image file that needs to be converted to PCL. If you make that image a PCL macro and embed the location for it to be positioned, simply call the macro as an automatic overlay once, and the printer will put the logo on every page for you. You would need to make sure there was enough space above your text lines to accommodate the logo.

Is your logo something you can draw with HP-GL/2 commands? Otherwise, why is HP-GL/2 involved
at all. You might poke around on my website and see if you can find anything useful. Actually, there is a document about printing signatures that might be useful.


Jim Asman
 
Hello, Jlasman !!

Many thanx for your reply, I feel like I got the light at the end of the tunnel at last !! :)

The printer is Brother HL-L2375DW and supports PCL6 due to their web site info, so good news.

The way how I got my logo image rendered into data was a bit weird as I understand now. I put it in MS paint
and used USB Trace when printed, so I captured all binary data, which came to printer. Then I saved it
to the bin file, put that file to the controller and sent it via 'cat'. It is about 20KB, I avoided to
put it into C++ code. Then I printed my ascii report data into file (at controller)
and send logo file (removed 0Ch) first and then text file via 'cat'.
If I send these separately, like only logo, or only text then I may print or logo or text.
But if I send one after other then logo prints but no text after. I might be missing something here, Im afraid.

Im not sure why HP-GL/2. It just the data I got when I printed logo and captured the data.
The command looks like *b####W, there are many chunks of data.

We looked for lot of printers and found 2250DW first but it became obsolete. Then this one.

To give some details the last version of the file I tried is this:
(I cat graphics here for shorter example).

-----------------------------------------------------------
%-12345X@PJL
@PJL SET REPRINT=OFF
@PJL SET HOLD=OFF
@PJL SET USERNAME="User"
@PJL SET JOBNAME="logo.jpg"
@PJL JOB NAME="awm-logo.jpg"
@PJL PRINTLOG ITEM = 1,PRINTER
@PJL PRINTLOG ITEM = 2,Thu,06 Dec 2018 09:46:50
@PJL PRINTLOG ITEM = 3,User
@PJL PRINTLOG ITEM = 4,ALEX-MSI
@PJL SET JOBTIME = "20181206094650"
@PJL SET STRINGCODESET=ISO88595
@PJL SET ECONOMODE=OFF
@PJL SET MEDIATYPECHECK=ON
@PJL SET MEDIATYPE=REGULAR
@PJL SET LESSPAPERCURL=OFF
@PJL SET FIXINTENSITYUP=OFF
@PJL SET TRANSFERLEVELUP=ON
@PJL SET TRANSFERLEVEL=0
@PJL SET RESOLUTION=600
@PJL SET HQMMODE=OFF
@PJL SET OUTBIN=AUTO
@PJL ENTER LANGUAGE=PCL
&n8WdRegular&l7H&l0S&l1X&u600D*t600R&l0O&l26a6d1E&l0U&l0Z*p0X*p0Y*v1oT*b1030M*b130w €ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ75W Iÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ*b199W xã0© æ!0Ÿ0ÿÿÿÿSÿÿ xx"x"xŸR0ÿÿ7xàŸO à 0ŸNp x*b195W  à0¿ð¿ðÀ0à ŸM xx]xxYx ¿¿â 0Ÿp Ÿp € xx& x& xx'à2â0¿ð¡0€ð¿ðÂ0â Ÿ€ Ÿƒ xx# x#xx&x&x‚¿¿ƒä 0Ÿp @ Ÿpƒ xx" *b218W xFx&x0ð¿
ð0¡0ß

{ 20KB of binary data here.....}

2222222222
%-12345X@PJL EOF
%-12345X
-----------------------------------------------------------
'2222222222' is the test text I want to see.
The logo is at top left corner and the rest will be normally about 40-50 lines of the text.

Alex

 
Alex,

Jim's right. Logos are usually placed via a macro call. I've used an HP/GL vector graphic logo stored as a macro for use in my PCL documents for years. I'm not at my office so I don't have my procedure handy to refresh my memory, I'm afraid.

I realize that for now you're just wanting to send everything at once in one job, so I'd suggest:

1. You may want to save the PCL cursor position prior to printing the logo, and then restore it after the logo is printed. Save is <esc>&f0S; Restore is <esc>&f1S. (called push and pop). Otherwise, you could be printing your text off the visible page.

2. You may want to add an <esc>E toward the end to ensure that the page is ejected.

EDIT ADDITIONAL INFO: Using HP/GL commands from within a macro is NOT supported on all implementations of PCL 5. Check your specific model's tech reference to determine support.
 
Alex,

I have seen in the past where Brother printers that say they are PCL6, actually do support PCL5, and the fact that cou are getting anything suggest that your printer DOES support.

Anyway, attached is 'alex.pcl' and if you copy it directly to your printer port you should get the graphic and text. I just noticed that I omitted the PJL exit at the end of the file and should be there, but it appears to print OK here.

Let me know if you have any questions.

Jim Asman
 
Hello, Jim !!

Many thanx for your help!
In general - it prints logo and text!!! I'm very close.
But never easy.

I returned back to my country and here I have no Brother HL2375DW printer.
I do have old good HP Laserjet 6P (PCL 6, PostScript 2). I wonder if there is possibility that
the logo and text combined into one file may have such PCL commands which may be printed at both printers with no
change you think, in general?

Also I not tried yet your file (alex.pcl) at Brother HL2375DW printer but when I print it at
my HP Laserjet 6P it prints logo and text at first page fine (fantastic!) but then it prints second page
which has just ascii text as:
[ZoneTransfer]
ZoneiD=3
ReferrerUrl=https://..........................
HostUrl=https://.................
I do believe links are connected with where alex.pcl is located at the moment.
Interesting, but I cant see how it could be cut off as there not exists directly at the text of alex.pcl.

I tried so far to split from your file a header, graphic body and last part of text and insert my own graphic
but seems I was wrong at some point and that now ruined even what alex.pcl gave me. I do use hex editor for now to prepare
graphics and then to add a custom text.
As I see how this will run for me -
I have my custom logo in a file, then print text into another file, then join them and send all into printer
all running under embedded linux.

I see you sell software at your website and there might be a point when I will ask too much, please
let me know if you think I broke that line by asking too much for free.


Alex



 
Ahh yes and I tried to split alex.pcl into just 2 exactly parts
with graphic and then with 140 bytes of last commands which print a text
and use twice a copy /b at my command line shell and that is not working,
it prints a text with no logo. Interesting that it is not the same as to send a
single file to the printer.

Alex

 
Alex,

There is absolutely nothing in alex.pcl that would create the second page, so I would assume that it has something to to with the method you are using to send the file to the printer. My guess is that the file will print OK on both printers. What OS are you using?(Windows, Linux etc.) How is the printer connected to the printer? (LPT port, network, serial port)
If you will send me the image file (BMP etc) of your logo, I will make a proper PCL file for you. Get my email address from my website.

If you are on Windows and the printer is on LPT1, then an appropriate command would be 'copy /b alex.pcl LPT1:'


Jim Asman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top