hello

i want to print my customers invoice in dos print.

the customer is using roll paper. for tearing purpose i have ejected some part of the paper. for the next bill the printer should automatically bring the paper where it has been teared. what is the code.

i am using delphi.

regards
sridhar

Try this. Comments in Russian, translated laziness. It should be clear.

var
  myFile : TextFile;
  printDialog : TPrintDialog;

begin
  // Создание диалога выбора принтера
  printDialog := TPrintDialog.Create(Form1);

  // Если пользователь выбрал принтер (или значение по умолчанию), то печатайте!
  if printDialog.Execute then
  begin
    // Попытка открыть файл принтера
    AssignPrn(myFile);

    // Теперь подготовливаемся дляя записи на принтер
    ReWrite(myFile);

    // Запишите несколько известных слов в этот файл -
    // вместо этого они будут напечатаны
    WriteLn(myFile, 'Hello');
    WriteLn(myFile, 'World');

    // Закрытие фала
    CloseFile(myFile);
  end;
end;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.