Board index » delphi » Margins on Printer

Margins on Printer

Hi there,

Does anyone know how to SET the margins of the printer in a Delphi 2 -
program ?
I'm using the Printer.Canvas to generate all my reports.

Thanks in advance,
Benny.

benny.vandeve...@advalvas.be

 

Re:Margins on Printer


Quote
> Does anyone know how to SET the margins of the printer in a Delphi 2 -
> program ?

-----------------------------------------------------------------------
This solution is brought to you by Joe Hecht's TExcellent products,
solving Form.Print and bitmap printing problems. Joe Hecht's TExcellent
products can be found at: www.code4sale.com/joehecht/index.htm
-----------------------------------------------------------------------

You cant set the margins. You must instead adjust the origin of
your output. See the Windows API function GetDeviceCaps()
for helpfull information to assertain the adjustment necessary.

Joe

--
Cycling to cure cancer: http://homepages.borland.com/jkaster/tnt/

Re:Margins on Printer


"Joe would know!"  :-)  

Remember that output in Windows is intended to be both (a) graphic and
(b) device independent.  Programs create output by rendering a "Windows
graphic metafile" and then ordering that to be "displayed" upon a
particular printer.  It is then that printer-driver's responsibility to
produce the output according to the user's chosen settings.

Partly because Windows' designers knew they could never anticipate
everything that a particular printer-vendor might require, the process
of gathering and acting upon device-specific settings is also, for the
most part, solely the responsibility of the creator of a particular
device driver.  

The documentation on the Windows printing/graphic subsystem, as
furnished by Microsoft, is quite thorough -- if deep and slow reading.
Every Windows programmer should study it.  Petzold's books cover this
topic quite well.

Quote
>Joe C. Hecht wrote:

> > Does anyone know how to SET the margins of the printer in a Delphi 2 -
> > program ?

> -----------------------------------------------------------------------
> This solution is brought to you by Joe Hecht's TExcellent products,
> solving Form.Print and bitmap printing problems. Joe Hecht's TExcellent
> products can be found at: www.code4sale.com/joehecht/index.htm
> -----------------------------------------------------------------------

> You cant set the margins. You must instead adjust the origin of
> your output. See the Windows API function GetDeviceCaps()
> for helpfull information to assertain the adjustment necessary.

> Joe

> --
> Cycling to cure cancer: http://homepages.borland.com/jkaster/tnt/

--
------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)

- Show quoted text -

Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Other Threads