I am using the winnovative html to pdf converter for creating a pdf document. I've added a checkbox for the user to choose wether they would like to print or email the pdf file.
But i can't get the pdf page to open the printer dialog. I have tried the PrinterDialog class but this didn't work, also sending some javascript with window.print() didn't work. I've searched the internet but couldn't find anything.
My page containing the PDF has the following code:
Response.Clear();
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "inline;filename=Offerte.pdf");
Response.BufferOutput = true;
Response.AddHeader("Content-Length", downloadBytes.Length.ToString());
Response.BinaryWrite(downloadBytes); //downloadBytes = the byte array created by winnovative converter
Response.End();
This will open the pdf viewer inside the browser containing my page as PDF. From here the user is able to click the print button of the pdf viewer/browser. But i would like to have my page open the printer dialog or send the bytes directly to the printer, to minimalize the actions a user has to do.
Any ideas?