class function InspectAvailability(AStream: TStream): TPdfAvailability;
| AStream | TStream. Seekable stream holding the PDF. It is read but not retained, and its position is restored on return |
| Result | TPdfAvailability. Record with Linearization (plnUnknown, plnNotLinearized, plnLinearized), DocumentAvailable, FormAvailability (pfaError, pfaNotAvailable, pfaAvailable, pfaNotPresent), and a one-based FirstPageNumber or -1 |
A class method, so it needs no loaded document and no component instance: it answers whether the bytes are linearized, whether a full parse would succeed, and which page a viewer would show first
That is the decision a download path wants before committing: a linearized file can be shown from its first bytes, while a non-linearized one has to arrive completely. FirstPageNumber is -1 when PDFium cannot say
pfaNotPresent is the ordinary form answer for a document with no AcroForm at all, and is not an error