property PageCount: Integer;
This read-only property returns the native document page count for ordinary PDFs and the current layout count for active dynamic XFA forms
In v3.126.1, added and removed XFA page events query the completed layout's total count before notifying OnXfaPageCountChanged; earlier versions could confuse the native event's delta with the total
PageNumberOnXfaPageCountChanged
if Pdf1.Active then
Memo1.Lines.Add('PageCount = ' + IntToStr(Pdf1.PageCount));