Thanks for the question, One workaround could be to first determine the total number of pages in your document, and then use that number instead of -1.
Here’s an example of how you can determine the number of pages in a PDF file using iTextSharp.
using iTextSharp.text.pdf;
PdfReader pdfReader = new PdfReader(pdfFilePath);
int numberOfPages = pdfReader.NumberOfPages;
Once you have the total number of pages, you can modify your AnalyzeDocumentOptions
to analyze the first and last pages like this:
AnalyzeDocumentOperation operation = await client.AnalyzeDocumentFromUriAsync(WaitUntil.Completed, modelId, fileUri, new AnalyzeDocumentOptions() { Pages = { "1", numberOfPages.ToString() } });