Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing PageControl

Status
Not open for further replies.

mindcorrosive

Programmer
Joined
Dec 11, 2006
Messages
2
Location
BG
I'm developing an application and I need to print out a form (actually, PageControl tabs). I tried

PageControl.Pages[0].PaintTo(Printer.Handle, MarginLeft, MarginTop);

but the printer spits out a blank page with a shrunk (about 10% of original size) image. The printer is Nashuatec P7535N. I tried to implement it with TCanvas instead of HDC, but the result was the same.

I tried to print out a bitmap, and it was again shrunk. I didn't find a way to use StretchDraw for Printer.Canvas in the PaintTo method.

The problem must be with the printer, but I don't have an extra printer to verify this with certainty :-)

My question is, is there a way to scale the canvas of the PageControl so that it fits exactly in the page? Or there are some printer settings that should be configured? And how can I make the printing device-independent if the problem is with the printer?

I'd be glad if you could help me.
Thank you very much in advance.
 
i had a play with this and had the same simptom as you so its not your printer.

you may have to do something like,

PageControl.Pages[0].PaintTo(Timage.canvas.Handle, 0,0);

printer.canvas.height:=600;
printer.canvas.width:=300;
printer.canvas.stretchdraw(timage,0,0);



Aaron
John Mutch Electronics
 
thank you, this worked with some modifications, maybe we have different versions of Delphi :)
take care
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top