function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
George Galaios 22George Galaios 22 

Perform Callout, get byte[] and view pdf

I have a requirement to perform a callout, get response (byte array) that is a PDF base 64 encoded. Then, i need to show the pdf, without saving any data in Salesforce. I just need to view the response in PDF.
So, is there a way to achieve this?
What i have done is:
I have created an LWC to perform the callout on rowaction of a Lightning data table. So onRowAction a JS function is called which calls Apex. Apex performs the callout, gets response and then i need to render the result in PDF. I have tried opening a Visualforce page (calling it either from JS Controller of LWC or from Apex, but i could not find solution... I could not pass my parameter to the page so the PDF was always blank. 
Please find below a high level diagram of the problem that i am facing and what i want to do..
High Level Overview of the Problem

Any suggestions??
ANUTEJANUTEJ (Salesforce Developers) 
Hi George,

>> https://developer.salesforce.com/blogs/2019/07/display-pdf-files-with-lightning-web-components.html

The above shows a way to show pdf in lightning component and more over I think while fetching from the external system you would be consuming API calls, which would inturn count towards Governer limits.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.