I was able to do what I intended. Leaving it here for others. I got it to work in the following way: 
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<body>
    <a href="https://raw.githubusercontent.com/ad1tyawagh/resume/master/aditya_resume.pdf" title="Click to download the CV">
        <canvas class="container box-shadow shadow bg-white rounded" id="cv" style="width: 100%;
        height: auto;"></canvas>
        <!-- Use latest PDF.js build from Github -->
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.3.200/pdf.js"></script>
        <script type="text/javascript">
             <!----Insert the script following this block here---->
        </script>
    </a>
</body>
{% include footer.html %}
</html>
           var url = ""; // url of the pdf here
            var pdf = null;
            pdfjsLib.disableWorker = true;
            var pages = new Array();
            //Prepare some things
            var canvas = document.getElementById('cv');
            var context = canvas.getContext('2d');
            var scale = 5;
            var canvasWidth = 0;
            var canvasHeight = 0;
            var pageStarts = new Array();
            pageStarts[0] = 0;
            pdfjsLib.getDocument(url).then(function getPdfHelloWorld(_pdf) {
                pdf = _pdf;
                //Render all the pages on a single canvas
                for (var i = 1; i <= pdf.numPages; i++) {
                    pdf.getPage(i).then(function getPage(page) {
                        var viewport = page.getViewport(scale);
                        // changing canvas.width and/or canvas.height auto-clears the canvas
                        canvas.width = viewport.width;
                        canvas.height = viewport.height;
                        page.render({ canvasContext: context, viewport: viewport });
                        pages[i - 1] = context.getImageData(0, 0, canvas.width, canvas.height);
                        // calculate the width of the final display canvas
                        if (canvas.width > maxCanvasWidth) {
                            maxCanvasWidth = canvas.width;
                        }
                        // calculate the accumulated with of the final display canvas
                        canvasHeight += canvas.height;
                        // save the "Y" starting position of this pages[i]
                        pageStarts[i] = pageStarts[i - 1] + canvas.height;
                        p.Out("pre-rendered page " + i);
                    });
                }
                canvas.width = canvasWidth;
                canvas.height = canvasHeight;  // this auto-clears all canvas contents
                for (var i = 0; i < pages.length; i++) {
                    context.putImageData(pages[i], 0, pageStarts[i]);
                }
            });