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

Margins

Status
Not open for further replies.

dcomartin

Programmer
May 12, 2003
27
0
0
CA
Im using dBase IV and printing on an HP laserjet. My problem is I need to print at the very top of the page but it is always putting a about half inch margin. How can I set the top margin so it prints from the very top? Is this even possible?
 
I believe you'll have to look at the HPLJ manual to see if theres a PCL string you can send to set the printer to a zero top margin using the CHR() function. (sorry if I'm stating the obvious, i.e. something you've already tried.) Is your print output being generated with a REPORT FORM function, ? ..... , @say, or something else?

Also have you looked at the device settings on your printer properties as setup in Windows to see if the default form for the printer includes a top margin. Most likely it does on a laser.

dennis
 
Im using the @ SAY. How exactly do I send a PCL string?
 
THe HP laser jet (and I believe it's similar with most other brands), can't print to the edge of the paper. HP has a built in 1/4" margin on all sides of the paper so your effective printing area for 8 1/2 x 11 paper is 8 x 10 1/2. Some ink jet printers can print "edge-to-edge" but you have to specify a photo-quality paper to do this. (Don't try this with plain paper - it makes a real mess!)

HP's PCL language theoretically allows you to address the edge of the paper but the printer itself won't print outside the 1/4" margin. In all laser jet printers, the toner is placed on the paper with an electric charge (like a magnet) and isn't fixed to the paper until it passes through the thermal heater. So, the printer needs some place to pull the paper - hence the 1/4" margin.

There's always a better way. The fun is trying to find it!
 
dcomartin...

Using the @...say feature, you can set certain HP printer settings. Here are some examples:

@...say CHR(027)+CHR(069) && resets printer to default
@...say CHR(027)+CHR(040)+CHR(115)+CHR(051)+CHR(066) && bold text
@...say CHR(027)+CHR(040)+CHR(115)+CHR(048)+CHR(066) && normal text (not bold)
@...say CHR(027)+CHR(040)+CHR(115)+CHR(049)+CHR(080) && sets proporional width text
@...say CHR(027)+CHR(040)+CHR(115)+CHR(048)+CHR(080) && sets fixed width text
@...say CHR(027)+CHR(040)+CHR(115)+CHR(055)+CHR(086) && set font pitch to 7
@...say CHR(027)+CHR(040)+CHR(115)+CHR(056)+CHR(086) && set font to 8 pitch
@...say CHR(027)+CHR(040)+CHR(115)+CHR(049)+CHR(048)+CHR(086) && set font to 10 pitch
@...say CHR(027)+CHR(040)+CHR(115)+CHR(049)+CHR(054)+CHR(086) && set font to 16 pitch
@...say CHR(027)+CHR(038)+CHR(108)+CHR(049)+CHR(050)+CHR(068) && sets text to 12 line per inch
@...say CHR(027)+CHR(038)+CHR(108)+CHR(056)+CHR(068) & set text to 8 lines per inch

These are a few of the things you can control through your print routines. Google for "PCL language" and you should find a few white papers with most of the PCL language. You'll see control characters that start with "esc(" followed by either letters (both upper and lower case) or numbers (067, 071, etc). If it's letters, just change each letter to it's ASCII value, being aware of upper & lower case letters. If it's groups of numbers (067,068, etc.), use those numbers as is. Make sure that each value you use is in groups of 3 letters (see above). For example, the ASCII value of ESC is 27, so your code would be chr(027).

Play around with it and you'll find that you can gain a lot more control over your printed documents than you ever could before. If you run into any snags, send me an email and I'll help where I can.


There's always a better way. The fun is trying to find it!
 
I'm using:

@0,0 SAY CHR(027)+CHR(038)+CHR(108)+CHR(048)+CHR(069)

But it is still printing a 1/4" top margin. Any ideas?
 
Actually I am now using:

@0,0 SAY CHR(27)+"&l1E"

Before PRINTJOB and it is working. Thanks for the help
 
dcomartin...

As I said in my earlier post, the physical characteristics of printing with a laser printer prevents ANY printing in that area. Theoretically, you can address this area but the printer won't return an error - it just ignores it.

If it's an absolute "must" to print in an 11 inch area, then you can print on legal size paper and simply cut it. This is a crude method and not the least bit desirable but sometimes you have to resort to crude methods to get the job done.

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top