get pdf point(x, y coordinates) of selected text or pdfelement from pdfjs For fit canvas width to the pdf I used this method: html2canvas(pdfElement, { scrollY: -window.scrollY }) . Additionally with x, y values from addImage() method you can set the pdf content position in the page.