c# - NReco PdfGenerator disable selection -
i want disable selection, image, if contain text.
i know pdf contain layers, dont find remove text layer.
thanks.
var htmltopdf = new nreco.pdfgenerator.htmltopdfconverter(); htmltopdf.size = nreco.pdfgenerator.pagesize.letter; htmltopdf.margins = new nreco.pdfgenerator.pagemargins() { bottom = 0, top = 0, left = 0, right = 0 }; string id = "test"; response.contenttype = "application/pdf"; response.appendheader("content-disposition", string.format("inline;filename=\"{0}.pdf\"", id)); htmltopdf.generatepdffromfile("page.aspx", null, response.outputstream); response.end();
pdfgenerator internally uses wkhtmltopdf , renders text content text blocks , selectable default; behavior cannot changed. if want guarantee text cannot selected should rendered image (= can render html image first, , produce pdf contains image).
another alternative encryption of produced pdf itextsharp, see answer lock pdf against editing using itextsharp - pdfwriter.allow_printing option (lgpl version 4.1.6 of itextsharp can used purpose).
Comments
Post a Comment