I have a print function in my webpage, and I have a piece of JavaScript appended at the header.
<script type="text/javascript">
function printPartOfPage(elementId)
{
var printContent = document.getElementById(elementId);
var windowUrl = 'about:blank';
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime();
var printWindow = window.open('', '', 'left=50000,top=50000,width=0,height=0');
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
setTimeout(function ()
{
printWindow.print();
}, 500);
}
</script>
And the button use to trigger the Javascript.
<asp:Button ID="btnSumbit" runat="server" Text="Print" OnClientClick="JavaScript:printPartOfPage('modaltable');" />
My problem is, is there any workaround to determine whether a user has successfully printed, or at least has sent the print job to the printer? Will the window.print() returns any value once the user click the "Print" button on the print UI? Because I need the result to determine whether the user has really printed the documents out and to do further validation in my database.