A web-based batch printing method and device, electronic equipment and storage medium

By creating a print format area and generating an identifier array, obtaining parameter information and page links, and displaying a print preview interface, the problem of batch printing of HTML web pages is solved, and efficient batch printing of HTML web pages is achieved.

CN119201013BActive Publication Date: 2026-02-10SHAANXI ZHIYUAN INTERNET SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411038495.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2026-02-10
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

Existing batch printing technologies cannot batch print HTML-based web pages, resulting in low printing efficiency.

Method used

Batch printing of HTML web pages is achieved by creating a print format area, generating an identifier array, obtaining parameter information and page links, displaying a print preview interface, and responding to batch printing operations.

Benefits of technology

It enables batch printing of HTML web pages, improving printing efficiency and meeting different printing needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201013B_ABST
    Figure CN119201013B_ABST
Patent Text Reader

Abstract

The application discloses a batch printing method based on a webpage, comprising the following steps: creating a printing format area in response to a batch printing instruction of a plurality of to-be-printed pages triggered on a to-be-printed list page; generating an identification array of to-be-printed identification; obtaining parameter information and a page link of an element of the printing format area corresponding to the identification array; displaying the to-be-printed page according to the parameter information and the page link, and generating a printing preview interface; and printing the printing preview interface in response to a triggered batch printing operation. The application realizes batch printing of an HTML webpage according to requirements, meets the printing requirements, and improves the printing efficiency of the HTML webpage. The application also discloses a device, an electronic equipment and a computer readable storage medium for realizing the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of print data processing technology, and more particularly to a webpage-based batch printing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of computers, printing has become increasingly common. People need printing devices to convert electronic documents into paper documents. Batch printing can quickly print various document contents at once, improving printing efficiency. However, existing batch printing methods are mainly for documents from office software. For HTML-based pages, only individual pages can be printed, making batch printing impossible and resulting in low printing efficiency. Summary of the Invention

[0003] To address the aforementioned problems in the prior art, this invention provides a webpage-based batch printing method, apparatus, electronic device, and storage medium. The technical problem to be solved by this invention is achieved through the following technical solution:

[0004] The first aspect of this invention provides a webpage-based batch printing method, comprising the following steps:

[0005] In response to a batch print command for multiple pages to be printed triggered on a printable list page, a print format area is created; wherein, each printable page corresponds to a printable identifier, and each printable page corresponds to a page link;

[0006] Generate an identifier array from the identifiers to be printed;

[0007] The parameter information of the element in the corresponding print format area and the page link are obtained according to the identifier array;

[0008] Based on the parameter information and the page link, the page to be printed is displayed, and a print preview interface is generated;

[0009] In response to the triggered batch printing operation, the print preview interface is printed.

[0010] In one embodiment of the present invention, the print format area is in table form;

[0011] The step of generating an identifier array from the identifiers to be printed includes:

[0012] Generate an identifier array for each of the identifiers to be printed; wherein each identifier array is an element of the print format area.

[0013] In one embodiment of the present invention, the step of displaying the page to be printed based on the parameter information and the page link, and generating a print preview interface, includes:

[0014] When the form type indicated in the parameter information is CAP4, the image of the page to be printed is obtained according to the parameter information and the page link;

[0015] The image of the page to be printed is displayed in the print format area to generate a print preview interface.

[0016] In one embodiment of the present invention, obtaining the image of the page to be printed based on the parameter information and the page link includes:

[0017] The PhantomJS tool is used to obtain an image of the page to be printed based on the page link and the parameter information.

[0018] In one embodiment of the present invention, displaying the image of the page to be printed in the print format area and generating a print preview interface includes:

[0019] An HTML string including the image of the page to be printed is constructed to display the image of the page to be printed in the print format area, thereby generating a print preview interface.

[0020] In one embodiment of the present invention, the page to be printed includes: a full area, a main print area, and at least one additional print area. Correspondingly, the identifier to be printed includes: a full area identifier, a main print identifier, and at least one additional print area identifier. The page link includes: a full area link, a main link, and at least one additional print area link.

[0021] The method further includes:

[0022] Obtain the print identifier corresponding to the page to be printed; the print identifier is the main print identifier.

[0023] In one embodiment of the present invention, creating a print format area in response to a batch print command for multiple pages to be printed triggered on a printable list page includes:

[0024] In response to the configuration operation of the pages to be printed on the printable list page, and the triggered batch printing instruction of multiple pages to be printed, a print format area is created; wherein, the configuration operation of the pages to be printed is the selection operation of the printable identifier of the pages to be printed, and the print format area is in table form;

[0025] The step of generating an identifier array from the identifiers to be printed includes:

[0026] Generate an identifier array for each of the identifiers to be printed;

[0027] Determine whether at least two of the printable identifiers correspond to the same printable page;

[0028] If so, then the identifier array generated by the at least two identifiers to be printed is an element of the print format region.

[0029] A second aspect of the present invention provides a webpage-based batch printing apparatus, comprising:

[0030] A creation module is used to create a print format area in response to a batch print command for multiple pages to be printed triggered on a printable list page; wherein, each printable page corresponds to a printable identifier, and each printable page corresponds to a page link;

[0031] The generation module is used to generate an identifier array from the identifiers to be printed;

[0032] The acquisition module is used to obtain parameter information of the corresponding elements of the print format area and the page link according to the identifier array;

[0033] The preview module is used to display the page to be printed based on the parameter information and the page link, and generate a print preview interface;

[0034] The printing module is used to print the print preview interface in response to a triggered batch printing operation.

[0035] A third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a webpage-based batch printing method provided in the first aspect of the present invention.

[0036] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a webpage-based batch printing method provided in the first aspect of the present invention.

[0037] The beneficial effects of this invention are:

[0038] This invention stores multiple identifiers to be printed in the form of an array, retrieves page links by reading the identifier array, displays them, and performs batch printing according to the format of the required printing format area. This enables batch printing of HTML web pages as needed, improving the printing efficiency of HTML web pages while meeting printing requirements.

[0039] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.

[0040] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0041] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0042] Figure 1 A flowchart illustrating a webpage-based batch printing method provided in an embodiment of the present invention;

[0043] Figure 2 This is a block diagram of a webpage-based batch printing device provided in an embodiment of the present invention. Detailed Implementation

[0044] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.

[0045] like Figure 1 As shown, the first aspect of this invention provides a webpage-based batch printing method, comprising the following steps:

[0046] Step 11: In response to a batch print command for multiple pages to be printed triggered on the print list page, create a print format area.

[0047] Each page to be printed corresponds to a printable identifier, and each page to be printed corresponds to a page link.

[0048] In this step, the print format area is created according to the desired print format. The print format is the layout format of the final printed document, such as table format, HTML body text format, Word, Excel, etc. Before or after triggering the batch print command, you can select the print format and create a print format area based on the selected format. For example, you can create a table format area or a Word format area. The print format area can be configured, such as the table's row and column width and height, border width, and color.

[0049] Step 12: Generate an array of identifiers to be printed.

[0050] Step 13: Obtain the parameter information and page links of the elements in the corresponding print format area based on the identifier array.

[0051] Step 14: Display the page to be printed based on the parameter information and page links, and generate a print preview interface.

[0052] Step 15: In response to the triggered batch printing operation, print the print preview interface.

[0053] In this embodiment, multiple identifiers to be printed are stored in the form of an array. The page link is obtained by reading the identifier array, displayed, and batch printed according to the format of the required printing format area. This enables batch printing of HTML web pages as needed, improving the printing efficiency of HTML web pages while meeting printing requirements.

[0054] A second aspect of this invention provides a webpage-based batch printing method, comprising the following steps:

[0055] Step 21: In response to a batch print command for multiple pages to be printed triggered on the print list page, create a print format area.

[0056] Each page to be printed is associated with a printable identifier, and each page to be printed corresponds to a page link.

[0057] In this embodiment, a table is used as an example to illustrate the print format area. The page to be printed is the entire page of a webpage by default, and the page content can be obtained by reading the page link. The titles of the pages to be printed are displayed on the print list page, and each page title is associated with a page link. A selection box is displayed before each page title, allowing multiple selections to be checked. The selected pages are the ones to be printed. After selecting, click the batch print button on the print list page, and then create the print format area. In this embodiment, the default print format area is a table.

[0058] Furthermore, for tabular printable areas, table attributes can be pre-configured. After clicking the batch print button, the format type and attributes of the printable area can be selected, including border width, row width, and other properties. In this embodiment, each page to be printed typically occupies one row of the table. The width of each row can be set by default (100%) based on the paper size, or manually. The height of each row adapts to the content of the page to be printed.

[0059] Step 22: Generate an array of identifiers to be printed.

[0060] Step 22 involves obtaining the printable identifiers associated with the pages to be printed, and generating an identifier array for each printable identifier. Each identifier array is an element of the print format area.

[0061] In this embodiment, the content of a row in the tabular print format area is also considered an element. The print format area (table) for batch printing of multiple pages to be printed has multiple rows, and one element in each row corresponds to one page to be printed.

[0062] Step 23: Obtain the parameter information and page links of the elements in the corresponding print format area based on the identifier array.

[0063] In this step, the array is read to obtain the identifier to be printed. Based on the identifier to be printed, the parameter information of the printing format area is obtained, such as the printing format area identifier, line identifier (which line), and content type. The corresponding page link is then obtained based on the identifier to be printed.

[0064] Step 24: Display the page to be printed based on the parameter information and page links, generating a print preview interface. The print preview interface displays the print format area (table) and the content of each row of the table (the content of the page to be printed). If the page to be printed is a CAP3 form, the link is directly invoked to display the CAP3 form; if the page to be printed is a CAP4 form, a screenshot needs to be taken and inserted into each row of the corresponding print format area (table).

[0065] Step 24 includes steps 241-244:

[0066] Step 241: Determine the type of content on the page to be printed based on the parameter information. The content type is obtained from the parameter information.

[0067] Step 242: When the content type of the page to be printed is CAP3 form, display the page to be printed according to the page link and generate a print preview interface.

[0068] Step 243: When the content type of the page to be printed is CAP4 form, obtain the image of the page to be printed based on the parameter information and page link.

[0069] When taking a screenshot of a specific line of the print format area, the image of the page to be printed is obtained based on the parameters of that line, such as the print format area identifier, the line identifier (which line), and the page link.

[0070] Specifically, the PhantomJS tool is used to obtain the image of the page to be printed based on the page link and parameter information.

[0071] Step 244: Display the image of the page to be printed in the print format area to generate a print preview interface. Specifically, construct an HTML string including the image of the page to be printed to display the image in the print format area and generate a print preview interface. Insert the image of the page to be printed into the corresponding row in the print format area and display the print preview interface.

[0072] In one feasible implementation, the code example for steps 243-244 is as follows:

[0073] The bean executes a screen capture of form data based on the provided parameters.

[0074] @param paramBean is a Bean object that contains the parameters required for screen capture.

[0075] @return returns an HTML string containing the screen capture results. If the capture is successful, the results will be embedded in the HTML as images.

[0076] Lic String doFormDataContentScreenCapture(ScreenCapture4FormParamBeanparamBean){

[0077] / / Get the current HttpServletRequest object

[0078] HttpServletRequest request=AppContext.getRawRequest();

[0079] / / Retrieve the parameters required for form screen capture based on paramBean

[0080] Map<String,0object>screenParams=this.getFormScreenCaptureScreenParams(paramBean);

[0081] / / Construct the URL for form screen capture

[0082] String url=this.getFormScreenCaptureUrl(paramBean,request);

[0083] / / Use PhantomJS to scrape the screen based on the URL and parameters, and convert the results into a base64 encoded string.

[0084] String img=PhantomJSUtil.doScreenToBase64(url,screenParams,newHashMap(),reguest);

[0085] / / Construct an HTML string containing the images from the scraped results

[0086] StringBuilder html=new StringBuilder();

[0087] html.append(" <img src=\"");

[0088] html.append(Strings.isBlank(img)?"":"data:image / png;base64,"+img);

[0089] html.append("\" / >");

[0090] return html.toString();

[0091] }

[0092] Step 25: In response to the triggered batch printing operation, print the print preview interface.

[0093] Here, the content of the pages to be printed in the print preview interface is displayed continuously. The actual printed document is divided into pages. After the content of one page to be printed is finished, the next page to be printed will start from a new sheet of paper.

[0094] In this embodiment, HTML web pages can be printed in batches directly, which improves the printing efficiency of HTML web pages.

[0095] When a user triggers the batch print button on the front end, the print preview interface will be displayed directly. The above process is completed on the back end.

[0096] A third aspect of this invention provides a webpage-based batch printing method comprising the following steps:

[0097] Step 31: In response to a batch print command for multiple pages to be printed triggered on the print list page, create a print format area.

[0098] The page to be printed includes: the entire area, a main print area, and at least one additional print area. Correspondingly, the print identifier includes: an entire area identifier, a main print identifier, and at least one additional print area identifier. Page links include: an entire area link, a main link, and at least one additional print area link. Each page to be printed is associated with one entire area identifier and one main print identifier.

[0099] In this step, a webpage to be printed can be divided into multiple printable areas. During batch printing, one or more printable areas from a webpage can be printed. For example, if a page contains a form, approval comments for each approval process, and remarks, the three printable areas corresponding to these sections are: the form content (main printable area), and the other two content areas (additional printable areas). During batch printing, you can choose to print the main printable area, other additional printable areas, or the entire webpage (all content). Each content area of ​​a webpage can generate a link: the entire webpage corresponds to a link to the entire webpage, the main printable area corresponds to a main link, and the remaining areas correspond to their respective additional printable area links. These links are unique.

[0100] It should be noted that in this embodiment, the main print area of ​​all pages to be printed is printed by default.

[0101] In this embodiment, a table is used as an example to illustrate the print format area. The corresponding links lead to the content of the respective areas. The list of pages to be printed displays the titles of the pages to be printed. Each page title is linked to the entire print area. A selection box appears before each page title, allowing users to check multiple boxes to select the pages to be printed. After selecting the pages, clicking the batch print button on the list of pages to be printed creates the print format area. In this embodiment, the default print format area is a table.

[0102] Furthermore, for tabular printable areas, table attributes can be pre-configured. After clicking the batch print button, the format type and attributes of the printable areas can be selected, including border width, row width, and other properties. In this embodiment, each main printable area typically occupies one row of the table. The width of each row can be set by default (100%) based on the paper size or manually. The height of each row adapts to the content of the main printable area.

[0103] Step 32: Obtain the print identifier associated with the page to be printed. The print identifier is the main print identifier. When obtaining the print identifier for each page to be printed, the main print identifier for each page is used as the first item to be obtained. That is, in this step, the first item to be obtained is the main print identifier by default. Therefore, the programming process and logic processing of the batch printing program can be simplified, and the processing efficiency can be improved.

[0104] In one feasible implementation, access permissions can be set when obtaining the main print identifier. Users with permissions can obtain the main print identifier, while users without permissions cannot obtain it, meaning they cannot print the main print area.

[0105] Step 33: Generate an identifier array from the main print identifier.

[0106] Step 33 involves generating an identifier array for each main print identifier. Each identifier array is an element of the print format area.

[0107] In this embodiment, the content of a row in the tabular print format area is also considered an element. The print format area (table) for batch printing of multiple pages to be printed has multiple rows, and one element in each row corresponds to one main print area.

[0108] Step 34: Obtain the parameter information and main link of the element in the corresponding print format area based on the identifier array.

[0109] In this step, the array is read to obtain the main print identifier, and the parameter information of the print format area is obtained based on the main print identifier, such as the print format area identifier, row identifier (which row), and form type, etc., and the corresponding main link is obtained based on the main print identifier.

[0110] Step 35: Display the main print area based on the parameter information and the main link, and generate a print preview interface. The print preview interface displays the print format area (table) and the content of each row of the table (the content of the main print area). If the main print area is a CAP3 form, the link is directly invoked to display the CAP3 form. If the main print area is a CAP4 form, a screenshot needs to be taken and inserted into each row of the corresponding print format area (table).

[0111] Step 35 includes steps 351-354:

[0112] Step 351: Determine the type of content in the main print area based on the parameter information.

[0113] Step 352: When the content type of the main print area is CAP3 form, display the main print area according to the main link and generate a print preview interface.

[0114] Step 353: When the content type of the main print area is CAP4 form, obtain the image of the main print area based on the parameter information and the main link.

[0115] When taking a screenshot of the main print area of ​​a specific row in the print format area, the image of the main print area is obtained based on the parameter information of that row, such as the print format area identifier and row identifier (which row) and the main link.

[0116] Specifically, the PhantomJS tool is used to obtain an image of the main print area based on the page link and parameter information.

[0117] Step 354: Display the image of the main print area in the print format area to generate a print preview interface. Specifically, construct an HTML string including the image of the main print area to display the image of the main print area in the print format area and generate a print preview interface. Insert the image of the main print area into the corresponding row of the print format area and display the print preview interface.

[0118] In one feasible implementation, the code example for steps 353-354 is as follows:

[0119] The bean executes a screen capture of form data based on the provided parameters.

[0120] @param paramBean is a Bean object that contains the parameters required for screen capture.

[0121] @return returns an HTML string containing the screen capture results. If the capture is successful, the results will be embedded in the HTML as images.

[0122] Lic String doFormDataContentScreenCapture(ScreenCapture4FormParamBeanparamBean){

[0123] / / Get the current HttpServletRequest object

[0124] HttpServletRequest request=AppContext.getRawRequest();

[0125] / / Retrieve the parameters required for form screen capture based on paramBean

[0126] Map<String,0object>screenParams=this.getFormScreenCaptureScreenParams(paramBean);

[0127] / / Construct the URL for form screen capture

[0128] String url=this.getFormScreenCaptureUrl(paramBean,request);

[0129] / / Use PhantomJS to scrape the screen based on the URL and parameters, and convert the results into a base64 encoded string.

[0130] String img=PhantomJSUtil.doScreenToBase64(url,screenParams,newHashMap(),reguest);

[0131] / / Construct an HTML string containing the images from the scraped results

[0132] StringBuilder html=new StringBuilder();

[0133] html.append(" <img src=\"");

[0134] html.append(Strings.isBlank(img)?"":"data:image / png;base64,"+img);

[0135] html.append("\" / >");

[0136] return html.toString();

[0137] }

[0138] Step 36: In response to the triggered batch printing operation, print the print preview interface.

[0139] Here, the main print area in the print preview interface is displayed continuously. The actual printed document is divided into pages. After the main print area of ​​one page is printed, the main print area of ​​the next page will be printed from a new sheet of paper.

[0140] In this embodiment, partial content of an HTML webpage can be printed in batches, improving the printing efficiency of HTML webpages and meeting different printing needs.

[0141] When a user triggers the batch print button on the front end, the print preview interface will be displayed directly. The above process is completed on the back end.

[0142] A fourth aspect of this invention provides a webpage-based batch printing method comprising the following steps:

[0143] Step 41: In response to the configuration of the pages to be printed on the print list page and the triggered batch print command for multiple pages to be printed, create a print format area.

[0144] The configuration operation for the page to be printed involves selecting the printable identifier for the page, and the print format area is in table format.

[0145] A page to be printed includes: the entire area, a main print area, and at least one additional print area. Correspondingly, the print identifier includes: an entire area identifier, a main print identifier, and at least one additional print area identifier. Page links include: an entire area link, a main link, and at least one additional print area link. A page to be printed is associated with one entire area identifier and one main print identifier.

[0146] In this step, a webpage to be printed can be divided into multiple printable areas. During batch printing, one or more printable areas from a webpage can be printed. For example, if a page contains a form, approval comments for each approval process, and notes, the three printable areas would be: the form content as the main printable area, the other two content areas as two supplementary printable areas, and the entire webpage content as the full printable area. During batch printing, at least one printable area of ​​the page can be selected for printing. Each content area of ​​a webpage can generate a link: the full printable area corresponds to a full printable link, the main printable area corresponds to a main link, and the remaining areas correspond to their respective supplementary printable area links. These links are unique.

[0147] It should be noted that, in this embodiment, batch printing refers to printing at least one additional printing area and / or the main printing area of ​​a page to be printed, or printing the entire area, which can batch print all or part of the required content of a webpage.

[0148] In this embodiment, a table is used as an example to illustrate the print format area. The corresponding links lead to the content of the respective areas. The list of pages to be printed displays the titles of the pages to be printed. Each page title is linked to the entire print list, and a selection box appears before each title, allowing multiple selections to be checked. The selected pages are the pages to be printed. After selecting the pages to be printed, a selection interface for the printable icons of those pages is displayed. After checking the printable icons, clicking the batch print button on the list of pages to be printed creates the print format area. In this embodiment, the default print format area is a table.

[0149] Furthermore, for tabular printable areas, table attributes can be pre-configured. After clicking the batch print button, the format type and attributes of the printable area can be selected, including border width, row width, and other properties. In this embodiment, each page to be printed typically occupies one row of the table. The width of each row can be set by default (100%) based on the paper size, or manually. The height of each row adapts to the content of the page to be printed.

[0150] Step 42: Generate an array of identifiers to be printed.

[0151] Step 42 specifically includes steps 421-422:

[0152] Step 421: Generate an array of identifiers for each identifier to be printed selected in the configuration operation.

[0153] In one feasible implementation, selection permissions can be set when selecting the main print identifier. Users with permissions can select the main print identifier, while users without permissions cannot select it, meaning they cannot print the main print area.

[0154] Step 422: Determine whether the printable areas corresponding to at least two printable identifiers correspond to the same printable page.

[0155] If so, then the identifier array generated from at least two identifiers to be printed is an element of the print format area.

[0156] In this step, the identifier array corresponding to each page to be printed is one element of the print format area. That is, when multiple printable areas of a page need to be printed, the multiple identifier arrays associated with a single printable page are one element. In subsequent steps, that is, in the print preview interface, the contents of the multiple printable areas of a single printable page are displayed in one row of the table.

[0157] In this embodiment, the content of a row in the tabular print format area is also an element. The print format area (table) for batch printing of multiple pages to be printed has multiple rows, and one element in each row corresponds to at least one printable area of ​​one page to be printed.

[0158] Step 43: Obtain the parameter information and links (full area links or one main link and / or at least one additional print area link) of the corresponding print format area elements based on the identifier array.

[0159] In this step, the array is read to obtain the selected identifier to be printed. Based on the identifier to be printed, the parameter information of the print format area is obtained, such as the print format area identifier, row identifier (which row), and form type. The corresponding link is then obtained based on the identifier to be printed.

[0160] Step 44: Display the corresponding area to be printed based on the parameter information and page links, and generate a print preview interface. The print preview interface displays the print format area (table) and the content of each row of the table. If the content of the area to be printed is a CAP3 form or text, the link is directly invoked to display the CAP3 form or text. If the content of the area to be printed is a CAP4 form, a screenshot needs to be taken and inserted into each row of the corresponding print format area (table).

[0161] Step 44 specifically includes steps 441-444:

[0162] Step 441: Determine the type of content in the area to be printed based on the parameter information.

[0163] Step 442: When the content type of the area to be printed is CAP3 form, display the area to be printed according to the corresponding link and generate a print preview interface.

[0164] Step 443: When the content type of the area to be printed is CAP4 form, obtain the image of the area to be printed based on the parameter information and the link.

[0165] When capturing a screenshot of a specific row within the print format area, the image of the printable area is retrieved based on parameters such as the print format area identifier, row identifier (which row), and the link. Specifically, the PhantomJS tool is used to retrieve the image of the printable area based on the link and parameter information.

[0166] Step 444: Display the image of the area to be printed in the print format area to generate a print preview interface. Specifically, construct an HTML string containing the image of the area to be printed to display the image of the area to be printed in the print format area and generate a print preview interface.

[0167] In this step, the image of the area to be printed is inserted into the row of the corresponding print format area, and the print preview interface is displayed.

[0168] Step 45: In response to the triggered batch printing operation, print the print preview interface.

[0169] Here, the content of the area to be printed in the print preview interface is displayed continuously. The actual printed document is divided into pages. After the content of one area to be printed is finished, the next area to be printed will be printed from a new sheet of paper.

[0170] In this embodiment, partial content of an HTML webpage can be printed in batches, improving the printing efficiency of HTML webpages and meeting different printing needs.

[0171] When a user triggers the batch print button on the front end, the print preview interface will be displayed directly. The above process is completed on the back end.

[0172] like Figure 2 As shown, a fifth aspect of the present invention provides a webpage-based batch printing apparatus, comprising:

[0173] Module 51 is created to create a print format area in response to a batch print command for multiple pages to be printed triggered on the print list page; wherein, each page to be printed corresponds to a print identifier, and each page to be printed corresponds to a page link;

[0174] Generation module 52 is used to generate an identifier array from the identifiers to be printed;

[0175] The acquisition module 53 is used to obtain the parameter information and page links of the elements in the corresponding print format area based on the identifier array;

[0176] Preview module 54 is used to display the page to be printed based on parameter information and page links, and generate a print preview interface;

[0177] Printing module 55 is used to print the print preview interface in response to triggered batch printing operations.

[0178] In one embodiment of the present invention, the print format area is in table form;

[0179] Generate an array of identifiers to be printed, including:

[0180] Generate an array of identifiers for each identifier to be printed; where each identifier array is an element of the print format area.

[0181] In one embodiment of the present invention, the page to be printed is displayed according to parameter information and page links, and a print preview interface is generated, including:

[0182] When the form type indicated in the parameter information is CAP4, obtain the image of the page to be printed based on the parameter information and the page link;

[0183] Display the image of the page to be printed in the print format area to generate a print preview interface.

[0184] In one embodiment of the present invention, obtaining an image of the page to be printed based on parameter information and page links includes:

[0185] Use the PhantomJS tool to obtain an image of the page to be printed based on the page link and parameter information.

[0186] In one embodiment of the present invention, displaying an image of the page to be printed in the print format area and generating a print preview interface includes:

[0187] Construct an HTML string that includes an image of the page to be printed, and display the image of the page to be printed in the print format area to generate a print preview interface.

[0188] In one embodiment of the present invention, the page to be printed includes: a full area, a main printing area and at least one additional printing area. Correspondingly, the identifier to be printed includes: a full area identifier, a main printing identifier and at least one additional printing area identifier. The page link includes: a full area link, a main link and at least one additional printing area link.

[0189] A web-based batch printing device also includes:

[0190] The default acquisition module is used to acquire the identifier to be printed; the identifier to be printed is the main print identifier.

[0191] In response to a batch print command for multiple pages to be printed triggered on the print list page, create a print format area, including:

[0192] In response to the configuration operation of the pages to be printed on the print list page, and the batch printing command of multiple pages to be printed triggered, a print format area is created; wherein, the configuration operation of the pages to be printed is the selection operation of the print identifier of the pages to be printed, and the print format area is in table form;

[0193] Generate an array of identifiers to be printed, including:

[0194] Generate an array of identifiers for each identifier to be printed;

[0195] Determine whether at least two printable identifiers correspond to the same printable page;

[0196] If so, then the identifier array generated from at least two identifiers to be printed is an element of the print format area.

[0197] A sixth aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a webpage-based batch printing method provided in the above embodiments of the present invention.

[0198] A seventh aspect of the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the webpage-based batch printing method provided in the above embodiments of the present invention.

[0199] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0200] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware systems.

[0201] The method provided in this invention can be applied to electronic devices. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc. No limitation is made herein; any electronic device that can implement this invention falls within the protection scope of this invention.

[0202] For the device / electronic device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments.

[0203] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0204] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0205] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0206] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A batch printing method based on web pages, characterized in that, Includes the following steps: In response to a batch print command for multiple pages to be printed triggered on the print list page, create a print format area, including: In response to the configuration operation of the pages to be printed on the printable list page, and the triggered batch printing command of multiple pages to be printed, a print format area is created; wherein, the configuration operation of the pages to be printed is a selection operation of the printable identifier of the pages to be printed, and the print format area is in table format; each page to be printed corresponds to a printable identifier, and each page to be printed corresponds to a page link; each page to be printed includes: a full area, a main print area, and at least one additional print area, the printable identifier includes: a full area identifier, a main print identifier, and at least one additional print area identifier, and the page link includes: a full area link, a main link, and at least one additional print area link; Generate an identifier array from the identifiers to be printed, including: Generate an identifier array for each of the identifiers to be printed; Determine whether at least two of the printable identifiers correspond to the same printable page; If so, the identifier array generated by the at least two identifiers to be printed is an element of the print format area; wherein, the content of a row in the tabular print format area is an element, and the identifier array corresponding to each page to be printed is an element of the print format area; The parameter information of the element in the corresponding print format area and the page link are obtained according to the identifier array; The page to be printed is displayed based on the parameter information and the page link, and a print preview interface is generated; wherein, the contents of multiple printable areas of a page to be printed in the print preview interface are displayed in a row of a table; In response to the triggered batch printing operation, the print preview interface is printed.

2. The method as described in claim 1, characterized in that, The print format area is in table form; The step of generating an identifier array from the identifiers to be printed includes: Generate an identifier array for each of the identifiers to be printed; wherein each identifier array is an element of the print format area.

3. The method as described in claim 2, characterized in that, The step of displaying the page to be printed based on the parameter information and the page link, and generating a print preview interface, includes: When the form type indicated in the parameter information is CAP4, the image of the page to be printed is obtained according to the parameter information and the page link; The image of the page to be printed is displayed in the print format area to generate a print preview interface.

4. The method as described in claim 3, characterized in that, The step of obtaining the image of the page to be printed based on the parameter information and the page link includes: The PhantomJS tool is used to obtain an image of the page to be printed based on the page link and the parameter information.

5. The method as described in claim 1, characterized in that, The step of displaying the image of the page to be printed in the print format area and generating a print preview interface includes: An HTML string including the image of the page to be printed is constructed to display the image of the page to be printed in the print format area, thereby generating a print preview interface.

6. The method as described in claim 1, characterized in that, The method further includes: Obtain the print identifier corresponding to the page to be printed; the print identifier is the main print identifier.

7. A webpage-based batch printing device, characterized in that, include: A module is created to respond to batch print commands for multiple pages to be printed triggered on a printable list page, creating print format areas, including: In response to the configuration operation of the pages to be printed on the printable list page, and the triggered batch printing command of multiple pages to be printed, a print format area is created; wherein, the configuration operation of the pages to be printed is a selection operation of the printable identifier of the pages to be printed, and the print format area is in table format; each page to be printed corresponds to a printable identifier, and each page to be printed corresponds to a page link; each page to be printed includes: a full area, a main print area, and at least one additional print area, and correspondingly, the printable identifier includes: a full area identifier, a main print identifier, and at least one additional print area identifier, and the page link includes: a full area link, a main link, and at least one additional print area link; The generation module is used to generate an identifier array from the identifiers to be printed, including: Generate an identifier array for each of the identifiers to be printed; Determine whether at least two of the printable identifiers correspond to the same printable page; If so, the identifier array generated by the at least two identifiers to be printed is an element of the print format area; wherein, the content of a row in the tabular print format area is an element, and the identifier array corresponding to each page to be printed is an element of the print format area; The acquisition module is used to obtain parameter information of the corresponding elements of the print format area and the page link according to the identifier array; The preview module is used to display the page to be printed based on the parameter information and the page link, and generate a print preview interface; wherein, the contents of multiple printable areas of a page to be printed in the print preview interface are displayed in a row of a table; The printing module is used to print the print preview interface in response to a triggered batch printing operation.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the webpage-based batch printing method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the webpage-based batch printing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Page printing and exporting method suitable for multiple browsers

    CN114296661A

  • Multi-webpage merging printing method and device and computing equipment

    CN116661715A