akrennmair/ng-pdfviewer — pull request #15 by michaschwab (2014-10-12 03:15:49+00:00)
Title: allowed for data URIs in the src of the pdf viewer for dynamic pdf viewing

with this patch, it's possible to use ng-pdfviewer interactively by changing the source of the dom element to different data uris. we can use the dom element like this:
and then feed the data uri into pdfContent. that even allows to use a user selected pdf file to be displayed immediately, using html5 filereader:

$scope.pdfUpload = function(input)
{
var reader = new FileReader();
reader.onloadend = function () {
var data = this.result;
$scope.$apply(function () { $scope.pdfContent = $sce.trustAsResourceUrl(data); });
};
reader.readAsDataURL(input.files[0]);
};

with