Preview remote PDF files?
gsdiama opened this issue · comments
Hi,
I'm developing an Ionic app, and I would like to know if angularjs-pdf only works with downloaded files. Is possible to open a remote PDF without downloading?
Thank you in advance.
Hi @gsdiama,
I confirm you that it's possible to open a remote PDF, but on the remote server you have to configure Access-Control-Allow-Origin
header.
What error do you have in your console?
Hi @dennybiasiolli,
Thank you for your fast response!
No error at the moment because I havent tried, but all the examples found show local files. Should be the use this?
app.controller('DocCtrl', function($scope) {
$scope.pdfUrl = 'https://remoteserver.com/?file=2222';
});
Thanks again!
Yep! 😃
Keep in mind that server side you have to configure Access-Control-Allow-Origin
header.
Great!
Grazzie mille! ;-)