Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 26-05-2003
__cadetill __cadetill is offline
Miembro
 
Registrado: may 2003
Posts: 3.387
Poder: 27
__cadetill Va por buen camino
Hola fanon

Normalmente los visores necesitan de un codigo de escape para inicializarlos (o a lo mejor llevan algun programa o driver para ello). Mirate la documentacion a ver.

De todas maneras, para crear una impresora seria algo asi

Código:
Procedure AddImpresora( PrinterName, PortName, DriverName,
                      PrintProcessor: string );
var
   pName    : PChar;
   Level    : DWORD;
   pPrinter : PPrinterInfo2;
begin
     pName := nil;
     Level := 2;
     New(pPrinter);
     try
        pPrinter^.pServerName := nil;
        pPrinter^.pShareName := nil;
        pPrinter^.pComment := nil;
        pPrinter^.pLocation := nil;
        pPrinter^.pDevMode := nil;
        pPrinter^.pSepFile := nil;
        pPrinter^.pDatatype := nil;
        pPrinter^.pParameters := nil;
        pPrinter^.pSecurityDescriptor := nil;
        pPrinter^.Attributes := 0;
        pPrinter^.Priority := 0;
        pPrinter^.DefaultPriority := 0;
        pPrinter^.StartTime := 0;
        pPrinter^.UntilTime := 0;
        pPrinter^.Status := 0;
        pPrinter^.cJobs := 0;
        pPrinter^.AveragePPM :=0;

        pPrinter^.pPrinterName := PCHAR(PrinterName);
        pPrinter^.pPortName := PCHAR(PortName);
        pPrinter^.pDriverName := PCHAR(DriverName);
        pPrinter^.pPrintProcessor := PCHAR(PrintProcessor);
        // 1802 -> Este código de Error nos indica que la impresora ya existe.
        if (AddPrinter(pName, Level, pPrinter) = 0) and (GetlastError <> 1802) then
        begin
             Raise Exception.Create('La Impresora no se pudo crear');
        end;
     finally
            Dispose(pPrinter);
     end;
end;
Lo malo del método es que necesitas tener los drivers de la impresora en el sistema

Espero te sirva
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


La franja horaria es GMT +2. Ahora son las 04:41:19.


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