静音打印(直接)使用KIOSK在谷歌浏览模式 [英] Silent printing (direct) using KIOSK mode in Google Chrome
问题描述
我开发使用iTextSharp的生成PDF格式,需要静静地或直接打印的应用程序。我的工作流程是这样的,我在树的结构和选择的形式,然后点击打印按钮将使用iTextSharp的自动生成的PDF并保存到一个位置列出了一些形式。这是因为多记录我们下载的zip文件。而不用打开任何其他窗口进行打印。我使用谷歌浏览器浏览器和使用Kiosk模式。
I am developing an application which generates pdf using ITextSharp and need to print silently or directly. My work flow is Like this, I have some forms listed in tree structure and on selecting the forms and click on the print button will automatically generate the pdf using Itextsharp and save to a location. this is because for multiple record we download it as zip file . And goes to print without opening any other windows. I am using google chrome as browser and uses the KIOSK mode.
但不幸的是,当我执行code打印preVIEW将在我的浏览器中打开,我需要单击后退按钮来达到我的页面。我想这被清除。此外,我需要清除树结构的选择。搜索
But unfortunately when i execute the code the print preview will open up in my browser and i need to click on the back button to reach my page. I want this to be cleared. Also i need to clear the selection of the tree structure.
在此安装的code,而打印。结果
Hereby attaching the code while printing.
MemoryStream ms = new MemoryStream();
var urlPdf = Server.MapPath("~/Pdf/pdfMerge/" + id + "Merge_doc.pdf");
PdfReader ps = new PdfReader(urlPdf);//1
PdfStamper pdf = new PdfStamper(ps, ms);//2
pdf.JavaScript = "this.print({bUI: true,bSilent:false,bShrinkToFit: true});" + "\r\n" + "this.closeDoc();";//3
pdf.Close();//4
HttpContext.Current.Response.ClearContent();//5
HttpContext.Current.Response.ClearHeaders();//6
HttpContext.Current.Response.ContentType = "application/pdf";//7
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=quickforms.pdf");//8
HttpContext.Current.Response.BinaryWrite(ms.ToArray());//9
ms.Flush();
任何人可以帮助我吗?
Can anybody help me?
推荐答案
使用
--kiosk --kiosk-printing <application_URL>
创建一个新的chrome.exe快捷方式
添加-kiosk -kiosk印刷标志到目标的chrome.exe快捷方式
添加亭在Chrome浏览器设置起始页的网址(带或更换的chrome.exe的chrome.exe -kiosk的http:// [请在此输入URL])
快捷方式拖动到启动文件夹因此它自动加载。
Create a new chrome.exe shortcut Add –kiosk –kiosk-printing flags to the chrome.exe target shortcut Add the url of the kiosk as the starting page in Chrome settings (or replace chrome.exe with "chrome.exe –kiosk http:// [enter URL here]") Drag the shortcut into the startup folder so it loads automatically.
这就是它!然后,当你打开它的全屏和亭和经销商的打印功能锁定于一身! :)要退出亭,preSS Alt + F4键在键盘上。
That’s it! Then when you open it’s fullscreen and locked down with the kiosk and auto printing functionality all in one! :) To quit the Kiosk, press Alt + F4 on your keyboard.
这篇关于静音打印(直接)使用KIOSK在谷歌浏览模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!