Hello, I used azure.ai.formrecognizer.DocumentAnalysisClient to analyze PDF file, it can only process 2 pages. Do you know why ?

Yu Cai 100 Reputation points
2023-11-16T22:28:43.6066667+00:00

Hello, I used this python Azure SDK to extract the infromation from PDF file, no matter how I change the paramters Pages, it only output 2 pages which are processed. I tired 3 pages or 10 pages PDF files. The len(result.page) is always 2. Do you know why? I asked Google or ChatGPT, no good answers are provided.

my_file =  "three_pages.pdf"   
my_file =  "ten_pages.pdf"  
document_analysis_client = DocumentAnalysisClient(endpoint=endpoint, credential=AzureKeyCredential(key))

with open(my_file, "rb") as f:    
  poller = document_analysis_client.begin_analyze_document(model_id="prebuilt-document",     document=f, pages="2-6")    result =  analyze_general_documents(my_file)    print(len(result.pages))

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,541 questions
{count} votes

Accepted answer
  1. santoshkc 6,955 Reputation points Microsoft Vendor
    2023-11-17T09:20:49.72+00:00

    Hi @Yu Cai ,

    Thank you for reaching out to Microsoft Q&A forum!

    It's possible that the first two pages are being analyzed because you are using a resource that is on the free tier. The Azure AI Form Recognizer service has a free tier that allows you to process up to 2 pages per document.

    For PDF and TIFF files, up to 2,000 pages can be processed. With a free tier subscription, only the first two pages are processed.

    For more info, please look into this documentation: Services and quota limits & Custom model

    I recommend you switch to the pricing tier to standard or S0 via the Azure portal. Afterward, log back into the studio to verify if extra pages have been processed.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Yu Cai 100 Reputation points
    2023-11-20T15:06:58.1833333+00:00

    Thank you. But here it does no show the first 2 pages issue. Only mention 500 pages free per month. Microsoft should add this 2-page issue to its policy to make it clear. I will switch to S0 Standard.

    User's image

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more