-
Goal: I'm attempting to export a PDF given some API response data
-
Steps:
-
used a button to run a GET request to retrieve PDF data
-
onSuccess, use
utils.downloadFile()
on the given PDF data -
Details: When I do the steps above, it exports the file as JSON since the parameter I'm feeding
utils.downloadFile()
is an object. The schema of the response data is:
{
"name": "file-name",
"type": "application/pdf",
"sizeBytes": 1234,
"base64Data": "someEncodedStringData"
}
The only way I'm able to accomplish this is by storing the response object in a PDF component and manually downloading the PDF which is not the goal.