    var pdfData = getPDFArrayBuffer();

    PDFJS.getDocument(pdfData).then(function (pdf) {
        var num = pdf.numPages;
        for (var i = 1; i <= num; ++i){
			pdf.getPage(i).then(function (page) {
				page.getTextContent().then(function (textContent) {
				// http://stackoverflow.com/questions/1554280/extract-text-from-pdf-in-javascript
					var page_text = "";
					for( var k = 0; k < textContent.items.length; k++ ){
						var block = textContent.items[k];
						page_text += block.str;
					}
					print(page_text);
				});
			});
		}
    });
