Printer Printable Area

Printer Printable Area

Postby E. Bartzokas » Thu Dec 07, 2006 6:51 pm

Hi all,
We have this problem...
We try to print from printer to printer, having the same resolution (300x300 dpi), and same paper size (Letter 8.5x11 inches)

Things would be fine, if we could have the same results from printer to printer (e.g. from one laser to another deskjet), but we don't!

I am using 4 different printers here:
1. HP 1320 LaserJet (with HP LaserJet Series II, to obtain 300x300 dpi)
2. HP 6500 Inkjet
3. Broadgun pdfMachine (PDF printer driver)
4. PDF995 (PDF printer driver)

All in all, here are the results when I checked the various printers data...
(See table below)

I wonder if there is any way to:
1. Know the top and leftmost printable margin of the printer, and adjust it (most likely to push the top margin down)

2. If I can restrict the pinting within a certain area (HP 1320, is referenced as HP 1130 in the table, to avoid mixing up the real drivers with HP 1320). What I mean is if I can restrict the printers to make them print only within 268x203 mm, as with HP 1330, which, after all is the printer where we make all of our printouts to adjust.

3. Any relevant ideas will be mostly welcome...

Thank you all from the bottom of my heart.

Many regards
Evans


Code: Select all  Expand view  RUN
Printer      HP 1130     HP 6500         BroadgunPDF           PDF995

-----------------------------------------------------------------------
V.Res.        3160           3243               3300             3300
H.Res.        2400           2475               2550             2550

nVertSize()   268             274                279              279
nHorzSize()   203             209                216              216

All of them have a Physical size of 215.900 x 279.400.
All of them have resolution 300x300 dpi.

User avatar
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Re: Printer Printable Area

Postby Enrico Maria Giordano » Fri Dec 08, 2006 12:16 pm

oPrn:CmSay() and oPrn:Cmtr2Pix() methods automatically take care of printable margin. Look also at oPrn:nXOffset and oPrn:nYOffset instance variables.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Printer Printable Area

Postby E. Bartzokas » Fri Dec 08, 2006 4:08 pm

EnricoMaria wrote:oPrn:CmSay() and oPrn:Cmtr2Pix() methods automatically take care of printable margin. Look also at oPrn:nXOffset and oPrn:nYOffset instance variables.

EMG

Thanks Enrico!
This has also been taken into consideration... Alredy known and used of course...
It's just that I still want to restrict all the printout (e.g. expanding a WMF file) inside the printable area.

I still would like any additional advise from anywhere it might come...

Gracie my friend
User avatar
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Postby James Bott » Sat Dec 09, 2006 12:00 am

Evans,

It would seem you can find the printable area by subtracting 2 * offset from the resolution. Have you tried this?

I note that sometimes the drivers report incorrect and/or inconsistant information and that seems to be a object hard to overcome.

I have seen others provide a data entry screen for users to enter a correction factor to adjust for problems with the driver.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sat Dec 09, 2006 12:38 am

James Bott wrote:It would seem you can find the printable area by subtracting 2 * offset from the resolution.


You you mean oPrn:nHorzRes() and oPrn:nVertRes() they are the printable area.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Sat Dec 09, 2006 3:50 am

Enrico,

It looks like there is a problem. Note, below, that oPrn:nHorzSize() does not return the same size as the horzontal res - (2 * offset). The same is true for oPrn:nVertSize(). I think all these values are being returned by the device driver. I haven't tested the output to see which numbers are correct (or if none are correct). I don't have either printer available right now.

[Note: These numbers are for the US standard paper size of 8.5x11 inches]

James

oPrn:cModel: HP DeskJet 420,winspool,LPT1:
oPrn:nHorzRes(): 2400
oPrn:nVertRes(): 3025
oPrn:nLogPixelx(): 300
oPrn:nLogPixely(): 300
oPrn:nXOffset: 75
oPrn:nYOffset: 75
oPrn:nHorzRes() - (2 * oPrn:nXOffset): 2250 [2250/300dpi = 7.5 in ]
oPrn:nVertRes() - (2 * oPrn:nYOffset): 2875 [2875/300dpi = 9.6 in ]
oPrn:nHorzSize() : 203 mm = 8.0 in
oPrn:nVertSize() : 256 mm = 10.1 in
oPrn:GetPhySize()[1]: 215.900
oPrn:GetPhySize()[2]: 279.400

===========================
oPrn:cModel: hp officejet 5500 series,winspool,USB001
oPrn:nHorzRes(): 4800
oPrn:nVertRes(): 6258
oPrn:nLogPixelx(): 600
oPrn:nLogPixely(): 600
oPrn:nXOffset: 150
oPrn:nYOffset: 42
oPrn:nHorzRes() - (2 * oPrn:nXOffset): 4500 [4500/600dpi = 7.5 in]
oPrn:nVertRes() - (2 * oPrn:nYOffset): 6174 [6174/600dpi = 10.3 in]
oPrn:nHorzSize() : 203 mm = 8 in
oPrn:nVertSize() : 264 mm = 10.4 in
oPrn:GetPhySize()[1]: 215.900
oPrn:GetPhySize()[2]: 279.400
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sat Dec 09, 2006 10:54 am

James Bott wrote:It looks like there is a problem. Note, below, that oPrn:nHorzSize() does not return the same size as the horzontal res - (2 * offset).


oPrn:nHorzSize() and oPrn:nVertSize() are for screen device only.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Sun Dec 10, 2006 7:30 pm

Enrico,

Actually, nHorzSize() and nHorzRes() are both for printable area. I didn't realize this until now. All the vars except GetPhySize() are for printable area.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Sun Dec 10, 2006 7:34 pm

Evans,

>What I mean is if I can restrict the printers to make them print only within 268x203 mm, as with HP 1330, which, after all is the printer where we make all of our printouts to adjust.

The problem would be if some printers have a smaller printable area than 268x203. None of the ones you mention do, but there are a lot of printers out there.

Maybe you could explain exactly what the printing problem is?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sun Dec 10, 2006 7:50 pm

James Bott wrote:Enrico,

Actually, nHorzSize() and nHorzRes() are both for printable area. I didn't realize this until now. All the vars except GetPhySize() are for printable area.

James


From MSDN:

HORZSIZE Width, in millimeters, of the physical screen.

VERTSIZE Height, in millimeters, of the physical screen.

HORZRES Width, in pixels, of the screen; or for printers, the width, in pixels, of the printable area of the page.

VERTRES Height, in raster lines, of the screen; or for printers, the height, in pixels, of the printable area of the page.


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Sun Dec 10, 2006 8:17 pm

Enrico,

OK, the MSDN reference is noted, but look at these numbers:

oPrn:cModel: HP DeskJet 420,winspool,LPT1:
oPrn:nHorzRes(): 2400 [2400/300 dpi = 8 inches]
oPrn:nVertRes(): 3025 [3025/300 dpi = 10.1 inches]
oPrn:nLogPixelx(): 300
oPrn:nLogPixely(): 300
oPrn:nXOffset: 75
oPrn:nYOffset: 75
oPrn:nHorzSize() : 203 mm = 8.0 inches
oPrn:nVertSize() : 256 mm = 10.1 inches
oPrn:GetPhySize()[1]: 215.900 [ 215.9 mm / 25.4 = 8.5 in ]
oPrn:GetPhySize()[2]: 279.400 [ 279.4 mm / 25.4 = 11 in ]

Note that nHorzRes and nHorzSize are both showing the same values. The same for nVertRes and nVertSize.

If we calculate the printable area from the paper size minus the offset we get a number that is the same as nHorzRes():

8.5 in * 300 dpi = 2550 pixels - (2 * nXOffset ) = 2400 pixels = nHorzRes

I think that this means that code like this from TPrinter:Cmtr2Pix() is actually wrong:

nRow := Max( 0, ( nRow * 10 * ::nVertRes() / ::nVertSize() ) - ::nYoffset )
nCol := Max( 0, ( nCol * 10 * ::nHorzRes() / ::nHorzSize() ) - ::nXoffset )

Because the offset is being subtracted from the printable area. I'm not sure that the offset values need to be used anywhere since printable area already takes in to account the offsets.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sun Dec 10, 2006 8:40 pm

James Bott wrote:I think that this means that code like this from TPrinter:Cmtr2Pix() is actually wrong:

nRow := Max( 0, ( nRow * 10 * ::nVertRes() / ::nVertSize() ) - ::nYoffset )
nCol := Max( 0, ( nCol * 10 * ::nHorzRes() / ::nHorzSize() ) - ::nXoffset )

Because the offset is being subtracted from the printable area. I'm not sure that the offset values need to be used anywhere since printable area already takes in to account the offsets.


No, it is correct. Without offset being subtracted, if you were print at 0 cm you would really print at the left printable margin that is not at 0 cm from the sheet physical left margin.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Sun Dec 10, 2006 11:52 pm

Enrico,

>No, it is correct. Without offset being subtracted, if you were print at 0 cm you would really print at the left printable margin that is not at 0 cm from the sheet physical left margin.

OK, cmtr2pix() is calculating the absolute position on the paper, not the position in the printable area. I was thinking it was the printable area.

So, I think I can guess the problem Evans is having. I am somewhat familiar with the software that Evans is working on as I have also worked on it before. They do a lot of printing on top of an image of a form. So, if they put the form image at the top left of the printable area, then calculate the postions of the text base on the paper size, everything will work fine on that printer. But if another printer has a different printable area, then the form image is shifted compared to the absolute position of the text on the page. This makes the alignment off.

The solution may be tricky. Both the image and the text must be placed at absolute positions on the page, and hopefully they will both fall within the printable area. I suppose one could calcuate the absolute positions from the top left of the printable area instead of the paper. This way both the image and the text would always be in alignment and at least the top and left sides of the image & text would never be cut off. In the case where the printable area is not large enough for the entire form image to fit, then the bottom and/or left of the image may get cut off. I don't know if any of the form images are large enough for that to be a problem or not.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Carles » Mon Dec 11, 2006 9:56 am

Hello Enrico and James,

It is a very interesting topyc for my. I wanted to know your opinion on the following thing:

If I have an template using WMF with 4 points (Top/Left, Top/Right, Bottom/Left, Bottom/Right), it is possible to print 4 texts f.e. "Hello print", in the same points (Top/Left, Top / Right, Bottom/Left, Bottom/Right) using the method:: CmSay ()?

Independently of the printer that is used, I will see the same thing in screen (preview) that in the impression (real wisiwyg)? or will it always be approximate?

My obsession is to be able to print using a template (f.e using the method ::ImportWMF ()) and to add data indicating coordinates using f.e. method ::Say ()). Is it correct to use this methodology or do you know some better one?

Greetings.
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Carles
 
Posts: 1139
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Postby Enrico Maria Giordano » Mon Dec 11, 2006 11:12 am

Carles wrote:If I have an template using WMF with 4 points (Top/Left, Top/Right, Bottom/Left, Bottom/Right), it is possible to print 4 texts f.e. "Hello print", in the same points (Top/Left, Top / Right, Bottom/Left, Bottom/Right) using the method:: CmSay ()?


Yes. If your coordinates are in pixels you have to convert it to cm using oPrn:Cmtr2Pix() method.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests