sayanee / angularjs-pdf

:page_facing_up: An AngularJS directive <ng-pdf> to display PDF files with PDFJS

Home Page:http://sayan.ee/angularjs-pdf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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-Originheader.
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! ;-)