开发者

MVC - Print pdf automatically

We have a grid which shows invoices. Users should be able to select all or a subset of invoices and print. We are stuck at the part of printing. We are using Telerik Reporting to generate the PDF for us. Below is a section of the code which does the work

        ReportProcessor rp = new ReportProcessor();
        RenderingResult result = rp.RenderReport("PDF", book, null);
        Response.Clear();
        Response.ContentType = result.MimeType;
        Response.BinaryWrite(result.DocumentBytes);
        Response.End();
        return new FileStreamResult(Response.OutputStream, "application/pdf");

Now instead of openning these in开发者_JAVA百科voices in a separate window we would like the invoices to be printed automatically (the user might get the print dialog where they can change settings). At the moment it opens in another window and the user has to manually go and print which is what we dont want.

Does anybody know how to achieve automatic printing of these invoices. Please note this is an MVC based project and is internet based.


If you do not have any further use for your PDF file other that printing, then take a look at my answer to this question: Generate a PDF that automatically prints

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜