javascript - Use a Canvas to select a portion of a pdf document -
i have request select portion of pdf document , save/email generated image in asp.net website. initial thought load pdf document , utilize draggable/resizable canvas select portion of document , save out. know how accomplish or know of alternative method of doing this.
i visualize draggable/resizable box can move around multipage document , select save portion of it.
i suggest looking @ mozilla's pdf.js project. renders pdfs canvas you. can capture section want mouse, , copy out image data:
var context = canvas.getcontext("2d"); var image = context.getimagedata(x, y, width, height);
in order mouse positions inside of canvas, checkout thess questions: getting mouse position javascript within canvas , draw on html5 canvas using mouse
Comments
Post a Comment