Board index » cppbuilder » Scaled printing using Printer()->Canvas->...

Scaled printing 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 printing using Printer()->Canvas->...


Quote
Pastorel wrote:
> How do I find these dead areas and how I modify them from my program?

The Borland's TPrinter functions do provide all the information I need to print.
I have to call GetDeviceCaps (the Windows function) to get some of the missing
details. For example:

   TPrinter *Prntr ;

Prntr = Printer();
xPixelsPerInch = GetDeviceCaps(Prntr->Handle, LOGPIXELSX);
yPixelsPerInch = GetDeviceCaps(Prntr->Handle, LOGPIXELSY);
printerBitsPerPixel = GetDeviceCaps(Prntr->Handle, BITSPIXEL);

The GetDeviceCaps function may give you what you want.
|

Eric

Re:Scaled printing using Printer()->Canvas->...


Quote
"Pastorel" <exac...@rdsor.ro> wrote in message news:3b75cab2_2@dnews...
>         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

Take a look at the PrnUtil unit that comes witth the
demo version of our image printer product.

It has some usefull (and free) functions to help
with scaling and margins.

The Image printer product can be found here:
http://www.code4sale.com/joehecht

Click on the docs link.

Joe
--
Jimmy Page is having a charity artwork sale: Action For Brazil's Children Trust: http://www.abctrust.org.uk/
Whole Lotta Love computing to cure cancer! http://www.wholelottalove.org/

Other Threads