I'm previewing a one page document. I setup a twprichtext instance (below), and assign it to the editbox property. In wp4, it displayed as landscape, as intended, but in wp6 it doesn't.
Code
with RT do begin //twprichtext dynamic
PrintParameter.AllPagePaperSource := paperSourceIndexFromBinName(PrinterSettings.PaperSource);
PrintParameter.FirstPagePaperSource := paperSourceIndexFromBinName(PrinterSettings.PaperSource);
Header.PageSize := wp_Letter;
DefaultFontSize := FontSize;
CurrAttr.Size := FontSize;
Header.TopMargin := TopMargin;
Header.LeftMargin := LeftMargin;
Header.Landscape := True;
end;
setupPrinter; //sets up windows printer.
fillchar(prp,sizeof(tparprops),0);
prp.Attr := rt.Attr;
with rt do begin
clearbody;
RT.Header.PageSize := wp_Letter;
CPPosition := maxint;
FastInputParagraph;
Loaded;
prp.Text := 'PRINTED '+formatdatetime('hh:nn a/p ddd dd-mmm-yyyy',sysutils.Now);
FastInputText(prp);
ReformatAll;
Refresh;
end;
Alles anzeigen