🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
4 messages
4 total messages Started by Kevin C. Killion Tue, 05 May 1998 00:00
Printing is tiny -- why??
#516
Author: Kevin C. Killion
Date: Tue, 05 May 1998 00:00
37 lines
2119 bytes
Topic:  Printing is tiny -- why??

I've added a formal printing routine to my app, using the Printers unit
and the Printer object, for example ...

               height := Printer.PageHeight;
               width := Printer.PageWidth;
               theCanvas := Printer.Canvas;

When I draw on the screen, I get shapes, lines and fonts in the size I
expect.  However, when I use the same routines to draw on the printer
canvas, I'm getting much, much smaller results.  Rectangles, lines, text
-- all are smaller when printed than when viewed onscreen.

In general, it appears that WYSIWYG doesn't apply, and that the scale of
printing is different than the scale of on-screen drawing.  That is,
pixels per screen inch is different than pixels per printed inch.

My question is:
  -- is there some call or action I need to correct the scaling,
               -- OR --
  -- do I have to do the re-scaling myself, and compute new values for
locations, lengths and font sizes?  If I have to code the rescaling
myself, is there a "proper" way to pick the scaling values?

As an added puzzle, the text sizes appear to be smaller, but not
proportionately to the reduced shapes and layout of other graphic items. 
For example, if I draw a rect with some text, both will print much smaller
on the printer than they appear on screen, but the text isn't shrunk as
much as the box.  The result: text that "fits" in places on screen doesn't
fit when printed.  Perhaps there is a minimum printable size, or something
like that?

Thanks for any advice or pointers!

Kevin Killion
Re: Printing is tiny -- why??
#515
Author: Earl F. Glynn
Date: Tue, 05 May 1998 00:00
30 lines
1693 bytes
Kevin C. Killion wrote in message ...
>Topic:  Printing is tiny -- why??
>
>I've added a formal printing routine to my app, using the Printers unit
>and the Printer object, for example ...
>
>               height := Printer.PageHeight;
>               width := Printer.PageWidth;
>               theCanvas := Printer.Canvas;


You've got a lot more pixels on the printer canvas than you do a
display.  For examples, HP LaserJets have 300 or 600 dots per
inch (other values are possible).

Take a look at the Printer Demo #1 program on the Printer
Projects page in my Computer Lab.  (Look for "Other
Projects" on the main page).  This examples shows how
to print text and graphics (both image and vectors)
on a printer canvas.  Other examples in my Computer
Lab show how to draw on a canvas that can be
either the display or the printer.

efg
_________________________________________
efg's Computer Lab:  http://infomaster.net/external/efg

Earl F. Glynn                 E-Mail:  EarlGlynn@att.net
MedTech Research Corporation, Lenexa, KS  USA
Re: Printing is tiny -- why??
#513
Author: agc6904
Date: Thu, 07 May 1998 00:00
11 lines
886 bytes
On Tue, 05 May 1998 11:08:56 -0500, kevin@shsmedia.com (Kevin C.
Killion) wrote:

>Topic:  Printing is tiny -- why??
>
printers work with dpi (dots per inch)
when you do a textout(  ) then x and y coordinate for a 300dpi printer
is 300 dots per inch
so textout(300,300,'HELLO') puts hello 1 inch from the top and the
left of the page
Re: Printing is tiny -- why??
#514
Author: Kevin C. Killion
Date: Thu, 07 May 1998 00:00
36 lines
2211 bytes

Earl F. Glynn <EarlGlynn@WorldNet.att.net> wrote:

> Take a look at the Printer Demo #1 program on the Printer
> Projects page in my Computer Lab.  (Look for "Other
> Projects" on the main page).  This examples shows how
> to print text and graphics (both image and vectors)
> on a printer canvas.  Other examples in my Computer
> Lab show how to draw on a canvas that can be
> either the display or the printer.
>      efg's Computer Lab:  http://infomaster.net/external/efg


Earl, your examples are ***terrific***!  Thanks!  With the samples, it was
straightforward to figure out how to use some of the exotic calls
necessary to do printing.

I was well aware that the screen and different printers all have different
pixels per inch.  What surprised me is that neither Delphi nor Windows
insulates the programmer from such low-level concerns.  (My background is
15 years of programming on the Mac, which takes WYSIWYG seriously.  On the
Mac, when I draw a circle one-inch in diameter, it's one inch on the
screen and one inch on virtually every printer.  So, one routine, without
a lot of special casing, can be used to draw on any device, including the
screen.  On Delphi/Windows, if the form.PixelsPerInch is 96 and I use that
to draw a line of 1", it might actually be 1.5" on screen, 1/2 inch on one
printer and 1/4 inch on another printer.)

Now that I have learned that I have to do the scaling myself, your
examples, Earl, taught me *exactly* what I needed to know.  I have
modified my code and now have good-looking printed reports.

Thank you!!!!

Kevin Killion
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads