Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Impresión (https://www.clubdelphi.com/foros/forumdisplay.php?f=4)
-   -   Error Marca de Agua en pdf (https://www.clubdelphi.com/foros/showthread.php?t=41444)

chozas 15-03-2007 19:28:20

Error Marca de Agua en pdf
 
Uso el siguiente procedimiento para colocar en el quickreport (versión 3.0) una imagen a modo de marca de agua. El preview del report lo hace correcto así como la impresión en papel, el problema viene al imprir a pdf con una impresora virtual que coloca la imagen sobre el texto. Probé con varias impresoras virtuales a pdf y el problema es común a todas.

Código Delphi [-]
procedure TFormulario.ImprimeMarcaAgua(QuickRep1:TQuickRep);
var
   bmp : TBitMap;
   R      : TRect;
   X, Y   : integer;
   Cnv    : TCanvas;
   Info : PBitMapInfo;
   InfoSize : DWORD;
   Image : Pointer;
   ImageSize : DWORD;
begin
  TRY

    bmp := TBitMap.Create;
    bmp.Width :=Image1.Picture .Width;
    bmp.Height :=Image1.Picture.Height;
    bmp.Canvas.Draw(0,0,Image1.Picture.Bitmap);

    with QuickRep1.QRPrinter do
    begin
      Y := YPos(PaperLengthValue) div 6;
      X := XPos(PaperWidthValue) div 4;
      R := Rect(X, 2 * Y, 3 * X, 4 * Y);
      Cnv:=Canvas;
    end;//with

    with bmp do
    begin
      GetDIBSizes(Handle, InfoSize, ImageSize);
      GetMem(Info, InfoSize);
      try
         Getmem(Image, ImageSize);
         try
            GetDIB(Handle, Palette, Info^,Image^);
            with Info^.bmiHeader do
               StretchDIBits(Cnv.Handle, R.Left, R.Top,
                             R.Right - R.Left, R.Bottom - R.Top,
                             0, 0, biWidth, biHeight, Image,
                             Info^, DIB_RGB_COLORS, SRCAND );

         finally
            FreeMem(Image, ImageSize);
         end;//try-finally
      finally
         FreeMem(Info, InfoSize);
      end;//try-finally
    end;//with

  FINALLY
    bmp.free
  END;//try-finally
end;

Este procedimiento lo llamo desde el evento AfterPrint de una banda PageFooter.
A ver si alguien me dá una solución a este problema, muchas gracias de antemano.


La franja horaria es GMT +2. Ahora son las 20:06:38.

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