O
oushengfen
Unregistered / Unconfirmed
GUEST, unregistred user!
Printer.PrinterIndex := Printer.PrinterIndex;
//不需要设置,使之打印为默认打印机
Printer.GetPrinter(Device, Driver, Port, hDMode);
if hDMode <> 0 then
begin
pDMode := GlobalLock(hDMode);
if pDMode <> nil then
begin
{Set to custom size}
if PaperType=6 then
begin
pDMode^.dmFields := pDMode^.dmFields or DM_PAPERSIZE Or DM_PAPERLENGTH
Or DM_PAPERWIDTH;
pDMode^.dmPaperSize := DMPAPER_USER;
pDMode^.dmPaperWidth := SetIni.CustomDefinPagerWidth;
pDMode^.dmPaperLength := SetIni.CustomDefinPagerHeight;
end else
begin
pDMode^.dmFields := pDMode^.dmFields or DM_PAPERSIZE;
pDMode^.dmPaperSize := PaperSet[PaperType];
end;
end;
{设定纸张来源}
pDMode^.dmFields := pDMode^.dmFields or DMBIN_MANUAL;
pDMode^.dmDefaultSource := DMBIN_AUTO;
//i := pDMode^.dmLogPixels;
GlobalUnlock(hDMode);
end;
Printer.Orientation := poPortrait;
Printer.Copies := iCopies;
Printer.PrinterIndex := Printer.PrinterIndex;
with Redo
begin
SelectAll;
SelAttributes.Size := PrnSize;
Paragraph.Numbering := nsNone;
Paragraph.FirstIndent := PrnLeft;
Paragraph.RightIndent := PrnLeft;
Print('XX');
end;
如何在上面改为双面打印及打印相应的页码?
//不需要设置,使之打印为默认打印机
Printer.GetPrinter(Device, Driver, Port, hDMode);
if hDMode <> 0 then
begin
pDMode := GlobalLock(hDMode);
if pDMode <> nil then
begin
{Set to custom size}
if PaperType=6 then
begin
pDMode^.dmFields := pDMode^.dmFields or DM_PAPERSIZE Or DM_PAPERLENGTH
Or DM_PAPERWIDTH;
pDMode^.dmPaperSize := DMPAPER_USER;
pDMode^.dmPaperWidth := SetIni.CustomDefinPagerWidth;
pDMode^.dmPaperLength := SetIni.CustomDefinPagerHeight;
end else
begin
pDMode^.dmFields := pDMode^.dmFields or DM_PAPERSIZE;
pDMode^.dmPaperSize := PaperSet[PaperType];
end;
end;
{设定纸张来源}
pDMode^.dmFields := pDMode^.dmFields or DMBIN_MANUAL;
pDMode^.dmDefaultSource := DMBIN_AUTO;
//i := pDMode^.dmLogPixels;
GlobalUnlock(hDMode);
end;
Printer.Orientation := poPortrait;
Printer.Copies := iCopies;
Printer.PrinterIndex := Printer.PrinterIndex;
with Redo
begin
SelectAll;
SelAttributes.Size := PrnSize;
Paragraph.Numbering := nsNone;
Paragraph.FirstIndent := PrnLeft;
Paragraph.RightIndent := PrnLeft;
Print('XX');
end;
如何在上面改为双面打印及打印相应的页码?