beg implementation of pdf.js