I downloaded PreviewSuit 4.60 and compiled "General Demo", Preview works fine but when i send this preview to printer , all output pages clipped some from the bottom of the pages. So the output and preview becomes different from each others. (For both inkjets and laser printers).
Finally, i realized that the problem comes from "SetPrinterOptions" Code.
In this Code, Printer PaperSize is set for only if (ActiveForm = '') or (Win32Platform <> VER_PLATFORM_WIN32_NT). But if you have already selected a paper (means ActiveForm and papersize), printer papersize is not set and the problem occurs.
So I made a modification in the "SetPrinterOptions" routine below;
Replace:
if (ActiveForm = '') or (Win32Platform <> VER_PLATFORM_WIN32_NT) then
begin
...........................
...........................
end;
With:
if (ActiveForm = '') or (Win32Platform <> VER_PLATFORM_WIN32_NT) then
begin
...........................
...........................
end
else
begin
dmFields := dmFields or DM_PAPERSIZE;
DmPaperSize := PaperSizes[FPaperType].ID;
end;
---------------------------------------------------------------------------------
The important point is that you have to assign correct value to FpaperType after changing activeform (new papertype and also papersize) before printing. So you can do this easly by using the code below:
with printpreview do
begin
PaperType:=TpaperType( NewPaperID ); // NewPaperId:=9 for A4 Form
end;
For general demo, this code should be;
procedure TPreviewForm.FormComboBoxChange(Sender: TObject);
begin
with PrintPreview do
begin
if FormComboBox.ItemIndex >= 0 then
FormName := FormComboBox.Items[FormComboBox.ItemIndex];
PaperType:=TpaperType(FormComboBox.ItemIndex);
end;
Now, Everyting works fine for me.
Salpay.