Чоп этишда қоғоз ўлчамини ўзгартириш.
Uses Printers;
...
procedure TForm1.Button1Click(Sender: TObject);
var
Device: array[0..255] of char;
Driver: array[0..255] of char;
Port: array[0..255] of char;
hDMode: THandle;
PDMode: PDEVMODE;
begin
Printer.PrinterIndex := Printer.PrinterIndex;
Printer.GetPrinter(Device, Driver, Port, hDMode);
if hDMode <> 0 then begin
pDMode := GlobalLock(hDMode);
if pDMode <> nil then begin
pDMode^.dmFields := pDMode^.dmFields or dm_PaperSize;
pDMode^.dmPaperSize := DMPAPER_LEGAL;
pDMode^.dmFields := pDMode^.dmFields or
DM_PAPERSIZE or
DM_PAPERWIDTH or
DM_PAPERLENGTH;
pDMode^.dmPaperSize := DMPAPER_USER;
pDMode^.dmPaperWidth :=100 {Миллиметрда ихтиёрий қиймат бериш мумкин};
pDMode^.dmPaperLength :=100 {Миллиметрда ихтиёрий қиймат бериш мумкин};
pDMode^.dmFields := pDMode^.dmFields or DMBIN_MANUAL;
pDMode^.dmDefaultSource := DMBIN_MANUAL;
GlobalUnlock(hDMode);
end;
end;
Printer.PrinterIndex := Printer.PrinterIndex;
Printer.BeginDoc;
Printer.Canvas.TextOut(100, 100, 'Test 1');
Printer.EndDoc;
end;
Тасвир (расм)ни принтерга чоп этиш
Uses Printers;
...
procedure AngleTextOut(CV: TCanvas; const sText: string; x, y, angle: integer);
Do'stlaringiz bilan baham: |