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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing raster graphics at the top of a PCL page

Status
Not open for further replies.

nh218

Programmer
Jan 12, 2006
5
0
0
GB
I am attempting to print a logo at the top of a page which is sent to a HP laserjet printer.

I can enter text and use HP-GL/2 vector graphics to print text or lines close to the top of the page, however I cannot print a raster graphic at the top of the page.

I have checked the raster graphic file and there are no blank lines at the top of it.

I am new to PCL so I could easily be making a silly mistake here. The last line of my PCL is:

<esc>*p1000X<esc>*p0Y<esc>*t150R<esc>*r0F<esc>*r170T<esc>*r1A<esc>*b0Y<esc>*b0M

I have concatenated my raster graphic's pcl formatted binary file to this. The graphic seems to be printed about 1.5 inches below the top of the page. If I replace the above command with:

<esc>*p1000X<esc>*p0Ytop of page

then 'top of page' is printed only about 1 cm from the top of the page.

Any help here would be appreciated.

Neil
 
Well, it sounds as though your raster image may have some white space at the top of the image. But try this...

<esc>*p0Y<esc>*p-100Y<esc>*r1A...your raster image.

How did you get the PCL copy of the raster data? If you printed to a file from a windows driver and then cut that out for this use, there can potentially be something in the raster file that is hurting you.

First, try to insert the <esc>*p-100Y into your existing code.

If that doesn't work, then there is almost certainly something in the raster data that is doing it.

Jim Asman
 
Make that <esc>*p-400Y... Adjust value to suit.

Note that a default PCL page has a 1/2 inch top margin; therefore, the position <esc>*p0Y is located 1/2 inch down the page.

Jim Asman
 
Thanks for your tips. I've made the margin 0 and although this moved the text in the report upwards by 1/2 inch the graphic will not move any further upwards, even when using the *p-400 command. I used ImageMagick to create the raster graphic but have also then used Hex Editor to set the first line of the pcl format file to:

1B2A62323657FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

to ensure that a horizontal line appears at the top of the graphic.
 
Go to my website and download a demo copy of my MKPCL program that converts a raster image to PCL. There are versions for DOS, SCO UNIX, Linux, and freeBSD. So hopefully you are covered.

Try it to make the PCL image and see how you make out. Note that the demo marks the image with a grid.

If you want, email me your existing file and I will have a look at it. jlasman at telus dot net


Jim Asman
 
Thanks for your help Jim. The problem was caused by a line feed carriage return being added by the concatenation, inbetween the *b0M and the image.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top