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

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -