#1 PDF Engine » Background Image » 2012-02-28 12:43:42

Bulldog1100
Replies: 1

Hello,
I like to create a background imagefile for every page of the pdf.

I tried to use this code

PDF := TPDFDocument.Create;
Image := TPdfImage.CreateJpegDirect(pdf, 'BackgroundImage.jpg');
Pdf.AddXObject('BackgroundImage', Image);
for i := 0 to PageCount-1 do
begin
  page := PDF.AddPage;
  Pdf.Canvas.DrawXObject(0, 0, page.PageWidth, page.PageHeight, 'BackgroundImage');
end;

this generates an exception on the AddObject statement
how can i resolve this?

Board footer

Powered by FluxBB