Generate PDF from HTML in c# You can use itextSharp and itextSharp.xmlWorker libraries to generate and download PDF from HTML, simply add reference of both the DLLs that are open source.The code is given below: Byte[] bytes; var ms = new MemoryStream(); var doc = new Document(PageSize.A4); var writer = PdfWriter.GetInstance(doc, ms); doc.Open(); var html = @"<strong>hi</strong>"; var sr = new StringReader(html); var htmlWorker = new HTMLWorker(doc); htmlWorker.Parse(sr); doc.Close(); bytes = ms.ToArray(); ...
Posts
- Get link
- X
- Other Apps
Copy to clipboard using Zeroclipboard and jquery The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. The "Zero" signifies that the library is invisible and the user interface is left entirely up to you. This is achieved by automatically floating the invisible movie on top of a DOM element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects. The zeroclipboard cdn you can find from here The script. $(document).ready(function () { $("#btnCopy").click(function () { var clip = new ZeroClipboard($("#btnCopy"), { moviePath: "http://davidwalsh.name/demo/ZeroClipboard.swf" }); clip.setText($("#spn").text()); }); }); The html. <span id="spn">hi</span> ...