Skip to content

Commit 71ba0d0

Browse files
committed
feat(): added onPageRender callback method
when onPageRender method is defined on scope where directive is placed, it is called when page of pdf is rendered, so we can disable next/previous while rendering buttons because fast changing of pages causes rendering two pages in same canvas
1 parent d88addf commit 71ba0d0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

dist/angular-pdf.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
viewport: viewport
4141
};
4242

43-
page.render(renderContext);
43+
var pageRendering = page.render(renderContext);
44+
pageRendering.promise.then(function() {
45+
if (typeof scope.onPageRender === 'function' ) {
46+
scope.onPageRender();
47+
}
48+
});
4449
});
4550
};
4651

dist/angular-pdf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)