Skip to main content
New Participant
June 12, 2021
Question

convert response from PDF Extract API to image and csv files

  • June 12, 2021
  • 2 replies
  • 2822 views

Hello All,

 

I am using the PDF Extract API by making a REST call using postman. The call is successful and i am able to Poll and get the contentAnalyserResponse in text format. How do i get this as separate files that can get downloaded to my disk as images and/or csv/json files for text and tables. Can i receive the response as object(s) that can be written to different files with the proper extensions to achieve this. I remember reading somewhere but now cannot locate it again that the response can be received as a single downloadable zip file with all the separate files in a fixed folder structure...

 

If anyone has tried or achieved this, please could you share how you have done it.

 

Thanks and regards,

Adi

This topic has been closed for replies.

2 replies

New Participant
August 7, 2021

Hi, 

I'm at the same spot right now and could use some guidance.

From looking at the json, it appears that I'm getting good results, but now I need to get it displayed properly. 

I'm beginning to think that I'm unable to render the response in postman and need to install the sdk to visualize the extraction. I'm hoping to send the GET responses directly into a db to display on website.

Any input on next steps would be greatly appreciated.

 

 

 

Raymond Camden
Community Manager
Community Manager
August 9, 2021

If you are getting the JSON, then you are good - I mean, as far as I can help. How you use the JSON depends on what your building. But at that point, it's outside the API/SDK and in your hands in terms of what you do with the JSON. Right?

Participating Frequently
August 17, 2021

Did you look for a MIME solution for decoding MIME multipart data in .NET? The REST API is delivering the data, all you need to do is decode it.


Hi Raymond,

 

Thanks for your update, Now i am able to decode the MIMe multipart data and save the files. I have a quick question. Currently i am using the below mentioned "contentAnalyzerRequests" :

 

{
"cpf:engine": {
"repo:assetId": "urn:aaid:cpf:58af6e2c-1f0c-400d-9188-078000185695"
},
"cpf:inputs": {
"documentIn": {
"cpf:location": "InputFile0",
"dc:format": "application/pdf"
},
"params": {
"cpf:inline": {
"elementsToExtract": ["text", "tables"],
"renditionsToExtract": [ "tables", "figures"],
"tableOutputFormat": "csv"
}
}
},
"cpf:outputs": {
"elementsInfo": {
"cpf:location": "jsonoutput",
"dc:format": "application/json"
},
"elementsRenditions": {
"cpf:location": "fileoutpart",
"dc:format": "text/directory"
}
}
}

 

When i am decoding the files, i am getting as individual files instead of zip files. What are changes i have to do to get zip file in contentAnalyzerRequests.

Raymond Camden
Community Manager
Community Manager
June 14, 2021

It should be a multipart form response. I haven't done that myself with Postman, but does that give you some help?