Skip to main content
Participant
Dec 31, 2022 11:45 AM UTC
Answered

PDF Extract Service API fails with Error Code 400 BAD_PDF_FILE_TYPE

Hello, I am creating a workflow in n8n.io to automatically convert PDFs using the Extract Service API.

My problem is that no matter which pdf document I upload I always get the following error message from the API server:

 

 

[
{
"body":{
"error":{
"code":"BAD_PDF_FILE_TYPE",
"message":"BAD_PDF - Unable to extract content.: The input file is not a PDF file",
"status":400
},
"status":"failed"
},
"headers":{
"server":"openresty",
"date":"Sat, 31 Dec 2022 11:23:41 GMT",
"content-type":"application/json;charset=UTF-8",
"content-length":"152",
"connection":"close",
"x-request-id":"OqxZOhbXq4jkY7HcTsfK2QxftFbaE4fw"
},
"statusCode":200,
"statusMessage":"OK"
}
]

 

 

When I send the API call "Get asset metadata" I get the following response:

 

[
{
"body":{
"entity":"02A1570D63AF3AED0A495FA9@techacct.adobe.com",
"type":"application/pdf",
"size":20842
},
"headers":{
"server":"openresty",
"date":"Sat, 31 Dec 2022 11:28:02 GMT",
"content-type":"application/json;charset=UTF-8",
"content-length":"94",
"connection":"close",
"x-request-id":"kN9dtQUe3EmfWCkG4b4wsatTcaCensx6"
},
"statusCode":200,
"statusMessage":"OK"
}
]

 

The file size shown in the response matches the size of the file I uploaded and also the type is application/pdf. So it seems to me that the file was correctly uploaded.

The upload to the server is done as binary payload in Step2 mentioned here:

https://developer.adobe.com/document-services/docs/overview/pdf-services-api/howtos/api-usage/

 

My current workflow in n8n.io

The PDF Document I use for testing is also attached.

 

What am I doing wrong, where is the mistake?

 

This topic is closed to new replies. Start a new post to keep the conversation going.
Raymond Camden
Raymond CamdenCorrect answer
Community Manager
Jan 3, 2023 3:26 PM UTC

Can you share details of how you create the job?

3 replies

Raymond Camden
Community Manager
Raymond CamdenCommunity ManagerCorrect answer
Community Manager
Jan 3, 2023 3:26 PM UTC

Can you share details of how you create the job?

Translate
Participant
Jan 9, 2023 10:24 PM UTC

Thanks for the hint with the job creation!!! I have used in the HTTP Request Body a static Asset ID along with the options... this was the Issue. Changed it so that it uses now the asset id created at file upload and now it works! Thanks a lot for pointing me into this direction.

 

Translate
Participant
Nov 28, 2023 8:02 PM UTC

Did you ever get this fully working?

Translate