Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2005.01.30;
Скачать: [xml.tar.bz2];

Вниз

А если принтеров несколько. Как назначить нужный?   Найти похожие ветки 

 
odessey   (2005-01-11 17:35) [0]

Необходимо распечатать файл.
 AssignFile(FileTxt,"с:\1.txt);
 AssignPrn(PrintTxt);
 Reset(FileTxt);
 Rewrite(PrintTxt);
 while Not EOF(FileTxt) do
 begin
  Readln(FileTxt, TempStr);
  Writeln(PrintTxt, TempStr);
 end;
 CloseFile(FileTxt);
 CloseFile(PrintTxt);
А если принтеров несколько. Как назначить нужный?


 
Семен Сорокин ©   (2005-01-11 17:36) [1]

printers.pas

Printer.PrinterIndex


 
Ega23 ©   (2005-01-11 17:38) [2]

TPrintDialog ?


 
odessey   (2005-01-11 17:40) [3]


> Ega23 ©   (11.01.05 17:38) [2]
> TPrintDialog ?

пробывал..не хочет...(


 
Darrin ©   (2005-01-11 17:42) [4]

а SetPrinter() ?


 
odessey   (2005-01-11 17:42) [5]


> Семен Сорокин ©  

если не трудно по-подробнее


 
Ega23 ©   (2005-01-11 17:42) [6]

пробывал..не хочет...(

Код в студию!


 
odessey   (2005-01-11 17:46) [7]

:)

> Ega23

PrintDialog1.Execute then
begin
  AssignFile(FileTxt,"с:\1.txt);
AssignPrn(PrintTxt);
Reset(FileTxt);
Rewrite(PrintTxt);
while Not EOF(FileTxt) do
begin
 Readln(FileTxt, TempStr);
 Writeln(PrintTxt, TempStr);
end;
CloseFile(FileTxt);
CloseFile(PrintTxt);
end;

....игнорирует....


 
odessey   (2005-01-11 17:51) [8]

эм....прошу прощения....разобрался :)


 
odessey   (2005-01-11 18:22) [9]

А так не получается

if PrintDialog1.Execute then
 CopyFileTo("c:\1.txt","PRN") ;

У меня 2 принтера, локальный и сетевой......назначаю сетевой, все равно пускает печать на локальный(


 
XmeD   (2005-01-12 19:30) [10]

У меня 2 принтера, локальный и сетевой......назначаю сетевой, все равно пускает печать на локальный(

Читай внимательно

Семен Сорокин ©   (11.01.05 17:36) [1]
printers.pas

Printer.PrinterIndex


Прописывай в
Uses
 Printer

...

Printer.PrinterIndex := i;


 
XmeD   (2005-01-12 19:30) [11]

У меня 2 принтера, локальный и сетевой......назначаю сетевой, все равно пускает печать на локальный(

Читай внимательно

Семен Сорокин ©   (11.01.05 17:36) [1]
printers.pas

Printer.PrinterIndex


Прописывай в
Uses
 Printer

...

Printer.PrinterIndex := i;


 
odessey   (2005-01-12 19:35) [12]


> XmeD

пробывал....все равно посылает на локальный


 
XmeD   (2005-01-12 20:38) [13]

>odessey  

Specifies the current printer.

Delphi syntax:

procedure SetPrinter(ADevice, ADriver, APort: PChar; ADeviceMode: THandle);

C++ syntax:

void __fastcall SetPrinter(char * ADevice, char * ADriver, char * APort, int ADeviceMode);

Description

Call SetPrinter to change the current printer.

ADevice specifies the device name of the new printer. This is the name that appears in the Print Manager (for example, "Epson FX-80"). It is not the printer model name.

ADriver specifies the driver name for the new printer (usually ‘WINSPOOL’).

APort is included for backward compatibility. It should be set to an empty string.

DeviceMode is the handle to a memory buffer device-specific initialization data for the device driver. This handle can be obtained by calling the GlobalAlloc function to allocate a DeviceMode record (Delphi) or DEVMODE structure (C++).


 
XmeD   (2005-01-19 13:45) [14]

> XmeD   (12.01.05 20:38) [13]

http://delphiworld.narod.ru/base/set_def_printer.html



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2005.01.30;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.48 MB
Время: 0.037 c
3-1103788002
Scorpio
2004-12-23 10:46
2005.01.30
Аналог команды Like из SQL для использования в таблице.


1-1105914329
Bobby Digital
2005-01-17 01:25
2005.01.30
Center


14-1104169299
DiamondShark
2004-12-27 20:41
2005.01.30
Нет слов.


3-1102971229
serko
2004-12-13 23:53
2005.01.30
QReport


3-1104135615
come
2004-12-27 11:20
2005.01.30
тукущая запись в dbgrid





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский