Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Desarrollo en Delphi para Android
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy


 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 19-05-2021
pruz pruz is offline
Miembro
 
Registrado: sep 2003
Posts: 225
Poder: 23
pruz Va por buen camino
memo1.lines.Add(aBlueDevices.Items[i].DeviceName);
Gracias amigos.
ya solucione el problema de la impresion, se debe manejar como un dispositivo Bluetoon.
les dejo el codigo si alguien lo necesita.


Código Delphi [-]
//ESTA RUTINA BUSCA EL DISPOSITIVO
Var

  Msg, Texto, ServiceGui, ServiceName: string;
  BluetoothAdapter: TBluetoothAdapter;
  FBluetoothManager : TBluetoothManager;
  ListaDeAparelhosPareados: TBluetoothDeviceList;
  LServices: TBluetoothServiceList; 

BEGIN

try
   
    FBluetoothManager := TBluetoothManager.Current;
    BluetoothAdapter := FBluetoothManager.CurrentAdapter;
    ListaDeAparelhosPareados := BluetoothAdapter.PairedDevices;


    for I := 0 to ListaDeAparelhosPareados.Count - 1 do
    begin
      LDevice := ListaDeAparelhosPareados[i] as TBluetoothDevice;
       LABEL1.cAPTION := LDevice.DeviceName;  //NOMBRE DEL DISPOSITIVO

      if LDevice.IsPaired then
      begin
        LServices := LDevice.GetServices;
        for B := 0 to LServices.Count - 1 do
        begin
          ServiceGUI := GUIDToString(LServices[b].UUID);
          Guid := LServices[b].UUID;
          ServiceName := LServices[b].Name;
        end;
      end;
    end;
  except
   on E: Exception do
   begin
     Msg := E.Message;
     ShowMessage('Error al Conectar la Impresora ' + Msg) ;
   end;
 end;




END;



//Y ESTA IMPRIME

BEGIN

    FSocket := LDevice.CreateClientSocket(Guid, true);
    if FSocket = nil then BEGIN
        Memo1.Lines.Add('FSocket nulo');
        EXIT;
    END;


   if Assigned(FSocket) and (FSocket <> nil)
   then Begin

        if NOT FSocket.Connected then FSocket.Connect;
         TRY

            lineax := #27 + ' ' + #13#10;
            lineax := #27#69#49  + 'Prueba Teste 1 ' + #13#10;
            lineax := lineax + #27#69#48 + 'Prueba Teste 2 ' + #13#10;
            lineax := lineax + #27 + 'hola 3 ' + #13#10;
            lineax := lineax + #27#69#49 + 'Prueba Teste 4 ' + #13#10;
            lineax := lineax + #27 + 'hla 5 ' + #13#10;
            lineax := lineax + #27#69#48 + ' Prueba Teste 5 ' + #13#10;
            lineax := lineax +  #13#10;

            Texto := lineax ;

            ToSend := TEncoding.UTF8.GetBytes(Texto);
            FSocket.SendData(ToSend);
            Sleep(100);



         EXCEPT
             MENSAJEMSG('NO CONECTADO Imprimir 1 ');
         END;
   End else begin

      MENSAJEMSG('NO CONECTADO Imprimir 2 ');

   end;
END.

Última edición por Casimiro Noteví fecha: 19-05-2021 a las 22:33:18.
Responder Con Cita
 



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Impresión web Cañones .NET 0 19-05-2010 21:40:23
impresion inprosis Impresión 1 26-03-2010 09:32:36
Fin de Impresion luxus Impresión 3 19-12-2007 00:45:32
Impresion con Rav Alejandro73 Impresión 0 21-06-2007 19:27:02
Problema de impresion Detener la Impresion Gangster Impresión 2 26-01-2007 19:22:12


La franja horaria es GMT +2. Ahora son las 23:48:01.


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