Forum Discussion

akinoril's avatar
akinoril
Copper Contributor
Aug 18, 2024

Issue with Generating Searchable PDF using Azure Document Intelligence API

 

I am experiencing an issue with the Azure Document Intelligence API and need your assistance.

I am trying to use the following cURL command to analyze a PDF file and generate a searchable PDF:

 

bash
複製程式碼
curl -i -X POST "%DI_ENDPOINT%/documentintelligence/documentModels/prebuilt-read:analyze?output=pdf&api-version=2024-02-29-preview" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: %DI_KEY%" \ -d "{\"urlSource\": \"<PDF_FILE_URL>\"}"

 

 

However, this command fails with an error. In contrast, a similar command for analyzing an image file works successfully:

 

bash
複製程式碼
curl -i -X POST "%DI_ENDPOINT%/documentintelligence/documentModels/prebuilt-read:analyze?api-version=2024-02-29-preview" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: %DI_KEY%" \ --data-ascii "{'urlSource': 'https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/read.png
 

Issue Description:

  1. Why does the command to analyze a PDF file fail while the command to analyze an image file succeeds?
  2. Are there specific configurations or formats required for processing PDF files?
  3. Could you provide any recommendations or solutions to successfully generate a searchable PDF?

    Thank you for your assistance!

    Additional Information:

    • API Endpoint: %DI_ENDPOINT%
    • API Key: %DI_KEY%
    • Request URL (Image): https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/read.png
No RepliesBe the first to reply