You are not logged in.
Pages: 1
Hi,
I found a way to make Pictures as a Background or Watermark Image, but how to do this with a PDF?
Offline
Sorry here is a better description of my problem.
I export a Quickreport file to PDF.
Pdf := TPdfDocument.Create();
try
Pdf.DefaultPaperSize := psA4;
Pdf.UseUniscribe := False;
Pdf.EmbeddedTTF := true;
Pdf.EmbeddedWholeTTF := False;
Pdf.UseOptionalContent := True;
Pdf.StandardFontsReplace := False;
Pdf.CompressionMethod := cmFlateDecode;
// pic := TPicture.Create;
// pic.LoadFromFile('C:\tmp\img_snow.jpg');
// background := TPdfImage.Create(PDF, pic.Graphic, true);
// PDF.AddXObject('BackgroundImage',background);
TDesignQuickReport(qrd.ParentControl).Prepare;
for i := 1 to TDesignQuickReport(qrd.ParentControl).QRPrinter.PageCount do begin
aMeta := TDesignQuickReport(qrd.ParentControl).QRPrinter.GetPage(i);
try
Pdf.DefaultPageWidth := MulDiv(aMeta.Width,72,Pdf.ScreenLogPixels);
Pdf.DefaultPageHeight := MulDiv(aMeta.Height,72,Pdf.ScreenLogPixels);
page := Pdf.AddPage;
// PDF.Canvas.DrawXObject(0,0,page.PageWidth,page.PageHeight,'BackgroundImage');
Pdf.Canvas.RenderMetaFile(aMeta, 1,0, 0,0, tpExactTextCharacterPositining, 0, 0, tcNeverClip);
finally
aMeta.Free;
end;
end;
Pdf.SaveToFile(SaveFileName);
it works with images, but I need to use it with a pdf file
Offline
The same way like the jpg?
Offline
Pages: 1