不知道你是怎么解决的,刚好找到到了一些资料,就是我以前所的那个函数:
如何在不同的打印分辨率下面打印?
下面给出一个函数,在调用这个函数之后,你就可以使用Font.Size来设置字体的大小而与打印机分辨率无关了。
注意必须在Printer.begin
Doc之后调用这个函数!
{-------------------------------------------------------------
Sets the logicaldo
ts per inch for the printer and sets the printer axes to point RIGHT anddo
WN. Thus (0,0) is at the top left corner of the page. Returns the page size in logical coordinates.
Note: Must be called AFTER Printer.begin
Doc.
--------------------------------------------------------------}
function SetPrinterScale(dpi : integer) : TPoint;
var
DeviceDpiX, DeviceDpiY : integer;
begin
with Printerdo
begin
SetMapMode(Handle, MM_ISOTROPIC);
SetWindowExt(Handle, dpi, dpi);
DeviceDpiX := GetDeviceCaps(Handle, LOGPIXELSX);
DeviceDpiY := GetDeviceCaps(Handle, LOGPIXELSY);
SetViewPortExt(Handle, DeviceDpiX, DeviceDpiY);
Result := Point(PageWidth, PageHeight);
with Canvasdo
begin
DPtoLP(Handle, Result, 1);
{ This API call is required... }
Font.PixelsPerInch := DPI;
{ ...to make this work. (Who knows why?) }
end;
end;
end;