Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am very new to asp.net mvc. i am developing mvc application in that i am opening
pdf document in web page using iframe. on that pdf document i want to draw tick marks and into marks and i wanto write some text can any one suggest me how to do please

What I have tried:

i have tried this java script


function renderPDF(url, canvasContainer, options) {
var options = options || { scale: 1 };

function renderPage(page) {
var viewport = page.getViewport(options.scale);
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var renderContext = {
canvasContext: ctx,
viewport: viewport
};

canvas.height = viewport.height;
canvas.width = viewport.width;
canvasContainer.appendChild(canvas);

page.render(renderContext);
}

function renderPages(pdfDoc) {
for (var num = 1; num <= pdfDoc.numPages; num++)
pdfDoc.getPage(num).then(renderPage);
}
PDFJS.disableWorker = true;
PDFJS.getDocument(url).then(renderPages);
}
Posted
Updated 11-Nov-17 3:21am

1 solution

You can't use PDF.js to edit a PDF in the browser. It only renders a PDF to display it.

You're going to have to use a different library to edit PDF's client-side. Since you're trying to add editing capability, the library you use will be much, much larger than PDF.js and you'll end up have to ship over a ton of assets to the client to get the editor up and running.

Something like PDFNet.js[^] might work for you, but you're the only one who can answer that question.
 
Share this answer
 
Comments
Dilli kumar 11-Nov-17 9:24am    
Thanks sir i will try based on your suggestion

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900