|
|
|
|
|
 |
delphi 在打印中间改变打印设置 |
| |
日期:2007-06-23 02:52:00
点击:14 评论:0 |
|
if not odd(PageNumber) then begin
pDMode^.dmFields := pDMode^.dmFields or dm_PaperSize;
pDMode^.dmPaperSize := DMPAPER_LETTER;
end else begin
pDMode^.dmFields := pDMode^.dmFields or dm_PaperSize;
pDMod |
|
 |
delphi 获取打印机边距 |
| |
日期:2007-06-23 02:50:52
点击:8 评论:0 |
|
if Escape(Printer.Handle,
GETPHYSPAGESIZE,
0,
nil,
@Margin) > 0 then begin
Margin.x := (Margin.x -
GetDeviceCaps(Printer.Handle, H |
|
 |
delphi 判断打印机是否能打印图像 |
| |
日期:2007-06-23 02:49:02
点击:8 评论:0 |
|
if (GetDeviceCaps(Printer.Canvas.Handle, RASTERCAPS) and
RC_NONE) = RC_NONE then
NoGraphics := True;
if (GetDeviceCaps(Printer.Canvas.Handle, RASTERCAPS) and
RC_STRETCHDIB) = RC_STRETCHDIB then
DeviceDirectly SupportsStretchDIB := True e |
|
 |
delphi 检测打印缓冲池中打印任务数 |
| |
日期:2007-06-23 02:47:09
点击:9 评论:0 |
|
Lable1.Caption := IntToStr(msg.JobsLeft) +
' Jobs currenly in spooler';
msg.Result := 0; |
|
 |
delphi 检测存在打印机 |
| |
日期:2007-06-23 02:46:24
点击:19 评论:0 |
|
Printers是专门用来控制打印机的,可是在没有安装打印机时,却会提示I/O错误,所以必须有一个检测是否存在打印机的方法,我试过很多方法,可是I/O错误总是比我的判断早出现,所以采用以下的烂招来检测打印机。首先在uses增加Printers,再准备一个列表框ComboBox1,其属 |
|
 |
delphi 切换打印机的彩色模式 |
| |
日期:2007-06-23 02:45:09
点击:9 评论:0 |
|
PrinterIndex := PrinterIndex;
GetPrinter(Device, Driver, Port, hDMode);
if hDMode <> 0 then begin
pDMode := GlobalLock(hDMode);
if pDMode <> nil then begin
pDMode.dmFields := pDMode.dmFields or dm_Color;
|
|
 |
delphi 调用添加打印对话框 |
| |
日期:2007-06-23 02:44:13
点击:7 评论:0 |
|
ShellExecute(Handle, 'open', 'rundll',
'shell32.dll,SHHelpShortcuts_RunDLL AddPrinter', '', SW_SHOWNORMAL); |
|
 |
delphi 判断打印机是否黑白 |
| |
日期:2007-06-23 02:43:03
点击:7 评论:0 |
|
IsMonochrome := (GetDeviceCaps(Printer.Handle, BITSPIXEL) *
GetDeviceCaps(Printer.Handle, PLANES)) = 1; |
|
 |
delphi 枚举打印缓冲池打印任务 |
| |
日期:2007-06-23 02:41:38
点击:7 评论:0 |
|
case Status of
0: Result := 'Waiting';
JOB_STATUS_PAUSED: Result := 'Paused';
JOB_STATUS_ERROR: Result := 'Error';
JOB_STATUS_DELETING: Result := 'Deleting';
|
|
 |
delphi 枚举打印缓冲 |
| |
日期:2007-06-23 02:41:38
点击:6 评论:0 |
|
uses Printers, WinSpool; function PrinterStatusText(Status: Integer): String; begin case Status of 0: Result := 'Waiting'; JOB_STATUS_PAUSED: Result := 'Paused'; JOB_STATUS_ERROR: Result := 'Error'; JOB_STATUS_DELETING: Result := 'Deleting'; JOB_STA |
|
 |
delphi 获得打印驱动版本信息 |
| |
日期:2007-06-23 02:40:39
点击:6 评论:0 |
|
PrtName: String;
DriverInfo: PDriverInfo2;
dwNeeded: DWord;
begin
PrtName := comboPrinters.Text;
OpenPrinter( PChar( PrtName ) , hPrinter , nil );
GetPrinterDriver( hPrinter, nil, 2, DriverInfo, 0, dwNeeded );
GetM |
|
 |
delphi 获得打印机解析度 |
| |
日期:2007-06-23 02:39:35
点击:7 评论:0 |
|
function GetPageWidth: Integer;
begin
Result := Screen.PixelsPerInch*GetDeviceCaps(Printer.Handle,
PHYSICALWIDTH) div GetPixelsPerInchX
end;
|
|
 |
delphi 设定缺省打印机 |
| |
日期:2007-06-23 02:38:23
点击:7 评论:0 |
|
Use this on form create (or whatever)...
ComboBox1.Items := Printer.Printers; {populates ComboBox}
ComboBox1.ItemIndex := Printer.PrinterIndex; {sets display to current
printer}
then, assuming you have a Button5...
|
|
 |
delphi 改变打印机字符集 |
| |
日期:2007-06-23 02:37:17
点击:9 评论:0 |
|
Constant Value Description
ANSI_CHARSET 0 ANSI characters.
DEFAULT_CHARSET 1 Font is chosen based solely on Name and Size. If the described font is not available on the system, Windows will substitute another font.
SYMBOL_CHARSET 2 Standard |
|
 |
delphi 调出添加打印机向导 |
| |
日期:2007-06-23 02:36:37
点击:9 评论:0 |
|
ShellExecute(Handle, 'open', 'rundll',
'shell32.dll,SHHelpShortcuts_RunDLL AddPrinter', '', SW_SHOWNORMAL);
|
|
|
|
|
|
|
|