CN113536170A - Method and device for printing browser content - Google Patents

Method and device for printing browser content Download PDF

Info

Publication number
CN113536170A
CN113536170A CN202110730030.8A CN202110730030A CN113536170A CN 113536170 A CN113536170 A CN 113536170A CN 202110730030 A CN202110730030 A CN 202110730030A CN 113536170 A CN113536170 A CN 113536170A
Authority
CN
China
Prior art keywords
print
printing
processor
data
request
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
Application number
CN202110730030.8A
Other languages
Chinese (zh)
Inventor
李奇峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mingyuan Cloud Technology Co Ltd
Original Assignee
Shenzhen Mingyuan Cloud Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Mingyuan Cloud Technology Co Ltd filed Critical Shenzhen Mingyuan Cloud Technology Co Ltd
Priority to CN202110730030.8A priority Critical patent/CN113536170A/en
Publication of CN113536170A publication Critical patent/CN113536170A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1208Improving or facilitating administration, e.g. print management resulting in improved quality of the output result, e.g. print layout, colours, workflows, print preview
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client
    • G06F3/1256User feedback, e.g. print preview, test print, proofing, pre-flight checks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

The application relates to the technical field of computers, and provides a method for printing browser contents, which comprises the following steps: monitoring a port of a client through a receiving container; receiving a first print request and first print data of a first browser from the port; and calling a first printing processor to print the first printing data according to the first printing request. The method can realize cross-browser printing.

Description

Method and device for printing browser content
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for printing browser content.
Background
With the continuous development of computer technology, users can access websites in which the users are interested through a browser. The web site is used for browsing the web contents which are interested by the user, wherein the web contents can be pictures, document data, news information and the like, and when the user needs to print the web contents, the user needs to print the web contents by using a local printer. Typically, a technician invokes a local printer to print web content by embedding a plug-in that enables print functionality, such as ActiveX, Applet, and COM, in the page. However, this method of printing by embedding various plug-ins in a page is applicable to only a part of browsers, such as IE browsers, but is not supported by some browsers.
Therefore, how to realize cross-browser printing is a problem which needs to be solved urgently at present.
Disclosure of Invention
The application provides a method and a device for printing browser contents, which can realize cross-browser printing.
In a first aspect, a method for printing browser content is provided, including: monitoring a port of a client through a receiving container; receiving a first print request and first print data of a first browser from the port; and calling a first printing processor to print the first printing data according to the first printing request.
The method described above may be performed by a print module on a terminal device. The printing module monitors a port of a client (for example, a computer) through a receiving container, waits for the client to send a first printing request and first printing data, and the receiving container can receive the first printing request and the first printing data sent by any browser of the client through the port of the monitoring client, without being influenced by the browser type, so as to realize a cross-browser printing function.
Optionally, the receiving container is an Http server container, and the ports include Http ports and Http ports.
The Http port of the Http server container can receive a first print request and first print data sent by a part of sites (i.e., websites) through the Http protocol, and the Http port of the Http server container can receive a first print request and first print data sent by another part of sites through the Http protocol, thereby implementing a multi-protocol printing function.
Optionally, the invoking a first print processor to print the first print data according to the first print request includes: determining the first printing processor from a plurality of printing processors according to the data type information in the first printing request, wherein the first printing processor is associated with the data type information; and calling the first printing processor to print the first printing data.
The receiving container determines the data type (such as word document, report form, picture and the like) which the user wants to print according to the data type information in the first printing request, and finds the corresponding printing processor according to the data type, for example, if the user wants to print the report form, the first printing request contains Rdlcprint.aspx information, and the receiving container finds the corresponding report form printing processor according to the URL address (such as http://127.0.0.1:53962/Rdlcprint.aspx) corresponding to the Rdlcprint.aspx information; the application provides a plurality of printing processors for users to use, and can meet the requirements of users for printing different types of data.
Optionally, the invoking a first print processor to print the first print data according to the first print request includes: calling the first printing processor to print the first printing data through a thread pool according to the first printing request; the method further comprises the following steps: receiving a second print request and second print data of a second browser from the port; and calling a second printing processor to print the second printing data through the thread pool according to the second printing request.
When different users send print requests (e.g., a first print request and a second print request) to the receiving container at the same time, the receiving container may receive multiple print requests at the same time, find corresponding print processors (e.g., a first print processor and a second print processor) for the multiple print requests at the same time, and then satisfy the print requirements of the different users through thread calls. Therefore, the method provided by the application can respond to a plurality of printing requests at the same time.
Optionally, the first print data is a data URL, and the invoking a first print processor to print the first print data according to the first print request includes: acquiring a printing resource from a resource position corresponding to the data URL; and calling a first printing processor to print the printing resource according to the first printing request.
In a second aspect, there is provided an apparatus for printing browser content, comprising means for performing any of the methods of the first aspect.
In a third aspect, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, causes the processor to perform the method of any of the first aspects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic diagram of a print processing system according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for printing browser contents according to an embodiment of the present invention;
FIG. 3 is a timing diagram illustrating the printing of browser content in accordance with an embodiment of the present invention;
FIG. 4 is a diagram illustrating internal processing of a client tool in accordance with an embodiment of the present invention;
fig. 5 is a schematic diagram of an apparatus for printing browser contents according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The present application will now be described in further detail with reference to the accompanying drawings and specific examples.
Fig. 1 shows a print processing system provided in the present application, which includes a client browser 101, a print module 102 of a client, and a printer 103. The client browser 101 is used for a user to access some websites which the user is interested in and to send a printing request and printing data to the printing module 102 of the client; the printing module 102 of the client is configured to receive a print request and print data sent by a user from the client browser 101, and process the print request and print data to send a print document to the printer 103; the printer 103 is configured to receive a print document sent by the print module 102 of the client, and print a resource for the user according to the print document. For example, the user accesses a website of interest to himself on the client browser 101, and browses web page content of interest to himself on the website. When a user wants to print certain web page content, a print request and print data can be sent to the print module 102 of the client through the client browser 101. When the print module 102 of the client receives the print request and the print data, the print request and the print data are processed to allocate a corresponding print processor to the print request and the print data, and the print processor generates a print document and sends the print document to the printer 103. The printer 103 performs a printing operation upon receiving a print document. After the printer 103 executes the printing operation, sending feedback information of printing success (or printing failure) to the printing module 102 of the client, sending the received feedback information to the client browser 101 by the printing module 102 of the client, informing the user that the printing operation is executed by the client browser 101, and allowing the user to go to the printer 103 to take the printing material.
In order to process printing requests sent by users from different browsers, the application provides a method for printing browser contents, which can realize a cross-browser printing function. As shown in fig. 2, the method may be performed by a print module of a client (i.e., a terminal device), the method including:
s201, monitoring a port of a client through a receiving container.
The printing module of the client comprises a receiving container, wherein the receiving container comprises an http server container, and the http server container is used for receiving a first printing request and first printing data sent by a browser of the client. The http server container listens to the port of the client (i.e., the terminal device). And the browser of the client sends the first print request and the first print data to the http server container through the port. Because different transmission protocols used by different websites are different, in order to meet various printing requests of users, ports of an Http server monitoring client comprise an Http port and an Http port, wherein the Http port is used for receiving a first printing request and first data sent by a hypertext Transfer Protocol (Http); the http port is configured to receive a first print request and first data sent by a hypertext Transfer Protocol over Secure Socket Layer (Https), so that the http server container can receive the first print request and the first print data sent by any website.
S202, receiving a first print request and first print data of the first browser from the port.
Illustratively, a user accesses a website in which the user is interested through a first browser of a client, and when the user wants to print certain webpage content, a first print request and first print data can be sent to a print module of the client (i.e., a terminal device) through the first browser. The first browser may be any type of browser, such as an IE browser, a google browser, a fire browser, a dog browser, and the like, and the application does not limit the type and version of the first browser. The first browser initiates a print request to a print module of the client in an asynchronous manner (for example, an AJAX manner) according to a first print request initiated by a user and the first print data. After the first browser sends the printing request, the first browser can process other things instead of staying on the printing page all the time to wait for the printing to finish, so that the situation that the user cannot perform other operations due to page blockage in the page content printing process is avoided.
The first printing request comprises a printing request message type, and the printing request message type is used for informing a receiving container of what type of resources a user wants to print, so that the receiving container finds a corresponding printing processor for the user according to the first printing request; the print request message types include a picture print request message (e.g., picture. aspx), a document print request message (e.g., documentation. aspx), a template nesting printing request message (e.g., template nesting printing. aspx), and a report print request message, e.g., the picture print request message is used to inform the receiving container user that a picture is desired to be printed, the document print request message is used to inform the receiving container user that a document is desired to be printed, the office nesting printing request message is used to inform the receiving container user that web page content is desired to be nested in an office template, and the report print request message is used to inform the receiving container user that a report is desired to be printed. The present application does not set any limit to the specific contents of the above-described print request message types.
The first print data includes specific print data content and a Uniform Resource Locator (URL), and since the URL is an address of a server where the print data content is located, the print Resource (i.e., the print data content) can be obtained from a Resource location corresponding to the URL, so that the receiving container calls the first print processor to print the print Resource according to the first print request. For example, the first print data sent by the browser is a paper, and when the print processor receives the paper, the paper can be used to generate a print document and send the print document to the printer for printing; if the first print data sent by the browser is the address of the server where the report data is located, when the print processor receives the address of the server where the report data is located, the server needs to be logged in according to the address of the server where the report data is located to obtain the report data needing to be printed, then the report data is generated into a print document, and the print document is sent to the printer to be printed.
The printing module of the client may be implemented by using any development language, for example, JAVA, C + +, and the like, which is not limited in this application. In addition, the printing module of the client can be added into a registry of an operating system of the client (namely, terminal equipment) after being started for the first time, so that the printing module of the client can automatically run when a user starts a computer every time, and continuous printing service is provided for the user.
For example, if the X website sends a request to the outside through the HTTP protocol, when the user accesses the X website through the a browser, the user wants to print the content of a webpage on the X website, for example, the webpage content is a picture, and the a browser sends a first print request (i.e., a picture print request) and first print data (i.e., picture data) of the user to the HTTP server container through the HTTP port. When the http server container receives the first print request and the first print data, it queries an internal routing rule table according to the type of the first print request message (i.e. the picture print request message), as shown in table 1, so as to find the print processor type (e.g. the picture print processor) corresponding to the first print request message (e.g. the picture print request message). The print processor types include a picture print processor, a document print processor, a report print processor, and a template set print processor, and the print processor types of the present application are not limited to the listed types, and other print processor types, such as a PDF print processor type, may be set according to the requirements, and the present application is not limited thereto.
Table 1 routing rule table
Figure BDA0003138961860000071
The routing rule table is a routing rule registered in the http server container by a print processor module in the print module of the client, and the routing rule comprises a print request message type, a print request message format, URL addresses of different types of print processors and a print processor type, wherein the URL addresses of the different types of print processors are used for finding the corresponding print processor type for a first print request and first print data sent by the http server container for the a browser. For example, the http server container finds a picture print processor for the picture print request according to the picture print request and the picture print data sent by the a browser, and the picture print processor is the print processor (i.e. the picture print processor) pointed by the picture URL address (i.e. http://127.0.0.1:53962/picture. aspx). In this case, if the X site sends a request to the outside via HTTPS protocol, the URL address of the picture in which the picture print processor is located is HTTPS://127.0.0.1:53963/picture.
S203, calling the first print processor to print the first print data according to the first print request.
Illustratively, a first print processor is determined from a plurality of print processors according to data type information (i.e. print request message type) in the first print request, the first print processor being associated with the data type information (i.e. the print request message type corresponds to a URL address of a print processor, the URL address of the print processor corresponds to a print processor), as shown in table 1; the first print processor is invoked to print the first print data. For example, the http server container finds the URL address of the matching report print handler for the report print request information according to the print request message type in the first print request, for example, the print request message type is a report print request message, and the http server container finds the URL address of the matching report print handler for the report print request information by looking up the routing rule table (see table 1), where the URL address of the report print handler points to the report print handler. If the print module of the client is developed using a non-object-oriented language (e.g., C language), after the http server container finds a corresponding print processor (e.g., report print processor) for the first print request (e.g., report print request) and the first print data (e.g., report print data), the print processor may generate a print document from the first print data and send the print document to a printer, and the printer performs a print operation according to the print document. In addition, if the print module of the client is developed using an object-oriented language (e.g., JAVA, C + +), after the http server container finds a matching print processor type (e.g., report print processor) for the first print request (e.g., report print request) and the first print data (e.g., report print data), the http server container creates a print processor instance object capable of processing the first print request and the first print data according to the matching print processor type, the print processor instance object generates a print document from the first print data and sends the print document to the printer, and the printer performs a printing operation according to the print document.
Illustratively, the first print processor is invoked by the thread pool to print the first print data according to the first print request; receiving a second print request and second print data of a second browser from the port; and calling the second printing processor to print second printing data through the thread pool according to the second printing request.
For example, the first browser sends the first print request and the first print data to the Http server container through a port (e.g., Http port), and the Http server container looks up the routing rule table according to the first print request and finds a first print processor (or a first print processor type) corresponding to the first print request. If the printing module of the client is developed by using a non-object-oriented language (for example, C language), the http server container searches the routing rule table according to the first print request, and finds a first print processor corresponding to the first print request, where the first print processor is configured to process the first print request and the first print data. If the print module of the client is developed by using an object-oriented language (e.g., JAVA language), the http server container creates a first print processor instance object according to a first print processor type corresponding to the first print request, where the first print processor instance object is used for processing the first print request and the first print data; meanwhile, the second browser sends a second print request and second print data to the Http server container through a port (e.g., Http port), and the Http server container searches the routing rule table according to the second print request and finds a second print processor (or a second print processor type) corresponding to the second print request. If the print module of the client is developed by using a non-object-oriented language (for example, C language), the http server container searches the routing rule table according to the second print request, and finds a second print processor corresponding to the second print request, where the second print processor is configured to process the first print request and the first print data. If the print module of the client is developed using an object-oriented language (e.g., JAVA), the http server container creates a second print processor instance object according to a second print processor type corresponding to the second print request, where the second print processor instance object is used to process the second print request and the second print data.
If the printing module of the client is developed by using a non-object-oriented language (such as C language), searching a routing rule table by the http server container according to the first printing request and the second printing request respectively, and finding a first printing processor corresponding to the first printing request and a second printing processor corresponding to the second printing request; or, if the print module of the client is developed using an object-oriented language (e.g., JAVA language), the http server container creates a first print processor instance object and a second print processor instance object for the first print request and the second print request, respectively; the http server container places the first print request, the first print data and the first print processor (or the first print processor instance object), and places the second print request, the second print data and the second print processor (or the second print processor instance object) in a background thread pool of the terminal device (or the client) for queuing, for example, a background operating system of the terminal device (or the client) allocates a first thread for processing the first print request, a second thread user processes the second print request, when the background operating system processes the first thread, the first print processor (or the first print processor instance object) generates an internal print document according to the parameters of the first thread, and sends the print document to the printer, and the printer executes a print operation according to the print document. After the printer executes a printing operation, feedback information of printing success or printing failure is sent to the first printing processor (or the first printing processor instance object), the first printing processor (or the first printing processor instance object) receives the feedback information and then sends the feedback information to the Http server container, the Http server container sends the feedback information to the first browser through a port (for example, an Http port), and the first browser displays the feedback information to a user. It should be noted that the method for processing the second thread by the back-end operating system is the same as the method for processing the first thread by the back-end operating system, and is not described herein again.
The appointed parameters comprise the setting of the printing page paper and the address of a server where the printing data is located, for example, the setting of the printing page paper comprises setting the paper size of a printing page, setting the page number range, setting single and double sides, setting black and white or color printing and the like; the server address of the print data refers to a server address of the print data, which is not specific print content sent from the browser page, and the print processor (or print processor instance object) (for example, the first print processor or first print processor instance object) needs to log in the server address of the print data to obtain the print data.
The first browser and the second browser may be the same browser or different browsers, and the first print request and the second print request may be the same type of print request or different types of requests, which is not limited in this application. For example, if the B browser sends two identical print requests to the http server container at the same time, for example, the two print requests are both picture print requests; the Http server container receives a first picture printing request and first picture printing data from the Http port, and simultaneously may receive a second picture printing request and second picture printing data from the Http port or the Http port; the http server container finds a picture print processor (or a picture print processor type) corresponding to the first picture print request according to the first picture print request and the first picture print data search routing rule table, and if the print module of the client is developed by using a non-object-oriented language (for example, C language), the http server container searches the routing rule table according to the first picture print request and finds a first picture print processor corresponding to the first picture print request, where the first picture print processor is configured to process the first picture print request and the first picture print data. If the print module of the client is developed by using an object-oriented language (for example, JAVA language), the http server container creates a first image print processor instance object for the first image print request, where the first image print processor instance object is used for processing the first image print request and the first image data; meanwhile, the http server container searches the routing rule table according to the second picture print request and the second picture print data to find a picture print processor (or a picture print processor type) corresponding to the second picture print request, and if the print module of the client is developed by using a non-object-oriented language (for example, C language), the http server container searches the routing rule table according to the second picture print request and finds the second picture print processor corresponding to the second picture print request, where the second picture print processor is configured to process the second picture print request and the second picture print data. If the print module of the client is developed using an object-oriented language (e.g., JAVA), the http server container creates a second image print processor instance object for the second image print request, where the second image print processor instance object is used for processing the second image print request and the second image data. Therefore, the http server container can receive two identical print requests at the same time, and if the print module of the client is developed by using a non-object-oriented language (e.g., C language), the http server container can find a matching print processor for the two identical print requests at the same time; if the print module of the client is developed using an object-oriented language (e.g., JAVA), the http server container may create respective corresponding print processor instance objects (e.g., a first print processor instance object and a second print processor instance object) for two identical print requests at the same time, so as to implement a function of responding to two identical print requests at the same time.
If the printing module of the client is developed by using a non-object-oriented language (such as C language), searching a routing rule table by the http server container according to the first picture printing request and the second picture printing request respectively, and finding a first picture printing processor corresponding to the first picture printing request and a second picture printing processor corresponding to the second picture printing request; or, if the print module of the client is developed by using an object-oriented language (for example, JAVA language), after the http server container allocates the first image print processor instance object and the second image print processor instance object to two identical image print requests, the first image print request, the first image print data, and the first image print processor (or the first image print processor instance object) are placed in a thread pool for queuing, and at the same time, the second image print request, the second image print data, and the second image print processor (or the second image print processor instance object) are also placed in a background thread pool for queuing in the terminal device (or the client). When the background operating system processes the first picture thread, the first picture printing processor (or the first picture printing processor instance object) generates an internal printing document according to the appointed parameters, and sends the printing document to a printer, and the printer executes printing operation according to the printing document. After the printer executes a printing operation, feedback information of printing success or printing failure is sent to the first picture printing processor (or the first picture printing processor instance object), the first picture printing processor (or the first picture printing processor instance object) receives the feedback information and then sends the feedback information to the Http server container, the Http server container sends the feedback information to the first browser through a port (for example, the Http port), and the first browser displays the feedback information to a user. It should be noted that the method for processing the second picture thread by the back-end operating system is the same as the method for processing the first picture thread by the back-end operating system, and is not described herein again.
Illustratively, if the B browser sends two different print requests to the http server container at the same time, for example, the first print request is a print request for pictures, and the second print request is a print request for reports. The present embodiment only takes the example that the print module of the client is developed in an object-oriented language (e.g., JAVA language), and illustrates how the print module of the client responds to two different print requests simultaneously. The Http server container receives a picture printing request and picture printing data from a Http port, and simultaneously receives a report printing request and report printing data from the Http port and the Http port; the http server container searches a routing rule table according to the picture printing request and the picture printing data to find a picture printing processor type corresponding to the picture printing request, and creates a picture printing processor instance object for the picture printing request according to the picture printing processor type, wherein the picture printing processor instance object is used for processing the picture printing request and the picture data; meanwhile, the http server container searches the routing rule table according to the report printing request and the report printing data to find the report printing processor type corresponding to the report printing request, and creates a report printing processor instance object for the report printing request according to the report printing processor type, wherein the report printing processor instance object is used for processing the report printing request and the report printing data. Therefore, the http server container can receive two different print requests at the same time, and create respective corresponding print processor instance objects (for example, a picture print processor instance object and a report print processor instance object) for the two different print requests at the same time, so as to implement a function of simultaneously responding to the two different print requests.
When the http server container creates a picture print processor instance object and a report print processor instance object corresponding to each of two different print requests, the picture print request, the picture print data and the picture print processor instance object are placed in a thread pool to be queued, and simultaneously, the report print request, the report print data and the report print processor instance object are also placed in a background thread pool of a terminal device (or a client) to be queued. The background operating system of the terminal equipment (or the client) distributes a picture thread for processing a picture printing request, a report thread user processes the report printing request, when the background operating system processes the report thread, the report printing processor instance object generates an internal printing document according to the appointed parameters and sends the printing document to the printer, and the printer executes printing operation according to the printing document. After the printer executes the printing operation, feedback information of printing success or printing failure is sent to the report printing processor instance object, the report printing processor instance object receives the feedback information and then sends the feedback information to the Http server container, the Http server container sends the feedback information to the first browser through a port (for example, an Http port), and the first browser displays the feedback information to a user. Therefore, the method for processing the picture thread by the background operating system is the same as the method for processing the report thread by the background operating system, and is not described herein again.
For the printing module of the client developed in a non-object-oriented language (e.g., C language), the processing method for simultaneously responding to two different print requests is similar to the processing method for simultaneously responding to two same print requests, and is not described herein again.
For example, if the B browser sends multiple print requests to the http server container at the same time, the method for processing the multiple print requests by the http server container is the same as the method for processing the two print requests, and details of the method are not repeated herein.
For ease of understanding, the overall flow steps of the method for printing browser content provided herein are exemplarily described below with reference to fig. 3 and 4. First, a timing chart of the whole process of printing the browser content is introduced, as shown in fig. 3, the specific flow is as follows: (As explained herein, the client tool in FIGS. 3 and 4 is illustrated as an example of an object-oriented language development, illustrating the overall process of implementing the method for printing browser content)
Step 301: a user accesses a website interested by the user through a browser of a client, and when the user wants to print certain webpage content, the user can send a first printing request and first printing data to a printing module of the client (namely, a terminal device) through the browser. The browser sends the client print request to the client tool (i.e., the print processing module of the client) through the POST method, which needs to submit the following data to the client tool: a first print request message (e.g., print request message type) and first print data (e.g., data URL, http:// localhstot: 53962/Rdlcprint. aspx, and body parameter: report required parameter).
Step 302: a receiving container (e.g., an http server container, not shown in fig. 3) of the client tool receives the first print request and the first print data sent by the browser of the client tool, and searches a corresponding print processor for the first print request. The print processor sends an HTTP request (i.e., a request for acquiring the content of the print data) to a server where the first print data is located according to a URL parameter (i.e., the first print data) sent by a browser of the client, so as to acquire the specific content of the first print data from the server.
Step 303: the server returns the specific content (e.g., a picture data stream) of the first print data to the print processor according to the received HTTP request.
Step 304: the print processor receives the specific contents of the first print data, and internally constructs a print data structure (i.e., generates a print document).
Step 305: the print processor sends the generated print document to the printer, and the printer performs a printing operation according to the print document. The printer performs the printing operation and feeds back information of the printing success or printing failure to the printing processor (not shown in fig. 3).
Step 306: and the printing processor sends the information fed back by the printer to the browser of the client, and the browser of the client informs the user of the successful printing or the failed printing.
The flow steps of the internal processing procedure (as shown in fig. 4) of the client tool (i.e., the printing module of the client) are as follows:
step 401: a print request is sent. When a user browses a web page in a browser and needs to perform a printing operation, the browser may send a print request (e.g., a first print request) to an http server container (i.e., a receiving container) through a port of a client.
Step 402: and searching a routing rule table. After the http server container receives the print request, the http server searches a routing rule table according to the print request, and selects a matched print processor type.
Step 403: a print processor instance is obtained. The http server container obtains a print processor instance from the processor factory (where the processor factory is a processor factory class if the client tool is implemented using an object-oriented language) based on the matching print processor type.
Step 404: returning to the print processor instance. The processor factory class returns a print processor instance object based on the print processor type. The print processor instance object is used to process print requests and print data.
Step 405: the print job is submitted to the thread pool (queued). Print requests, print data, and print processor instance objects are placed in a thread pool for queuing, and a background operating system of the terminal device (or client) will allocate a print thread for processing the print request.
Step 406: the handler is invoked (i.e., the print process instance object is invoked). When the background operating system processes the printing thread, the printing processor instance object is called.
Step 407: print data is acquired. The print processor instance object sends an instruction to a server where the print data is located according to the URL address of the print data (e.g., data URL).
Step 408: the print data is returned. And the server where the printing data is located returns the specific content of the printing data to the printing processor instance object according to the instruction.
Step 409: a print data structure is constructed. The print processor instance object constructs the print data structure (i.e., generates a print document) according to the specific contents of the print data.
Step 410: a printing action is performed. The print processor instance object sends the generated print document to the printer, and the printer performs a printing operation according to the print document.
Step 411: the print status (success/failure) is returned. After the printer has executed the printing operation, the information of the printing success or printing failure is fed back to the print processor instance object (not shown in fig. 4). The print processor instance object transmits the print status (i.e., print success/print failure) fed back by the printer to the browser of the client, which notifies the user of the print status.
Fig. 5 is a schematic structural diagram of a cuff pressurizing device provided in the present application. The apparatus 500 includes a listening module 501, a receiving module 502, and a processing module 503.
And a monitoring module 501, configured to monitor a port of the client through the receiving container.
A receiving module 502 is configured to receive a first print request and first print data of a first browser from a port.
A processing module 503 for invoking the first print processor to print the first print data according to the first print request
The specific manner in which the apparatus 500 performs the method for printing browser content and the resulting beneficial effects can be seen in the associated description of the method embodiments.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a computer, implements the method of any of the method embodiments of the present application. The computer program may be a high-level language program or an executable object program.
The computer-readable storage medium is, for example, a memory. The memory may be volatile memory or nonvolatile memory, or the memory may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM, enhanced SDRAM, SLDRAM, Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes and the generated technical effects of the apparatus described above may refer to the corresponding processes and technical effects in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the disclosed system, apparatus and method can be implemented in other ways. For example, some features of the method embodiments described above may be omitted, or not performed. The above-described embodiments of the apparatus are merely exemplary, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, and a plurality of units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the coupling includes electrical, mechanical or other connections.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: it is to be understood that modifications may be made to the above-described embodiments, or equivalents may be substituted for some of the features of the embodiments, and such modifications or substitutions are not to be construed as essential to the spirit and scope of the embodiments of the present invention.

Claims (11)

1. A method of printing browser content, the method comprising:
monitoring a port of a client through a receiving container;
receiving a first print request and first print data of a first browser from the port;
and calling a first printing processor to print the first printing data according to the first printing request.
2. The method of claim 1, wherein the receiving container is an Http server container, and the ports include an Http port and an Http port.
3. The method according to claim 1 or 2, wherein said invoking a first print processor to print the first print data according to the first print request comprises:
determining the first printing processor from a plurality of printing processors according to the data type information in the first printing request, wherein the first printing processor is associated with the data type information;
and calling the first printing processor to print the first printing data.
4. The method according to claim 1 or 2, wherein said invoking a first print processor to print the first print data according to the first print request comprises:
calling the first printing processor to print the first printing data through a thread pool according to the first printing request;
the method further comprises the following steps:
receiving a second print request and second print data of a second browser from the port;
and calling a second printing processor to print the second printing data through the thread pool according to the second printing request.
5. The method according to claim 1 or 2, wherein the first print data is a data URL, and the invoking a first print processor to print the first print data according to the first print request comprises:
acquiring a printing resource from a resource position corresponding to the data URL;
and calling a first printing processor to print the printing resource according to the first printing request.
6. The device for printing the browser content is characterized by comprising a monitoring module, a receiving module and a processing module,
the monitoring module is used for monitoring a port of the client through the receiving container;
the receiving module is used for receiving a first printing request and first printing data of a first browser from the port;
and the processing module is used for calling a first printing processor to print the first printing data according to the first printing request.
7. The apparatus of claim 6, wherein the receiving receptacle is an Http server receptacle, and the ports include an Http port and an Http port.
8. The apparatus according to claim 6 or 7, wherein said invoking a first print processor to print the first print data according to the first print request comprises:
determining the first printing processor from a plurality of printing processors according to the data type information in the first printing request, wherein the first printing processor is associated with the data type information;
and calling the first printing processor to print the first printing data.
9. The apparatus according to claim 6 or 7, wherein said invoking a first print processor to print the first print data according to the first print request comprises:
calling the first printing processor to print the first printing data through a thread pool according to the first printing request;
the device further comprises:
the receiving module is further used for receiving a second printing request and second printing data of a second browser from the port;
and calling a second printing processor to print the second printing data through the thread pool according to the second printing request.
10. The apparatus according to claim 6 or 7, wherein the first print data is a data URL, and the invoking of the first print processor to print the first print data according to the first print request comprises:
acquiring a printing resource from a resource position corresponding to the data URL;
and calling a first printing processor to print the printing resource according to the first printing request.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to carry out the method of any one of claims 1 to 5.
CN202110730030.8A 2021-06-29 2021-06-29 Method and device for printing browser content Pending CN113536170A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110730030.8A CN113536170A (en) 2021-06-29 2021-06-29 Method and device for printing browser content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110730030.8A CN113536170A (en) 2021-06-29 2021-06-29 Method and device for printing browser content

Publications (1)

Publication Number Publication Date
CN113536170A true CN113536170A (en) 2021-10-22

Family

ID=78097277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110730030.8A Pending CN113536170A (en) 2021-06-29 2021-06-29 Method and device for printing browser content

Country Status (1)

Country Link
CN (1) CN113536170A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104020967A (en) * 2014-06-16 2014-09-03 浪潮软件股份有限公司 WEB batch-printing method based on fully-domestic CPU and OS and commonly used for multiple browsers
CN105142183A (en) * 2015-10-09 2015-12-09 烽火通信科技股份有限公司 Method and system capable of automatically identifying WIFI data frame and dividing priority
CN107463348A (en) * 2017-07-05 2017-12-12 深圳市坐标软件开发有限公司 Web ends user-defined format print method and system are realized based on B/S frameworks
CN109542366A (en) * 2018-10-26 2019-03-29 金蝶软件(中国)有限公司 Method of printing, device, equipment and storage medium based on browser
CN111052685A (en) * 2017-07-13 2020-04-21 沃兹艾普公司 Techniques for multi-agent messaging
CN111813353A (en) * 2020-06-04 2020-10-23 厦门汉印电子技术有限公司 Printing system, method and device based on web and proxy server
CN112486429A (en) * 2020-11-26 2021-03-12 四川长虹电器股份有限公司 Method for automatically configuring printer by terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104020967A (en) * 2014-06-16 2014-09-03 浪潮软件股份有限公司 WEB batch-printing method based on fully-domestic CPU and OS and commonly used for multiple browsers
CN105142183A (en) * 2015-10-09 2015-12-09 烽火通信科技股份有限公司 Method and system capable of automatically identifying WIFI data frame and dividing priority
CN107463348A (en) * 2017-07-05 2017-12-12 深圳市坐标软件开发有限公司 Web ends user-defined format print method and system are realized based on B/S frameworks
CN111052685A (en) * 2017-07-13 2020-04-21 沃兹艾普公司 Techniques for multi-agent messaging
CN109542366A (en) * 2018-10-26 2019-03-29 金蝶软件(中国)有限公司 Method of printing, device, equipment and storage medium based on browser
CN111813353A (en) * 2020-06-04 2020-10-23 厦门汉印电子技术有限公司 Printing system, method and device based on web and proxy server
CN112486429A (en) * 2020-11-26 2021-03-12 四川长虹电器股份有限公司 Method for automatically configuring printer by terminal

Similar Documents

Publication Publication Date Title
CN107231402B (en) HTTP request processing method, device and system
US20110252117A1 (en) Devices and Methods for Redirecting a Browser to Access Computer Resource Behind a Network Firewall
US20100302590A1 (en) System for retrieving and printing network documents
US9734437B2 (en) Communication relaying technology and communication relaying apparatus
CN111368173A (en) File transmission method and device, electronic equipment and readable storage medium
US20090249194A1 (en) Method for Converting Electronic Documents
CN107463453B (en) Method, device, equipment and storage medium for communication between different applications of same terminal
TW201929498A (en) Information transmission method and device
US20120154861A1 (en) Image processing apparatus, system including image processing apparatus and external apparatus
US7395338B2 (en) Information processing apparatus and session management method
JP6093449B2 (en) Homepage forming method, peripheral device, and homepage forming system
JP5962702B2 (en) Image forming apparatus, web application system, and program
US20070294711A1 (en) Locating services using compiled scopes
CN112685669A (en) Page rendering method and system
US20180027355A1 (en) Data download method and apparatus
US8073872B2 (en) Information processing apparatus
CN114189393A (en) Data processing method, device, equipment and storage medium
WO2016204834A1 (en) Expedited sub-resource loading
CN112231379A (en) API (application program interface) auditing method, device, equipment and storage medium based on micro-service architecture
US20140211248A1 (en) Web server apparatus, control method, and program therefor
JP2018533092A (en) Network request and response processing method, terminal, server, and storage medium
CN112672187B (en) Page generation method and device, computer equipment and readable storage medium
US20040268114A1 (en) Electronic apparatus and parameter updating method
CN113536170A (en) Method and device for printing browser content
JP4097584B2 (en) Embedded device having WWW server function, web page providing method, and web page providing control program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination