Hi,
in order to watermark a PDF by adding an image to the highest z-index, I got an acceptable result by using a PNG with transparent background + 40% opacity (see image below).
The following code creates an image with transparent background, but I miss the point how to apply 40% opacity to the watermark text in order to get the underlaying text readable.
ievPng := TImageEnView.Create(nil);
try
with ievPng do
begin
IEBitmap.CreateAsAlphaChannel(992, 1403, ieMemory);
LayersAdd('copyrighted extract - ' + FormatDateTime('c', Now), 28, clWebGainsboro, 'Arial');
TIETextLayer(CurrentLayer).Rotate := 60;
TIETextLayer(CurrentLayer).SizeToText();
CurrentLayer.PosX := IELayer_Pos_HCenter;
CurrentLayer.PosY := IELayer_Pos_VCenter;
LayersMergeAll(True);
Proc.SetTransparentColors(CreateRGB(255, 255, 255), CreateRGB(255, 255, 255), 0);
Update;
ImageEnView1.PdfViewer.Objects.AddImage(0, 0, Round(ImageEnView1.PdfViewer.PageWidth * 0.6), Round(ImageEnView1.PdfViewer.PageHeight * 0.6), ievPng.IEBitmap);
end;
finally
ievPng.Free;
end;
ImageEnView1.PdfViewer.ApplyChanges;
ImageEnView1.PdfViewer.SaveToFile(path);
Ale