tAdvPDFLib and pagination

Hi

Is it possible to change the position of the page number depending on whether it is even or odd?

We have an event OnBeforeDrawFooter, where the text "Footer" is drawn. The event can be hooked up (programmaticall), and then the alignment can be changed:

procedure TForm14.AdvPDFLib1BeforeDrawfooter(Sender: TObject;
  APageIndex: Integer; Afooter: UnicodeString; ARect: TRectF;
  AGraphics: IAdvCustomPDFGraphicsLib; var ADefaultDraw: Boolean);
begin
  if Odd(APageIndex + 1) then
    AGraphics.Alignment := gtaTrailing  // Odd pages: right
  else
    AGraphics.Alignment := gtaLeading;  // Even pages: left
end;

Thanks

when I copy this Procedure, I received this error message :

E2003 Identificateur non déclaré : 'IAdvCustomPDFGraphicsLib' à la ligne 65 (65:14)

Something in "Uses" missing ?

et

E2009 Types incompatibles : 'pointeur de méthode et procédure normale' à la ligne 974 (974:56)

when I assign the procedure to the Event :

Pdf.OnBeforeDrawFooter := AdvPDFLib1BeforeDrawfooter;

Add the AdvPDFGraphicsLib units.

I placed the PDF handling in a simple unit, and when I assigned a procedure to the “OnBeforeDrawFooter” event, it generated an E2009 error:

“Incompatible types: ‘method pointer and normal procedure’” on line 974.

Therefore, I need to use a DataModule instead of a simple “Unit.” and in that case, it works