Board index » delphi » Scaled print using Printer->Canvas->...

Scaled print using Printer->Canvas->...

Well, a newbie with a close problem.

Regards all, first of all!

I use Printer->Canvas->...to print on a printer I choose with a
TPrintDialog, but what surprise me is:

I know the size of the page, height and width (297mm x 210 mm, A4 in this
case)
I know the printer's resolution (say 1800 x 1440, a Star LC 24 10 dot matrix
printer)
I compute the number of points I need to have certain graphic or text in a
certain place (X mm, Y mm)
   what do I get?
a reduced picture of what I intended to print!

        After a while I discovered in the printers properties that it has
some nonprintable areas, which set to 0, gave me
        the right canvas on the printer. So the question is:

How do I find these dead areas and how I modify them from my program? (I
cannot go with the program or ask the user to set the unprintable areas to
0, he might not know what to look for or where)

Thank you in advance
Pasto

 

Re:Scaled print using Printer->Canvas->...


Quote
"Pastorel" <pasto...@exacomp.ro> wrote:
>Well, a newbie with a close problem.

>Regards all, first of all!

>I use Printer->Canvas->...to print on a printer I choose with a
>TPrintDialog, but what surprise me is:

>I know the size of the page, height and width (297mm x 210 mm, A4 in this
>case)
>I know the printer's resolution (say 1800 x 1440, a Star LC 24 10 dot matrix
>printer)
>I compute the number of points I need to have certain graphic or text in a
>certain place (X mm, Y mm)
>   what do I get?
>a reduced picture of what I intended to print!

>        After a while I discovered in the printers properties that it has
>some nonprintable areas, which set to 0, gave me
>        the right canvas on the printer. So the question is:

>How do I find these dead areas and how I modify them from my program? (I
>cannot go with the program or ask the user to set the unprintable areas to
>0, he might not know what to look for or where)

Check out DevMode which can be gotten from DocumentProperties() or
AdvancedDocumentProperties().

After you have the canvas (I assume a canvas is the same as a DC, or
has a DC member), use GetDeviceCaps(printerDC, Some Querry Flag).
There's all kinds of stuff you can find out about the capabilities and
sizes of DCs.

Other Threads