You need to sign in to do that
Don't have an account?
Jayesh Babu A V
Open pdf in another tab
I did a REST call from my apex class which include website url. This rest will return the pdf form of that website. This is the REST call:
@AuraEnabled public static String convertLinkToPdf(String websiteUrl) { HttpRequest req = new HttpRequest(); req.setEndpoint('https://baseurl.com/'); req.setMethod('GET'); req.setHeader('Authorization', 'apikey xxxxxxxxxxxxxxxxx'); req.setBody('{"url": "'+ websiteUrl+'","filename" : "abc.pdf"}'); HttpResponse res = new Http().send(req); System.debug('STATUS: ' + res.getStatusCode()); System.debug('RESPONSE: ' + res.getBody()); return res.getBody(); }This call will convert 'websiteUrl' to a pdf format and return as the body. I want this pdf to be opened in a new browser tab. Is there any way to do that?
So, I see that there is generally use of below to redirect to another URL can you try checking below code:
Let me know if this helps.
Regards,
Anutej
You have to handle the PDF content returned first and use window.open() in your component to open the content in a new tab