html2canvas is not defined

I’m developing my project using angularjs and php and need to save a certificate which will be generated at the end, Certificate with it’s contents is created dynamically but cannot do right click->save as since it is not an image,
So I used canvas for this, but it doesn’t seem to help.

I included this in head tag of my HTML file

<script src=""></script>

But still it says “html2canvas is not defined”


<button id="btn-Preview-Image">Print</button>

My Javascript Code:

$(document).ready(function() {

            var element = $("#html-content-holder"); // global variable
            var getCanvas; // global variable

            $("#btn-Preview-Image").on('click', function() {
                html2canvas(element, {
                    onrendered: function(canvas) {
                        getCanvas = canvas;

Source: AngularJS