Click here to Skip to main content
13,086,662 members (56,165 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have created a PDF using Itextsharp in my application and i want to print it directely without downloading.Plz help......
Posted 11-Dec-12 0:46am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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", "");
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Have a look on this similar QA hope you get some help out:
Print PDF from ASP.Net without preview[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100