c# - Printing a PDF Document in ASP MVC Without Showing it First -


i've got code builds pdf document , opens in new tab i'd send straight printer.

there lot going on behind code boils down make call controller view

<a href="~/controller/getreport/" target="_blank">report</a> 

the method goes , builds pdf document , returns file.

public actionresult getreport() {     return file(a byte[] containing content, "application/pdf"); } 

the resulting pdf displayed in new tab.

what i'd rather happens user clicks link , document starts printing or print dialog opens , user clicks ok print.

i'm using itextsharp handle of pdf functionality if can used simplify problem.

well never got go directly printers did find specifying download file name causes save , open enough requirement.


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -