TPrintPreview

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

TPrintPreview

Postby BAPBAP » April 26th, 2003, 12:23 pm

hi!
The TPrintPreview is fine! Tiny and usefull.
Can I scalled on the Paper some TPanel with all controls within? I try to do it but application seen to be fault if panel consist more then one control within... I use PaintWinControl. Thanks for any advices
BAPBAP
Member
Member
 
Posts: 1
Joined: April 26th, 2003, 12:18 pm
Location: Russia

Postby Kambiz » April 27th, 2003, 12:50 pm

Hi,

To fix the bug, please look for the following line

Code: Select all
WinControl.PaintTo(Bitmap.Canvas.Handle, 0, 0);

in the PaintWinControlEX method of TPrintPreview (Line No. 1381) and replace it with this one

Code: Select all
WinControl.PaintTo(Bitmap.Canvas, 0, 0);


Thanks,
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby rgesswein » May 21st, 2003, 9:00 pm

Is this still valid? I noticed this change was not in the later releases?
rgesswein
Member
Member
 
Posts: 2
Joined: May 21st, 2003, 8:58 pm

Postby Kambiz » May 21st, 2003, 9:42 pm

You are right. The above code is only valid for Delphi 6 or later.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Problem when print and fastprint=false

Postby Alex » September 4th, 2003, 8:42 am

Hi Kambiz, I have two problem with TPrintPreview.
1. After release 4.17 when I change the printer resolution, change the size of font in the preview

2. In the new release when fastprint=false, generate an exception.

thank you Alex

excuse me for my bad english.
Alex
Member
Member
 
Posts: 4
Joined: September 4th, 2003, 8:31 am

Postby Kambiz » September 5th, 2003, 12:28 am

Hi Alex,

1. The PixelPerInch property of the font depends on resolution of the device. In the older versions of TPrintPreview this dependency was not considered.

Code: Select all
procedure TFont.SetSize(Value: Integer);
begin
  Height := -MulDiv(Value, FPixelsPerInch, 72);
end;

2. Can you please save the preview in a file and post it here. Having it will be helpful to figure out the problem. Of course, I do suggest instead of setting the FastPrint property to False, to use PaintGraphic or PaintGraphicEx methods to draw images and leave the FastPrint property as True. In this way, not only the print process is faster but also it will prevent out of resource problem that may occur on Windows 98 for high resolution prints.

Cheers,
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

TPrintPreview

Postby Alex » September 5th, 2003, 7:25 am

Thank you so much Kambiz, :)
I post the file "PrintPreview.doc" but it save with TPrintPreview. The real name id PrintPreview.ppv.
For more information I can send the source code.

Cheers
Alex
Alex
Member
Member
 
Posts: 4
Joined: September 4th, 2003, 8:31 am

Postby Kambiz » September 5th, 2003, 12:32 pm

I couldn't downlaod the file, because with .doc extension the mime type of file set to word document. :(

Can you upload the file with .ppv extension? I added this extension to the list allowed extensions.

Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

PrintPreview

Postby Alex » September 5th, 2003, 1:47 pm

Sorry i can't upload with ppv extension!!!
You are sure to enabled ppv extension? I upload with txt extension.
try again to download this file doing right click of the mouse on the attach file, and select "save target as...".

Alex
Alex
Member
Member
 
Posts: 4
Joined: September 4th, 2003, 8:31 am

Postby Kambiz » September 5th, 2003, 2:40 pm

I had added the extension but I had forgotten to activate it. :oops:

Because you didn't use any image in your report, you don't need to set FastPrint to False. As I already mentioned, it this way the print process is faster and the font qualility is also much better.

When you set the FastPrint property to False, TPrintPreview convert Metafile image of the page to device independent bitmap, and send this bitmap to the printer.

Probably you are using a high resolution printer on Windows 98, and because of that the DIB Bitmap size is bigger than what Windows 98 supports.

By the way, I removed you second attachment and changed the extension of the first one to ppv.

Regards,
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

TPRintPreview

Postby Alex » September 8th, 2003, 7:29 am

Ok Kambiz, thank you for your attention.
Your component are the best component for delphi. :wink:

Regards
Alex
Alex
Member
Member
 
Posts: 4
Joined: September 4th, 2003, 8:31 am

Postby Kambiz » September 8th, 2003, 11:38 am

Thank you.
This is so kind of you.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 5 guests

cron