Hi,
I am drawing a report to a canvas to get a print preview. When displayed, the page on the canvas differs from the one I get when I print to PDF Preview(Mac OS Preview) or the real printer. The left and top margin are to small(actually almost 0).
This is how I generate my picture do draw on the canvas;
ps = new PrinterSetup
ps.MaxHorizontalResolution = -1
ps.MaxVerticalResolution = -1 // gets me the max. Printer Resolution --> needs to be scaled in the report
if ps.PageSetupDialog then
thePS = ps
else
return
end if
gPict = new picture(ThePS.pageWidth, ThePS.pageHeight, 32)
myReport(gPict.Graphics,ThePS,0)
In my report I scale the resolution recieved from the printer to display the report;
xScaleFactor = ThePS.HorizontalResolution / 72.0
yScaleFactor = ThePS.VerticalResolution / 72.0
I then build my report with the information from “ThePS”
ThePS.Left for the left margin
ThePS.Top for the top margin
The output in the canvas seems to miss the first lines. Left and top margin are actually 0 (zero) on the canvas.
In the printed report they are as specified by the printer settings.
What am I missing ? Any ideas ? How do you generate a print preview and how do you scale the printer resolution ?
Thanks in advance,
wop