CN105760122A - 一种浏览器图表的服务器端打印方法 - Google Patents
一种浏览器图表的服务器端打印方法 Download PDFInfo
- Publication number
- CN105760122A CN105760122A CN201610090794.4A CN201610090794A CN105760122A CN 105760122 A CN105760122 A CN 105760122A CN 201610090794 A CN201610090794 A CN 201610090794A CN 105760122 A CN105760122 A CN 105760122A
- Authority
- CN
- China
- Prior art keywords
- printing
- chart
- client
- out task
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 15
- 238000012423 maintenance Methods 0.000 claims description 3
- 239000002699 waste material Substances 0.000 abstract description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 239000011800 void material Substances 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 239000010893 paper waste Substances 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1211—Improving printing performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1244—Job translation or job parsing, e.g. page banding
- G06F3/1248—Job translation or job parsing, e.g. page banding by printer language recognition, e.g. PDL, PCL, PDF
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/126—Job scheduling, e.g. queuing, determine appropriate device
- G06F3/1263—Job scheduling, e.g. queuing, determine appropriate device based on job priority, e.g. re-arranging the order of jobs, e.g. the printing sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1273—Print job history, e.g. logging, accounting, tracking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1278—Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
- G06F3/1285—Remote printer device, e.g. being remote from client or server
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Accessory Devices And Overall Control Thereof (AREA)
Abstract
本发明公开了一种浏览器图表的服务器端打印方法,该打印方法步骤如下:1)客户端选择打印资源发起打印请求;2)接收客户端打印请求并将图表转换成PDF文档格式缓存于服务端;3)创建打印任务并且管理和维护打印任务的打印队列;4)服务端打印服务执行打印并记录打印日志,打印完成通知客户端打印完成;5)维护并管理打印资源;在服务端维护和管理所有的打印机以及纸张类型。本发明的打印方法在服务端统一管理打印资源,客户端不需要再安装和注册打印机,可以直接发起打印请求;并且可以充分利用打印机资源,避免出现空闲打印机造成资源浪费;通过将图表转换成PDF文档解决了打印精度问题。
Description
技术领域
本发明涉及PDF转换、打印资源管理以及服务端打印,具体地说是一种浏览器图表的服务器端打印方法。
背景技术
随着信息化水平的不断提高,图表打印这样看似简单的需求也面临着诸多需要解决的问题。第一:打印精度问题,尤其是财务相关的图表,在打印的过程中经常会出现打印偏差,导致打印结果与预期结果出现比较大的反差。第二:打印资源浪费问题,无法合理利用现有打印机资源,总是出现空闲打印机无人使用大大降低了工作效率。纸张浪费导致的工作成本的增加。
公开的相关专利文件:名称为“客户服务器系统、计算机设备和打印图像的准备方法”,该文件公开了“使用运行在WEB浏览器上的程序来打印所希望的显示在WEB浏览器中的图像。在客户服务器系统中包括通过网络彼此相连的客户20、WEB数据服务器30和WEB应用服务器40,从WEB数据服务器30向客户20下载Java小应用程序(Javaapplet)和数据,并且,下载的Java小应用程序和数据用来在客户20的浏览器21中显示图表和数据表等等。通过向WEB应用服务器40发送所显示的诸如图表和数据表的打印信息、基于WEB应用服务器40中收到的打印信息、准备打印的文件、并向客户20发送已准备的打印文件来执行打印”。
上述公开文件与本发明内容要解决的技术问题,采用的技术手段都不相同。
发明内容
本发明的技术任务是提供一种浏览器图表的服务器端打印方法。
本发明的技术任务是按以下方式实现的,该打印方法步骤如下:
1)客户端选择打印资源发起打印请求;在客户端选择目前正在处于空闲的打印机,选择对应的纸张类型,然后发起打印请求;
2)接收客户端打印请求并将图表转换成PDF文档格式缓存于服务端;
3)创建打印任务并且管理和维护打印任务的打印队列;
4)服务端打印服务执行打印并记录打印日志,打印完成通知客户端打印完成;并通知打印机执行未完成的任务,并记录相关的打印日志;
5)维护并管理打印资源;在服务端维护和管理所有的打印机以及纸张类型。
所述的步骤3)中打印任务管理包含创建、更新、删除打印任务;并根据打印请求创建的打印任务,调整打印任务的优先级,同时删除或者挂起打印任务。
所述的步骤4)中,打印日志包括请求打印用户、请求打印的电脑、打印机名称、打印图表模板、打印时间、打印的服务器、打印的起始页、打印总页数、纸张类型、是否双打以及打印的状态。
本发明的一种浏览器图表的服务器端打印方法和现有技术相比,具有设计合理、操作方便、工作效率高等特点,服务端统一管理打印资源,客户端不需要再安装和注册打印机,可以直接发起打印请求;并且可以充分利用打印机资源,避免出现空闲打印机造成资源浪费;通过将图表转换成PDF文档解决了打印精度问题。
具体实施方式
实施例1:
该打印方法步骤如下:
1)客户端选择打印资源发起打印请求;在客户端选择目前正在处于空闲的打印机,选择对应的纸张类型,然后发起打印请求;
2)接收客户端打印请求,解析请求参数,渲染图表;并将图表转换成PDF文档格式缓存于服务端;
3)创建打印任务并且管理和维护打印任务的打印队列;打印任务管理包含创建、更新、删除打印任务;并根据打印请求创建的打印任务,调整打印任务的优先级,同时删除或者挂起打印任务。
步骤2)和步骤3)的具体实现代码如下:
///<summary>
///请求处理
///</summary>
///<returns></returns>
publicActionResultOutputRequest()
{
stringresult="";
try
{
//1:解析请求参数
OutputParametersreportParams=ParseRequestParams();
//2:渲染报表
StiReportreport=StiMvcViewer.GetReportObject(this.HttpContext,true);//通过缓存渲染报表
if(report==null)
report=RenderReport(reportParams);//重新渲染报表
//3:输出(将报表转换成PDF文档并创建打印任务)
OutputChannel(report,reportParams);
result="ok";
}
catch(Exceptione)
{
result=e.Message;
}
returnContent(result);
}
解析请求参数。
#region解析请求参数
///<summary>
///解析请求参数
///</summary>
privateOutputParametersParseRequestParams()
{
IRequestParamsHandlerprintOutput=GSPServiceManager.Current.GetService<IRequestParamsHandler>("paramsHandler");
returnprintOutput.GetRequestParams(System.Web.HttpContext.Current.Request.Params["outputRequestInfo"]);
}
#endregion
渲染报表。
#region报表渲染
///<summary>
///报表渲染
///</summary>
///<returns></returns>
privateStiReportRenderReport(OutputParametersreportParams)
{
IOutputReportFactoryIFactory=GSPServiceManager.Current.GetService<IOutputReportFactory>("OutputReportFactory");
StiReportreport=IFactory.Create(reportParams);
returnreport;
}
#endregion
转换PDF万当,创建打印任务。
#region
privatevoidOutputChannel(StiReportreport,OutputParametersparameters)
{
try
{
stringChannelName=string.Empty;
if(parameters.ContainsKey("channel"))
ChannelName=parameters["channel"].ToString();
//通过服务实例化IOutputChannel对象
IOutputChannelIChannel=null;
if(string.IsNullOrEmpty(ChannelName))
{
IChannel=GSPServiceManager.Current.GetService<IOutputChannel>();
}
else
IChannel=GSPServiceManager.Current.GetService<IOutputChannel>(ChannelName);
//通过AOP进行拦截
IOutputChanneloutputChannel=PolicyInjection.Wrap<IOutputChannel>(IChannel);
outputChannel.ExecuteOutput(report,parameters);
}
catch(Exceptione)
{
throwe;
}
}
#endregion
4)服务端打印服务执行打印并记录打印日志,打印完成通知客户端打印完成;并通知打印机执行未完成的任务,并记录相关的打印日志;打印日志包括请求打印用户、请求打印的电脑、打印机名称、打印图表模板、打印时间、打印的服务器、打印的起始页、打印总页数、纸张类型、是否双打以及打印的状态。
具体实现代码如下:
IExecutesPrintexecutesPrint=GSPServiceManager.Current.GetService<IExecutesPrint>("executesprint");
executesPrint.ExecutesPrint();
ExecutesPrint执行打印方法的具体实现:
///<summary>
///执行打印并记录打印日志
///</summary>
///<returns></returns>
publicvoidExecutesPrint()
{
PrintTaskManagerprintTaskManager=newPrintTaskManager();
PrintTaskLogManagerprintLogManager=newPrintTaskLogManager();
PaperManagerpaperManager=newPaperManager();
PrintTaskLogprintLog=null;
PrintTaskprintTask=newPrintTask();
printTask.PrintStatus="0";
List<PrintTask>taskList=printTaskManager.GetPrintTasks(printTask);
if(taskList!=null&&taskList.Count>0)
{
stringserverName=Dns.GetHostName();
List<Paper>paperList=newList<Paper>();
Paperpaper=null;
PrintDocprintDoc=newPrintDoc();
foreach(PrintTaskpintaskList)
{
try
{
#region初始化打印参数
printDoc.PrinterName=p.Printer;
printDoc.Copies=Convert.ToInt16(p.TotalPages);
printDoc.FilePath=p.Path;
if(p.PaperSize!=null)
{
paperList.Clear();
paper=newPaper();
paper.PaperName=p.PaperSize;
paperList=paperManager.GetPapers(paper);
if(paperList!=null&&paperList.Count>0)
{
if(paperList[0].PaperHeight!=null)
printDoc.PageHeight=paperList[0].PaperHeight==""
?0:Convert.ToInt32(paperList[0].PaperHeight);
if(paperList[0].PaperWidth!=null)
printDoc.PageWidth=paperList[0].PaperWidth==""
?0:Convert.ToInt32(paperList[0].PaperWidth);
}
}
if(p.FirstPage==null)
printDoc.FromPage=0;
else
printDoc.FromPage=(int)p.FirstPage;
if(p.LastPage==null)
printDoc.ToPage=0;
else
printDoc.ToPage=(int)p.LastPage;
if(p.Deplux!=null&&p.Deplux.ToLower()=="true")
printDoc.Deplux=true;
else
printDoc.Deplux=false;
#endregion
//执行打印
printDoc.Print();
#region记录打印日志
printLog=newPrintTaskLog();
printLog.Printer=p.Printer;
printLog.PrintUser=p.PrintUser;
printLog.Computer=p.Computer;
printLog.PrintTime=DateTime.Now;
printLog.PrinterServer=serverName;
printLog.PrintDocument=p.PrintDocument;
printLog.Path=p.Path;
printLog.Content=p.Content;
printLog.FirstPage=p.FirstPage;
printLog.LastPage=p.LastPage;
printLog.TotalPages=p.TotalPages;
printLog.PaperSize=p.PaperSize;
printLog.Color=p.Color;
printLog.Deplux=p.Deplux;
printLog.PrintStatus="1";
printLogManager.Add(printLog);
#endregion
#region修改打印任务状态
p.PrintStatus="1";
printTaskManager.Edit(p);
#endregion
}
catch(Exceptione)
{
#region记录打印日志
printLog=newPrintTaskLog();
printLog.Printer=p.Printer;
printLog.PrintUser=p.PrintUser;
printLog.Computer=p.Computer;
printLog.PrintTime=DateTime.Now;
printLog.PrinterServer=serverName;
printLog.PrintDocument=p.PrintDocument;
printLog.Path=p.Path;
printLog.Content=p.Content;
printLog.FirstPage=p.FirstPage;
printLog.LastPage=p.LastPage;
printLog.TotalPages=p.TotalPages;
printLog.PaperSize=p.PaperSize;
printLog.Color=p.Color;
printLog.Deplux=p.Deplux;
printLog.PrintStatus="2";
printLogManager.Add(printLog);
#endregion
#region修改打印任务状态
p.PrintStatus="2";
printTaskManager.Edit(p);
#endregion
continue;
}
}
}
}
5)维护并管理打印资源;在服务端维护和管理所有的打印机以及纸张类型。
通过上面具体实施方式,所述技术领域的技术人员可容易的实现本发明。但是应当理解,本发明并不限于上述的几种具体实施方式。在公开的实施方式的基础上,所述技术领域的技术人员可任意组合不同的技术特征,从而实现不同的技术方案。
Claims (3)
1.一种浏览器图表的服务器端打印方法,其特征在于,该打印方法步骤如下:
1)客户端选择打印资源发起打印请求;在客户端选择目前正在处于空闲的打印机,选择对应的纸张类型,然后发起打印请求;
2)接收客户端打印请求并将图表转换成PDF文档格式缓存于服务端;
3)创建打印任务并且管理和维护打印任务的打印队列;
4)服务端打印服务执行打印并记录打印日志,打印完成通知客户端打印完成;并通知打印机执行未完成的任务,并记录相关的打印日志;
5)维护并管理打印资源;在服务端维护和管理所有的打印机以及纸张类型。
2.根据权利要求1所述的一种浏览器图表的服务器端打印方法,其特征在于,所述的步骤3)中打印任务管理包含创建、更新、删除打印任务;并根据打印请求创建的打印任务,调整打印任务的优先级,同时删除或者挂起打印任务。
3.根据权利要求1所述的一种浏览器图表的服务器端打印方法,其特征在于,所述的步骤4)中,打印日志包括请求打印用户、请求打印的电脑、打印机名称、打印图表模板、打印时间、打印的服务器、打印的起始页、打印总页数、是否双打以及打印的状态。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610090794.4A CN105760122A (zh) | 2016-02-18 | 2016-02-18 | 一种浏览器图表的服务器端打印方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610090794.4A CN105760122A (zh) | 2016-02-18 | 2016-02-18 | 一种浏览器图表的服务器端打印方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105760122A true CN105760122A (zh) | 2016-07-13 |
Family
ID=56330063
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610090794.4A Pending CN105760122A (zh) | 2016-02-18 | 2016-02-18 | 一种浏览器图表的服务器端打印方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105760122A (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109657211A (zh) * | 2018-12-11 | 2019-04-19 | 万兴科技股份有限公司 | 在线格式转换的方法、装置及智能终端 |
CN117742625A (zh) * | 2023-12-27 | 2024-03-22 | 北京辰光融信技术有限公司 | 打印机的作业处理方法、装置、计算机设备及存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040179230A1 (en) * | 2002-12-27 | 2004-09-16 | Naruhide Kitada | Distributed printing system, method, program, printer and printer management server |
CN101334715A (zh) * | 2007-06-29 | 2008-12-31 | 佳能株式会社 | 打印控制装置和打印控制方法 |
CN102609852A (zh) * | 2012-02-16 | 2012-07-25 | 南京邮电大学 | 远程打印印刷电子商务平台的实现方法 |
CN103660641A (zh) * | 2012-08-29 | 2014-03-26 | 株式会社理光 | 移动终端装置、图像形成方法以及图像形成系统 |
CN103870219A (zh) * | 2012-12-14 | 2014-06-18 | 佳能株式会社 | 打印装置及其控制方法 |
CN104714766A (zh) * | 2015-03-12 | 2015-06-17 | 福建工程学院 | 一种web报表浏览器中直接打印的方法 |
-
2016
- 2016-02-18 CN CN201610090794.4A patent/CN105760122A/zh active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040179230A1 (en) * | 2002-12-27 | 2004-09-16 | Naruhide Kitada | Distributed printing system, method, program, printer and printer management server |
CN101334715A (zh) * | 2007-06-29 | 2008-12-31 | 佳能株式会社 | 打印控制装置和打印控制方法 |
CN102609852A (zh) * | 2012-02-16 | 2012-07-25 | 南京邮电大学 | 远程打印印刷电子商务平台的实现方法 |
CN103660641A (zh) * | 2012-08-29 | 2014-03-26 | 株式会社理光 | 移动终端装置、图像形成方法以及图像形成系统 |
CN103870219A (zh) * | 2012-12-14 | 2014-06-18 | 佳能株式会社 | 打印装置及其控制方法 |
CN104714766A (zh) * | 2015-03-12 | 2015-06-17 | 福建工程学院 | 一种web报表浏览器中直接打印的方法 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109657211A (zh) * | 2018-12-11 | 2019-04-19 | 万兴科技股份有限公司 | 在线格式转换的方法、装置及智能终端 |
CN117742625A (zh) * | 2023-12-27 | 2024-03-22 | 北京辰光融信技术有限公司 | 打印机的作业处理方法、装置、计算机设备及存储介质 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10694051B2 (en) | Image handling apparatus for inputting scan settings for a scanner | |
US8947701B2 (en) | Server apparatus, terminal apparatus, and printing system and data conversion method thereof | |
US20170024172A1 (en) | Printing System and Printer | |
US8537402B2 (en) | Apparatus and method for metering and monitoring print usage at non-network printers | |
KR101377468B1 (ko) | 화상처리장치, 화상처리장치의 제어 방법 및 컴퓨터 프로그램을 격납한 기록 매체 | |
US20200364010A1 (en) | Server, control method, and storage medium | |
US8717600B2 (en) | Network system, network system control method, and storage medium | |
JP7328067B2 (ja) | 印刷装置、印刷システム | |
CN102103475B (zh) | 打印任务管理装置、系统及方法 | |
US20130010324A1 (en) | Printing system, control method, storage client apparatus, printing apparatus, and web application server | |
JP6292009B2 (ja) | システム、及び方法 | |
US8873089B2 (en) | Printing system, print management apparatus, print control method, and storage medium | |
CN105760122A (zh) | 一种浏览器图表的服务器端打印方法 | |
CN110187848A (zh) | 基于web端的打印方法及装置 | |
JP2009255390A (ja) | 画像形成装置、機能連携制御方法、及び機能連携制御プログラム | |
JP6366373B2 (ja) | 情報処理装置とその制御方法、及びプログラム | |
EP3349065B1 (en) | Image handling apparatus | |
JP2014134872A (ja) | 情報処理装置、処理実行方法、プログラム | |
US20090147305A1 (en) | Image Forming Apparatus Having a Function of Mediating Data Transmission Between a Reception Part and a Job Execution Part | |
CN111638859A (zh) | 一种云打印方法、装置、系统、设备及存储介质 | |
JP5030819B2 (ja) | 画像処理装置及び画像処理方法 | |
JP2007213583A (ja) | 画像処理装置の適応設定方法、媒体、及び設定装置 | |
JP2003108345A (ja) | ネットワークプリンタシステム | |
JP2008059019A (ja) | ジョブ管理システム、ジョブ管理プログラム、ジョブ管理方法 | |
JP2006087141A (ja) | 画像形成装置,蓄積文書出力方法および蓄積文書出力システム |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160713 |