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
PDesPDes 

pdf to grab from an external url

In the response from 3rd party I am getting url, I want to grab that url and save that pdf in a salesforce object.
If I manually use that url and paste in browser it downloads the file. But when I use pagereference method to show in apex it doesnt show the file.
String url1 = 'some external url' //this I get in httpresponse from 3rd party
Pagereference pg = new Pagereference(url1); 
Blob b = pg.getContentAsPDF();
How can I grab this url and save pdf file in Salesforce.
 
SwethaSwetha (Salesforce Developers) 
HI PDes,
I see you also reached out on https://salesforce.stackexchange.com/questions/369287/get-pdf-from-external-url

Recommend reviewing https://salesforce.stackexchange.com/questions/241640/how-to-download-a-pdf-file-with-public-url

https://salesforce.stackexchange.com/questions/216525/how-to-save-renderas-pdf-in-files-folder