Previous Thread
Next Thread
Print Thread
//GDI Default values does size matter??? #1110 30 Apr 15 03:57 PM
Joined: Nov 2001
Posts: 154
G
Gary Guilbert Offline OP
Member
OP Offline
Member
G
Joined: Nov 2001
Posts: 154
Trying to print a label that is:
2-1/4 wide x 1-1/4" high. I am using all
// GDI lines, and trying to print in the:
TL-top left, TR - top right,
BL-bottom left, BR- bottom right corners.
TWIPS says 1440 = 1 inch, so:

//SETMAPMODE,TWIPS
//SETFONT,90,ARIAL
//textout, 1, 1, TL
//textout, 2880, 1, TR
//textout, 1, 1440, BL
//textout, 2880, 1440, BR

1) So the TL prints in the upper left corner (portrait), but lower than I expected.
What are the default values of: MARGINS (top, left),and X & Y OFFSETS and ORIGIN?
The manual doesn't say a thing about default
values.

2) Since all is TEXTOUT with X,Y position does it
matter what the size of the form is?

If I say //TEXTOUT, 5760, 200, BLAH BLAH
That is 4 inches to the right and off the form
and would not expect to see it.

3) Since I set the font size, and position
with TEXTOUT, none of the LPP,hght,width,auto
parms should matter "I assume".
Do I assume right?

Signed Confused
Gary

Re: //GDI Default values does size matter??? #1111 30 Apr 15 04:58 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
Every printer has some kind of hardware margin which you typically can't control from the application. (Although I've heard tell that some PCL printers support a PCL command or maybe an ESC sequence to adjust the hardware margin.)

You can find out what the margin is by printing with the LP TRACE turned on and looking for this line:

Code
64 14:45:57 <PRINT> Final page size: 6600 x 5100 pixels (600 x 600 dpi); print area: 118,100,6482,5000
In the above case, you can see that the hardware margin at the upper left corner is 118 by 100 pixels.

You can make the margins bigger by using the XOFFSET/YOFFSET or XORIGIN/YORIGIN commands, but you can't make them any smaller.

The form size (or paper size) may affect the size of the hardware margins, and it may also come into play if you output any plain text (which might cause A-Shell to think that it needs to start new page.)

You are correct that if you use explicit //TEXTOUT,x,x,text for all your output, you don't have to worry about how A-Shell would otherwise calculate the default line spacing. (And the auto pitch logic only applies when outputting plain text, so that's not an issue either.) But it's still the case that the printer probably won't even try to print something that is outside the boundaries of what it thinks is the page size - so if you aren't going to set it correctly, at least set it to be larger than the actual size.

Re: //GDI Default values does size matter??? #1112 30 Apr 15 06:15 PM
Joined: Nov 2001
Posts: 154
G
Gary Guilbert Offline OP
Member
OP Offline
Member
G
Joined: Nov 2001
Posts: 154
So I did the trace:

------- snip the top -----------

49 17:58:33 DeleteDC(8b211272)
50 17:58:33 Final page size: 640 x 526 pixels (300 x 600 dpi); print area: 0,36,640,490
Final adjusted auto pitch font: face=Lucida Console, ht=100, wd av/mx=30/30 pix (600 dpi), wt=400

I see upper left corner at 0,36 right?
Bottom right corner at 640,490 ? Are these in pixels? How do I convert to TWIPS - 1440=1 inch?

Yet I am using x,y twips much larger:
below X=2065, and max Y=230, so the Y is inside.
But the X is 2065/1440 = 1.4 inches to the right - outside the 640 specified above..........

//SETMAPMODE,TWIPS
//SETFONT,90,ARIAL
//TEXTOUT,135,5, 59.95
//TEXTOUT,135,230,009053
//SETFONT,150,Free 3 of 9, 0, 0, 400
//TEXTOUT,2065, 55,*009053*
//SETFONT,90,ARIAL

Comments ?

--------------
Also in the first post I asked about default values, may I assume they are zero (0)?

gracia
G

Re: //GDI Default values does size matter??? #1113 01 May 15 10:09 AM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
According to the message, the device resolution is 300 x 600 dpi (300 horizontal, 600 vertical). So the conversion from pixels to twips is:

horiz pixels * (1440/300) = twips
vert pixels * (1440/600) = twips

So your print area is about 2 1/8" wide by 3/4" high, or about 3066 x 1090 twips. And all of your TEXTOUT statement should fit well within that.

Are you saying that's not what's happening?

Do you get the same results on the actual printer as in APEX?

Regarding the default values, for XOFFSET/YOFFSET they're zero. For XORIGIN/YORIGIN, they're based on the offset from the top left physical position to the top left printable position, which in your case is 0,36 pixels (0,15 twips), i.e. XORIGIN=0,YORIGIN=15

The purpose of the XORIGIN/YORIGIN is to try to help you standardize your output position relative to the physical edge so that differences in the hardware margin between printers will not cause your output to shift accordingly. But that can only work if you set the ORIGIN values greater than what any of your target printers actually uses a minimum hardware margin. That's useful in printing on LETTER sized pages where you can afford to be conservative (i.e. setting the ORIGIN to say 500,500 even though 360,360 would probably be adequate). But with such a small form, you probably don't want to give up anything for the goal of standardization.

On the other hand, there's probably no need to worry about variation between printers, because all your sites are probably using the exact same printer model (so we wouldn't expect any variation, unless of course it's possible to adjust the hardware margin via some local printer switch or menu).

I would probably just ignore the ORIGIN feature, and use //TEXTOUT,0,0, for the first possible print position. On the right and bottom edges, you just need to be a little conservative,knowing that the usable space is slightly less than the physical space.

Also keep in mind that the //TEXTOUT,x,y position is by default the upper left corner of the character cell. But when you're trying to get as close as possible to the bottom of the form, you might find it helpful to switch to //SETTEXTALIGN,TA_BOTTOM so that the x,y in the //TEXTOUT was referencing the bottom of the character cell. (That eliminates any confusion over how tall the font is in mapmode units.)

Re: //GDI Default values does size matter??? #1114 01 May 15 03:42 PM
Joined: Nov 2001
Posts: 154
G
Gary Guilbert Offline OP
Member
OP Offline
Member
G
Joined: Nov 2001
Posts: 154
J,

Thanks for the default and pixels info.
I finally got the barcode small enough to fit on the jewelry (dumbbell) tag. It is supposed to wrap around a ring, the
butterfly wings stick together.
-------------------
I scanned in the labels and was going to paste an image here. I used Gadwin to cut an image to the clipboard
but a right click and a Ctrl-V will not paste the image.
It will paste into a Word doc.
How do you get images on the forum?

May you cinco on cinco,

Grasshopper

Re: //GDI Default values does size matter??? #1115 01 May 15 03:49 PM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content
Member
Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Hi Gary,

You have to host the image somewhere that internet accessible, and then link to via the URL tags in the forum

I'd suggest using a third party media serving site. Imageshack used to be free and good, but in trying to turn a profit that made it unusable without paying for it (darn capitalists). I currently use https://www.mediafire.com. Works pretty well, it has a drag-n-drop web interface so you can save you screen captures to disk, and then just upload them to their website.


Stephen Funkhouser
Diversified Data Solutions
Re: //GDI Default values does size matter??? #1116 01 May 15 04:45 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
If you don't like using a third party service like MediaFire, you can click on the Image button and enter http://www.microsabio.net/ForumImages/xxx.png
where xxx.png is the name of your image. Initially it will just look like this:

[Linked Image]

But if you then email it to me I'll post it and then it will magically appear (and won't be subject to those darn capitalists).

Re: //GDI Default values does size matter??? #1117 01 May 15 04:59 PM
Joined: Nov 2001
Posts: 154
G
Gary Guilbert Offline OP
Member
OP Offline
Member
G
Joined: Nov 2001
Posts: 154
I really don't need to show you an image of
a barcode on a little form. You have an imagination that can do that.

But, in the future if I want to send a pic.
you say I can click on the Image button.

Where is the Image Button?

Re: //GDI Default values does size matter??? #1118 01 May 15 05:06 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
To see the Image button, you have to first click the "Full Reply Form" button:

[Linked Image]

Then you'll see the Image button:

[Linked Image]


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3