Page 1 of 1

TPrintPreview problem with custom paper size

PostPosted: May 7th, 2007, 11:33 am
by monichen
Hello
Iam facing a problem with TPP
Using PrintPreview v4.60 & TPaperPreview v1.03,
OS - Windows 2000, Delphi 5.0
I have a custom paper size defined- width = 283.97mm & length = 186.94mm
If the paper size is 'letter' or A4 everything looks OK
But in the application if I dynamically change the the paper size to above custom size, output is distorted, fonts are diminished .
I have attached the output file, a ppv file for your reference
I will ll be so happy if somebody can help me.

Thank you!

PostPosted: May 7th, 2007, 1:43 pm
by Kambiz
Sorry, but the attached file doesn't help.
Could you please post a sample code?

PostPosted: June 22nd, 2007, 5:46 am
by monichen
Sorry for the late reply. Now I have a different question.
Can you please tell me how can I get default printer's paper size(a custom size) and pass it to the PrintPreview component.
Even if I hard code form name as in the following code, it re-calculates paper size with different height and width values
(I can see it in the SetPaperSize event)
Code: Select all
PrintPrevForm.PrintPreview.UsePrinterOptions := True
PrintPrevForm.PrintPreview.formName := 'CUST_SIZE';
PrintPrevForm.PrintPreview.PaperType := pCustom;
PrintPrevForm.PrintPreview.SetPrinterOptions;
Please help me

PostPosted: June 22nd, 2007, 12:31 pm
by Kambiz
You can call GetPrinterOptions to retrieve settings of the printer including its current form name and paper size of the selected custom paper.