Picture / Logo in Header of AdvGridPdfIO

Hi there,

would you consider adding a graphic field in header and footer of AdvGridPdfIO?
(For company Logos)

Or is there already a way to do so manually?

You can do this with AdvGridPDFIO.OnAfterDrawHeader() from where you can draw an image in the header with:


procedure TForm4.AdvGridPDFIO1AfterDrawHeader(Sender, AExportObject: TObject;
  APageIndex: Integer; AHeader: string; ARect: TRectF;
  AGraphics: IAdvCustomPDFGraphicsLib);
begin
  AGraphics.DrawImage()
end;


First of all, you have to find out that TRectF is in "System.Types" and IAdvCustomPDFGraphicsLib is in "AdvPDFGraphicsLib" - so add this to "uses" and you have lower trouble with your system.

BUT: if you try to use AGraphics.DrawImage() or AGraphics.DrawImageFromFile() you allways get an error "there is no overload version of DrawImageFromFile with these parameters" - by the way: it's equal which parameters you are using...I tried a lot but nothing was working.

So, is there an example how to use these function in detail with a bitmap or jpg?

Hartmut

Ok, I found my fault - here is an example which is working:

AGraphics.DrawImageFromFile(ExtractFilePath(Application.ExeName)+'Logo.bmp', clWhite, RectF(5, 5, 100, 150));

Hartmut