Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Impresión
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 05-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
Problema al imprimir la Ñ .

Tengo la siguiente función en delphi donde mando a imprimir un archivo de texto a una impresora matricial, no imprime la Ñ ó ñ, me imprime un caracter raro Ð, abro el mismo archivo de texto en el bloc de notas y si aparece la Ñ y si imprimo en el ms-dos(copy File.txt \\PC\Print) el archivo de texto no me imprime la Ñ me imprime el mismo signo raro Ð:
Código Delphi [-]
function SpoolFile(const FileName, PrinterName: string): Integer;
var
Buffer: record
JobInfo: record // ADDJOB_INFO_1
Path: PChar;
JobID: DWORD;
end;
PathBuffer: array[0..255] of Char;
end;
SizeNeeded: DWORD;
Handle: THandle;
PrtName: string;
ok: Boolean;
begin
// Flush job to printer
PrtName := PrinterName;
if PrtName = '' then
PrtName := Printer.Printers[Printer.PrinterIndex]; // Default printer name
ok := False;
if OpenPrinter(PChar(PrtName), Handle, nil) then
if AddJob(Handle, 1, @Buffer, SizeOf(Buffer), SizeNeeded) then
if CopyFile(PChar(FileName), Buffer.JobInfo.Path, True) then
if ScheduleJob(Handle, Buffer.JobInfo.JobID) then
ok := True;
if not ok then
Result := GetLastError
else
Result := 0;
end;
Esta función lo que me sirve es tomar el archivo y mandar a cierta impresora dependiendo del nombre de la misma.

Agradezco cualquier sugerencia

Última edición por AGAG4 fecha: 06-10-2005 a las 00:53:24.
Responder Con Cita
  #2  
Antiguo 06-10-2005
pcicom pcicom is offline
Miembro
 
Registrado: may 2003
Ubicación: MONTERREY MEXICO
Posts: 253
Poder: 21
pcicom Va por buen camino
Re: Problema al imprimir Ñ

Debes de asegurarte de que tu impresora tenga configurado el set de caracteres correcto que corresponda,, generalmente las impreroras matriciales tienen un set de configuracion donde habilitas el tipo de set de caracteres a utilziar, la mayoria biene para un set USA, el cual incluye por default USA..
__________________
Poco ha de saber el que no pregunta.. Yo por eso soy un pregunton
Responder Con Cita
  #3  
Antiguo 06-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
oki

Gracias por la Ayuda, pero lo corregí de la siguiente forma, antes de imprimir cambie el caracter Ñ por el que le corresponde en ASCII:
Código Delphi [-]
function OEMToString(Str:String):String;
var x:integer;
begin
  result:='';
  for x:=1 to length(Str) do
    if Str[x]='Ñ' then
      result:=result+Chr(165)
    else  
    if Str[x]='ñ' then
      result:=result+Chr(164)
    else
      result:=result+Str[x];
end;

Que tenga buen día.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 10:22:26.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi