| sbussinger wrote: | ||
My second problem was also related to GetPrinterPageBounds() routine. It returns values based on the physical size of the page rather than the logical size of the page. In my case that's an issue, but it may be better the way it is for everyone else. My problem arises because inkjets tend to have much larger bottom margins than laser printers and my output was getting cropped. I'd like to propose this change to GetPrinterPageBounds():
This would mean that if UsePrinterOptions is true, that the page size is based on the printable area of the page rather than on the full size of the page in question. Any thoughts? |
| Code: |
|
// This function should be called immediately after 'BeginDoc' function GetPrintableRect : TRect; begin with PrintPreview do begin Result.Left := ConvertUnits(GetDeviceCaps(Printer.Handle, PHYSICALOFFSETX), GetDeviceCaps(Printer.Handle, LOGPIXELSX), mmPixel, Units); Result.Top := ConvertUnits(GetDeviceCaps(Printer.Handle, PHYSICALOFFSETY), GetDeviceCaps(Printer.Handle, LOGPIXELSY), mmPixel, Units); Result.Right := Result.Left + ConvertUnits(Printer.PageWidth, GetDeviceCaps(Printer.Handle, LOGPIXELSX), mmPixel, Units); Result.Bottom := Result.Top + ConvertUnits(Printer.PageHeight, GetDeviceCaps(Printer.Handle, LOGPIXELSY), mmPixel, Units); end; end; |
output generated using printer-friendly topic mod. All times are GMT