Click here to Skip to main content
15,569,774 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a PDF using Itextsharp in my application and i want to print it directely without downloading.Plz help......

Try this this js function on button click..

function PrintReport()
    var strHtml = '<html><head><title>Test Page to print</title></head><body><B>Test Page to print</B></body></html>'//Your Html code here;
    var printContent = strHtml;
    var windowUrl = 'about:blank';
    var uniqueName = new Date();
    var windowName = 'Print' + uniqueName.getTime();
    var printWindow =, windowName);
    '<link href="css/style.css" rel="stylesheet" type="text/css" />' +
    strHtml.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "") + '</div>'
    $(printWindow.document).find('a').each(function () {
    $(this).attr("href", "");
Share this answer
Have a look on this similar QA hope you get some help out:
Print PDF from ASP.Net without preview[^]
Share this answer

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