## TPrintPreview problem with custom paper size

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

### TPrintPreview problem with custom paper size

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!
Attachments
PrintPreview.ppv
ppv file that displays wrong output
monichen
Member

Posts: 2
Joined: April 19th, 2007, 11:17 am
Location: Bangalore, India

Sorry, but the attached file doesn't help.
Could you please post a sample code?
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

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 := TruePrintPrevForm.PrintPreview.formName := 'CUST_SIZE';PrintPrevForm.PrintPreview.PaperType := pCustom; PrintPrevForm.PrintPreview.SetPrinterOptions;
monichen
Member

Posts: 2
Joined: April 19th, 2007, 11:17 am
Location: Bangalore, India

You can call GetPrinterOptions to retrieve settings of the printer including its current form name and paper size of the selected custom paper.
Kambiz

Kambiz