Ver Mensaje Individual
  #2  
Antiguo 06-06-2014
engranaje engranaje is offline
Miembro
 
Registrado: may 2011
Posts: 163
Reputación: 14
engranaje Va por buen camino
Te dejo aqui un procedimiento que puedes probar e igual te sirve de pista para seguir:
Código Delphi [-]
procedure MuestraInfoImpresora;

var
  Log : TstringList;
  i:integer;
  LeftWaste,
  TopWaste,
  TotalPageWidth,
  TotalPageHeight,
  PageWidth,
  PageHeight: integer;

  strDatosImpresora:string;

begin
  Log :=  tstringlist.create;
  try
  if printer.printers.count>0 then
  begin

    Log.add('printers.count > 0');

    try
      LeftWaste:=round(GetDeviceCaps(Printer.Handle,PHYSICALOFFSETX));
      Log.add('LeftWaste = ' + inttostr(LeftWaste));
    except
      Log.add('Error asignando LeftWaste');
    end;

    try
      TopWaste:=round(GetDeviceCaps(Printer.Handle,PHYSICALOFFSETX));
      Log.add('TopWaste = ' + inttostr(TopWaste));
    except
      Log.add('Error asignando TopWaste');
    end;

    try
      TotalPageWidth:=round(GetDeviceCaps(Printer.Handle,PHYSICALWIDTH));
      Log.add('TotalPageWidth = ' + inttostr(TotalPageWidth));
    except
      Log.add('Error asignando TotalPageWidth');
    end;

    try
      TotalPageHeight:=round(GetDeviceCaps(Printer.Handle,PHYSICALHEIGHT));
      Log.add('TotalPageHeight = ' + inttostr(TotalPageHeight));
    except
      Log.add('Error asignando TotalPageHeight');
    end;

    try
      PageWidth:=round(GetDeviceCaps(Printer.Handle,HorzRes)/
                        GetDeviceCaps(printer.Handle,LogPixelsX)*Screen.PixelsPerInch);
      Log.add('PageWidth = ' + inttostr(PageWidth));
    except
      Log.add('Error asignando PageWidth');
    end;

    try
      PageHeight:=round(GetDeviceCaps(Printer.Handle,VertRes)/
                       GetDeviceCaps(printer.Handle,LogPixelsY)*Screen.PixelsPerInch);
      Log.add('PageHeight = ' + inttostr(PageHeight));
    except
      Log.add('Error asignando PageHeight');
    end;

  end
  else
  begin
    Log.add('printers.count <= 0');
  end;

  for i := 0 to Log.count-1 do
  begin
    strDatosImpresora := strDatosimpresora +  #13  + Log.strings[i];
  end;

  MessageDlg(strDatosImpresora, mtInformation,[mbOk], 0);
  finally

  end;
end;
Hay que añadir al uses printers;
Responder Con Cita