PDA

Ver la Versión Completa : Error Marca de Agua en pdf


chozas
15-03-2007, 19:28:20
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.


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.