Nothing Special   »   [go: up one dir, main page]

CN115543238B - Browser page printing method, device, equipment and storage medium - Google Patents

Browser page printing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115543238B
CN115543238B CN202211504601.7A CN202211504601A CN115543238B CN 115543238 B CN115543238 B CN 115543238B CN 202211504601 A CN202211504601 A CN 202211504601A CN 115543238 B CN115543238 B CN 115543238B
Authority
CN
China
Prior art keywords
page
picture
browser
paging
tag
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.)
Active
Application number
CN202211504601.7A
Other languages
Chinese (zh)
Other versions
CN115543238A (en
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.)
Mingdu Zhiyun Zhejiang Technology Co Ltd
Original Assignee
Mingdu Zhiyun Zhejiang 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 Mingdu Zhiyun Zhejiang Technology Co Ltd filed Critical Mingdu Zhiyun Zhejiang Technology Co Ltd
Priority to CN202211504601.7A priority Critical patent/CN115543238B/en
Publication of CN115543238A publication Critical patent/CN115543238A/en
Application granted granted Critical
Publication of CN115543238B publication Critical patent/CN115543238B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/1242Image or content composition onto a page
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a browser page printing method, a device, equipment and a storage medium, and relates to the technical field of printing, wherein the method comprises the following steps: responding to a printing instruction input aiming at a browser page, and performing label identification on the browser page to obtain a plurality of page labels of the browser page; paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of a preset canvas to obtain at least two paged pages; and generating a printing preview interface of the browser page according to the at least two paging pages. By adopting the method and the device, the printing experience of the user can be improved, and the display effect of the browser page printing can be improved.

Description

Browser page printing method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of printing, in particular to a browser page printing method, device, equipment and storage medium.
Background
In the process of browser page development, the design mode of the existing browser page can provide rich display styles, and content is completely displayed in the browser page.
However, in the prior art, if a browser page needs to be printed, if a form, a picture and other non-detachable fixed page elements appear in different pages, the form or the picture can only be cut and then printed on different pages, or the browser page is wholly zoomed, and the printing effect is poor.
Disclosure of Invention
The embodiment of the invention provides a browser page printing method, device and equipment and a storage medium, which can improve the printing experience of a user and increase the display effect of browser page printing.
In a first aspect, an embodiment of the present invention provides a browser page printing method, where the method includes:
responding to a printing instruction input aiming at a browser page, and performing label identification on the browser page to obtain a plurality of page labels of the browser page;
paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of a preset canvas to obtain at least two paged pages;
and generating a printing preview interface of the browser page according to the at least two paging pages.
Optionally, the paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, and the size of a preset canvas to obtain at least two paged pages includes:
if the plurality of page tags include: presetting a page tag, and converting the page content of a fixed page element corresponding to the preset page tag into a page picture;
and paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents of the fixed page element, the size of the page picture and the size of the preset canvas to obtain at least two paging pages.
Optionally, the paging the page content corresponding to the plurality of page tags according to the arrangement information of the page content of the fixed-page element, the size of the page picture, and the size of the preset canvas, to obtain the at least two paged pages, includes:
determining a corresponding area of the page picture in a single paging page according to the arrangement information of the page content of the fixed page element;
judging whether the size of the corresponding area is enough to accommodate the page picture or not according to the size of the page picture;
and if the size of the corresponding area is not enough to accommodate the page picture, adding the page picture to a next paging page corresponding to the single paging page.
Optionally, the adding the page picture to the next paging page corresponding to the single paging page includes:
and zooming the page picture according to the size of the preset canvas, and adding the page picture to the next page.
Optionally, the preset page tag includes: a table tag; the converting the page content of the fixed page element corresponding to the preset page tag into a page picture includes:
converting the page content of a first fixed page element corresponding to the form tag into a first picture;
the page picture comprises: the first picture.
Optionally, the preset page tag includes: a picture label; the converting the page content of the solid page element corresponding to the preset page tag into a page picture further includes:
converting the page content of a second fixed page element corresponding to the picture tag into a second picture;
the page picture comprises: the second picture.
Optionally, the converting the page content of the FixedPage element corresponding to the preset page tag into a page picture further includes:
and adopting a preset image drawing plug-in corresponding to the browser page, and converting the page content of the solid page element corresponding to the preset page tag into the page picture.
In a second aspect, an embodiment of the present invention further provides a browser page printing apparatus, where the apparatus includes:
the identification module is used for responding to a printing instruction input aiming at a browser page and carrying out label identification on the browser page to obtain a plurality of page labels of the browser page;
the paging module is used for paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of a preset canvas to obtain at least two paged pages;
and the generating module is used for generating a print preview interface of the browser page according to the at least two paging pages.
In a third aspect, an embodiment of the present invention further provides a browser page printing apparatus, including: a processor, a memory and a bus, wherein the memory stores program instructions executable by the processor, the processor and the memory communicate via the bus when the browser page printing device is running, and the processor executes the program instructions to perform the steps of the browser page printing method according to any one of the first aspect.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the browser page printing method according to any one of the first aspect.
According to the browser page printing method, device, equipment and storage medium provided by the invention, the label identification can be carried out on the browser page when a user needs to print the browser page, so that the current browser page is paged according to the arrangement information of the page contents corresponding to a plurality of page labels contained in the current browser page, the page contents corresponding to the page labels and the size of the preset canvas, and finally the paged page is used for generating the print preview page. By using the browser page printing method, the browser page is not directly and blindly cut when printed, and the content corresponding to different page tags contained in the current browser page can be considered, so that the problem that the content corresponding to any page tag is divided and displayed by two pages when paging is printed is solved, the display influence of paging on different page tags in the printing process is reduced, the browser page content can be displayed on the print preview page completely without being separated, the experience of user printing is improved, and the display effect of browser page printing is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic flowchart of a browser page printing method according to the present invention;
FIG. 2 is a flowchart illustrating a method for paging a browser according to the present invention;
FIG. 3 is a flowchart illustrating another method for paging a browser according to the present invention;
FIG. 4 is a schematic diagram of a browser page printing apparatus according to the present invention;
fig. 5 is a schematic diagram of a browser page printing device provided by the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Furthermore, the appearances of the terms "first," "second," and the like, if any, are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
Before explaining the present invention in detail, an application scenario of the present invention will be described.
When the browser prints a page, a default printer is generally adopted as a preferred printer, and the default page size and the margin of the printer are adopted as preferred page formats for printing. Meanwhile, the printing range is the whole webpage, typesetting is carried out according to a default page format, if the width or the length of the webpage is larger than that of the printed page, the problem of printing content loss is easy to occur, or when automatic paging is carried out on the webpage, a split display effect is easy to generate for inseparable fixed page elements such as tables and pictures, namely, the same table is split by at least two pages, so that the printing effect of the browser is poor, and the user experience is poor.
Based on the above, the method, the device, the equipment and the storage medium for printing the browser page provided by the invention can be used for carrying out label identification on the browser page when a user needs to print the browser page, so that the current browser page is subjected to paging according to the arrangement information of the page contents corresponding to a plurality of page labels contained in the current browser page, the page contents corresponding to the page labels and the size of the preset canvas, and finally, the page to be printed is generated by using the paged page, thereby improving the experience of printing by the user and increasing the display effect of printing the browser page. The browser page printing method provided by the following embodiment of the present invention may be executed by a browser page printing device, where the browser page printing device may be a computer device such as a notebook computer, a desktop computer, and a server.
The following is an explanation by way of various embodiments in conjunction with the accompanying drawings. Fig. 1 is a schematic flow chart of a browser page printing method provided by the present invention. As shown in fig. 1, the method includes:
s110, responding to a printing instruction input aiming at the browser page, and performing label identification on the browser page to obtain a plurality of page labels of the browser page.
The browser page can be made by adopting an HTML language, and the HTML language can realize sequential reading and browsing of the browser page and effectively display contents such as texts, pictures, tables, videos and the like. Optionally, languages such as JavaScript and Python may also be used to create the browser page, which is not limited in the present application, for convenience of description, the following embodiments of the present application use an HTML language as an example for description, and similar methods for printing the browser page implemented by the browser page built in the other languages are not repeated.
Alternatively, a print instruction may be input by the user for the browser page. It should be noted that, the user may directly input the print instruction through the browser page, or may input the print instruction by using the developed application program, which is not limited in this application. Optionally, if the user directly inputs the print instruction through the browser page, the user may directly click a preset print button on the browser page, and after receiving the print instruction, the browser page printing device may respond to the print instruction input for the browser page, and perform tag identification on the current browser page.
The browser page includes various page tags such as a tag img for picture display, a tag table for table display, and a tag head for document title.
Optionally, a preset crawler program may be used to perform tag identification on the browser page, so as to obtain a plurality of page tags included in the current browser page.
And S120, paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of a preset canvas to obtain at least two paged pages.
After the tags of the browser page are identified and the multiple page tags are obtained, the arrangement information of the page contents corresponding to the multiple page tags, that is, the arrangement sequence information of the multiple page tags in the current browser page, and the page contents corresponding to the multiple page tags in the current browser page can be obtained. Then, the page contents corresponding to the plurality of page tags can be paged according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of the preset canvas, so that at least two paged pages are obtained.
It should be noted that the size of the preset canvas mentioned here is the size of the preset printing paper included in the printing instruction input by the user, that is, the size of the printing paper desired by the user.
Optionally, when the user directly clicks a print button on the browser page, the preset default print paper size is adopted as the preset canvas size. Of course, the user can freely set the size of the preset canvas according to the requirement. Optionally, the size of the preset canvas may be the size of a standard paper sheet such as A3, A4, A5, etc.
In one possible implementation, the preset canvas size includes not only the size of the printing paper but also the margin size of the printing paper. Similarly, when the user directly clicks on the print button on the browser page, the default print paper margin size is used as the size of the canvas.
Meanwhile, it should be noted that, in the process of paging the page content corresponding to the multiple page tags, the position of the page content corresponding to each page tag in the paged page needs to be paid attention to instead of simply directly dividing the whole browser page by using the size of the preset canvas.
Optionally, in the present application, in the process of paging the page content corresponding to the plurality of page tags, paging is performed twice respectively. The first paging is pre-paging, namely, the page content corresponding to the page tags is firstly divided by using the size of a preset canvas to obtain a plurality of pre-paging pages, then, the pre-paging pages are paged for the second time according to the positions of the page content corresponding to each page tag in the paging pages, and finally, at least two paging pages are obtained.
Optionally, after the pre-paged page is obtained, the position of the page content corresponding to each page tag in the paged page can be observed, and if the page content corresponding to any page tag is split and displayed in a plurality of pre-paged pages, the page content corresponding to the page tag is uniformly moved to the same page, so that the page content corresponding to the page tag is ensured to be displayed in the page of the same page, and the paged page is finally obtained.
Optionally, if the page content corresponding to the page tag is too much or too large to be directly displayed on the same page in the paging process, the page content corresponding to the page tag needs to be scaled according to the size of the preset canvas until the page content corresponding to the page tag is displayed on the same page, and finally the paged page is obtained.
And S130, generating a printing preview interface of the browser page according to the at least two paging pages.
And when at least two paging pages are generated, rendering can be performed according to the two paging pages to generate a printing preview interface of the browser page.
Optionally, the paginated page can be sent to the browser end, so that the browser end displays the print preview interface to the user. Optionally, if the browser is connected to a printer, the print preview interface may be printed on the paper according to a print instruction confirmed by the user. Alternatively, the browser end may directly call the pdf converter to generate the pdf print file.
Optionally, in order to facilitate quick printing by the user, the browser page printing device may further store different printing instructions for different users, that is, store different sizes of the preset canvas as default sizes for different users, and when different users log in different accounts, match the size of the corresponding preset canvas according to the account information for use in printing pages.
In this embodiment, by using such a browser page printing method, when printing, direct blind segmentation is no longer performed on a browser page, and contents corresponding to different page tags included in a current browser page are considered, so that when paging is performed, the problem that the contents corresponding to any page tag are displayed by two pages in a split manner is avoided, the display influence of paging on different page tags in the printing process is reduced, the browser page contents can be displayed on a print preview page completely without being blocked, the experience of user printing is improved, and the display effect of browser page printing is increased.
On the basis of the browser page printing method provided in fig. 1, an embodiment of the present invention further provides a possible implementation manner for paging a browser page. Fig. 2 is a flowchart illustrating a method for paging a browser according to the present invention. As shown in fig. 2, in the step S120, paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, and the size of the preset canvas, so as to obtain at least two paged pages, including:
s210, if the plurality of page tags include: and presetting a page tag, and converting the page content of the fixed page element corresponding to the preset page tag into a page picture.
In this embodiment, the preset page tag is a preset page tag that needs to convert corresponding content into a page picture, and generally, the page content corresponding to the preset page tag is a page content of a fixed-page element, where the fixed-page element is an inseparable page element, for example: the page elements such as tables and pictures cannot be split in the paging operation mentioned in the present application, that is, the page content corresponding to the page elements cannot be displayed in multiple paging pages.
When the page content of the fixed-page element is converted into the page picture, the page content may be converted according to a preset ratio, optionally, the page content of the fixed-page element may be converted into the page picture according to a ratio of 1.
And S220, paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents of the fixed page elements, the size of the page picture and the size of the preset canvas to obtain at least two paged pages.
In this embodiment, paging may be performed on the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents of the fixed-page element, the size of the page picture after the page contents of the fixed-page element are converted, and the size of the preset canvas. It should be noted that, for a plurality of page tags, not only preset page tags but also page tags such as document title tags and hyperlink tags exist.
Optionally, during paging, it is determined whether the page picture can be placed in the same page according to the arrangement information of the page content of the fixed-page element and the size of the preset canvas, where the page content corresponding to the page tag is added to the browser page before the page picture is converted, that is, it is determined whether the size of the residual canvas after the page content corresponding to the page tag is placed in the preset canvas can accommodate the page picture.
In a possible implementation manner, if the height of the page picture is greater than that of the remaining canvas, the page picture is directly placed into the next page in the second paging process, and the remaining canvas of the current page is processed in a blank space; if the height of the page picture is smaller than or equal to the height of the rest canvas, but the width of the page picture is larger than the width of the canvas, the page picture is zoomed according to the size of the preset canvas, so that the page picture can be placed on the current page.
In this embodiment, through the mode with the picture of page label conversion to when the paging, prevent the problem that the page content of solid page element is shown by the split, make print preview page can show browser page content in the ground of not cutting off completely, promoted the experience sense that the user printed, increase the display effect that browser page printed.
On the basis of the method for paging the browser provided in fig. 2, the present application also provides a possible implementation manner of the method for paging the browser. Fig. 3 is a flowchart illustrating another method for paging a browser according to the present invention. As shown in fig. 3, in the step S220, paging the page contents corresponding to the multiple page tags according to the arrangement information of the page contents of the fixed page element, the size of the page picture, and the size of the preset canvas, so as to obtain at least two paged pages, including:
s310, according to the arrangement information of the page content of the fixed page element, determining a corresponding area of the page picture in the single paging page.
In this embodiment, according to the arrangement information of the page content of the fixed-page element, the corresponding area of the east-missing page picture in the single paging page may be obtained, that is, according to the arrangement information of the page content of the fixed-page element corresponding to the page picture, so that in the single paging page, after the page content corresponding to the upper-link page tag of the page picture in the browser page is placed, the remaining area is the corresponding area of the page picture in the single paging page.
S320, judging whether the size of the corresponding area is enough to accommodate the page picture according to the size of the page picture.
After the corresponding area is determined, whether the size of the corresponding area is enough to accommodate the page picture can be judged according to the size of the page picture, namely whether the height and the width of the current corresponding area are both larger than or equal to the height and the width of the page picture is judged.
S330, if the size of the corresponding area is not enough to accommodate the page image, the page image is added to the next paging page corresponding to the single paging page.
If the height and the width of the corresponding area are both smaller than the height and the width of the page picture, that is, the size of the corresponding area is not enough to accommodate the page picture, the page picture is added to the next paging page corresponding to a single paging page, and in this case, the page picture needs to be scaled according to the size of the preset canvas, so that the width of the page picture is smaller than or equal to the width of the preset canvas.
It should be noted that, if the height of the corresponding region is smaller than the height of the page picture, but the width of the corresponding region is greater than or equal to the width of the page picture, the page picture is directly added to the next paging page corresponding to a single paging page.
Optionally, in the step S330, if the size of the corresponding area is not enough to accommodate the page picture, adding the page picture to a next paging page corresponding to the single paging page includes:
and zooming the page picture according to the size of the preset canvas, and adding the page picture to the next page.
In a possible case, if the height of the page picture is greater than the height of the preset canvas, that is, even if the page picture is added to the next paging page corresponding to a single paging page, the next paging page does not have enough area to accommodate the page picture, the page picture needs to be scaled according to the size of the preset canvas, so that after the height of the page picture is less than or equal to the height of the preset canvas, the scaled page picture is added to the next paging page.
In this embodiment, the page picture is zoomed and then added to the next page, so as to prevent the problem that the page content of the fixed page element is split and displayed.
Optionally, the preset page tag includes: a table tag; in the above S210, converting the page content of the fixed-page element corresponding to the preset page tag into a page picture, includes:
converting the page content of a first fixed page element corresponding to the form label into a first picture;
the page picture comprises: a first picture.
Optionally, in this embodiment, if the plurality of page tags include: the table tag, that is, the tag table is included, the page content of the first fixed page element corresponding to the table tag is converted into the first picture. The first picture is a picture converted from the page content of the first fixed page element corresponding to the table tag.
In general, a table has multiple rows, and the tag table defines the table and further includes multiple embedded tags, such as a tag tr defining the row number of the table, a tag td defining the cell number of the table, a tag thead defining the head of the table, and so on. No matter how many tags are embedded in the tag table, all contents corresponding to the tag table are required to be converted into the first picture.
Presetting the page tag comprises: a picture label; in the above S210, converting the page content of the fixed-page element corresponding to the preset page tag into a page picture, includes:
converting the page content of a second fixed page element corresponding to the picture tag into a second picture;
the page picture comprises: and a second picture.
Optionally, in this embodiment, if the plurality of page tags include: and converting the page content of the second fixed page element corresponding to the picture tag into a second picture if the picture tag comprises the tag img. The second picture is a picture converted from the page content of the second fixed-page element corresponding to the form label.
Optionally, in the step S210, converting the page content of the solid page element corresponding to the preset page tag into a page picture, further including:
and adopting an image drawing plug-in corresponding to the browser page to convert the page content of the fixed page element corresponding to the preset page tag into a page picture.
In this embodiment, in the process of converting the content of the browser page into the page picture, a preset image drawing plug-in corresponding to the browser page, for example, a canvas. canvas provides a whole set of drawing API interface, adopts JavaScript language to draw graphics, and can convert page pictures according to the specified width and height. Js may be used to convert the page content of the FixedPage element to a page picture at a ratio of 1.
In this embodiment, the page content is converted into the page picture by using the image drawing plug-in, so that the conversion of the page picture is more convenient.
Fig. 4 is a schematic diagram of a browser page printing apparatus provided in the present invention, and as shown in fig. 4, the browser page printing apparatus includes:
the identification module 1000 is configured to perform tag identification on a browser page in response to a print instruction input for the browser page, so as to obtain a plurality of page tags of the browser page;
the paging module 2000 is configured to page the page contents corresponding to the multiple page tags according to the arrangement information of the page contents corresponding to the multiple page tags, and the size of the preset canvas, so as to obtain at least two paged pages;
the generating module 3000 is configured to generate a print preview interface of a browser page according to at least two paginated pages.
Optionally, the browser page printing apparatus further includes: a conversion module, configured to, if the plurality of page tags include: and presetting a page tag, and converting the page content of the fixed page element corresponding to the preset page tag into a page picture.
Optionally, the paging module 2000 is further configured to page the page contents corresponding to the multiple page tags according to the arrangement information of the page contents of the fixed-page elements, the size of the page pictures, and the size of the preset canvas, so as to obtain at least two paged pages.
Optionally, the browser page printing apparatus further includes: and the zooming module is used for zooming the page picture according to the size of the preset canvas and then adding the page picture to the next page.
Optionally, the conversion module is further configured to convert the page content of the first fixed-page element corresponding to the form tag into a first picture; the page picture comprises: a first picture.
Optionally, the conversion module is further configured to convert the page content of the second fixed-page element corresponding to the picture tag into a second picture; the page picture comprises the following steps: and a second picture.
Optionally, the conversion module is further configured to convert the page content of the FixedPage element corresponding to the preset page tag into a page picture by using a preset image drawing plug-in corresponding to the browser page.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, the modules may be integrated together and implemented in the form of a System-on-a-Chip (SOC).
Fig. 5 is a schematic diagram of a browser page printing device according to the present invention, which may be a computing device or a server with computing processing function.
The browser page printing apparatus 10 includes: a processor 11, a storage medium 12 and a bus 13, the storage medium 12 storing machine readable instructions executable by the processor 11, the processor 11 communicating with the storage medium 12 via the bus 13 when the browser page printing apparatus 10 is executing, the processor 11 executing the machine readable instructions to perform the above-described method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the invention also provides a program product, for example a computer-readable storage medium, comprising a program which, when being executed by a processor, is adapted to carry out the above-mentioned method embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a Processor (Processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (9)

1. A browser page printing method, characterized by comprising:
responding to a printing instruction input aiming at a browser page, and performing label identification on the browser page to obtain a plurality of page labels of the browser page;
paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of a preset canvas to obtain at least two paged pages;
generating a printing preview interface of the browser page according to the at least two paging pages;
the paging of the page contents corresponding to the plurality of page tags is performed according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of a preset canvas, so as to obtain at least two paged pages, and the paging method comprises the following steps:
if the plurality of page tags include: presetting a page tag, and converting the page content of a fixed page element corresponding to the preset page tag into a page picture; the plurality of page tags further comprising: a document title tag, a hyperlink tag;
and paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents of the fixed page element, the size of the page picture and the size of the preset canvas to obtain at least two paging pages.
2. The method according to claim 1, wherein the paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents of the fixed-page elements, the size of the page pictures, and the size of the preset canvas to obtain the at least two paged pages comprises:
determining a corresponding area of the page picture in a single paging page according to the arrangement information of the page content of the fixed page element;
judging whether the size of the corresponding area is enough to accommodate the page picture or not according to the size of the page picture;
and if the size of the corresponding area is not enough to accommodate the page picture, adding the page picture to a next paging page corresponding to the single paging page.
3. The method of claim 2, wherein adding the page picture to a next paging page corresponding to the single paging page comprises:
and zooming the page picture according to the size of the preset canvas, and adding the page picture to the next page.
4. The method of claim 1, wherein the preset page tag comprises: a table tag; the converting the page content of the fixed page element corresponding to the preset page tag into a page picture includes:
converting the page content of a first fixed page element corresponding to the form tag into a first picture;
the page picture comprises: the first picture.
5. The method of claim 1, wherein the preset page tag comprises: a picture label; the converting the page content of the solid page element corresponding to the preset page tag into a page picture further includes:
converting the page content of a second fixed page element corresponding to the picture tag into a second picture;
the page picture comprises: the second picture.
6. The method according to claim 1, wherein converting the page content of the FixedPage element corresponding to the preset Page tab into a Page Picture, further comprises:
and converting the page content of the fixed page element corresponding to the preset page tag into the page picture by adopting a preset image drawing plug-in corresponding to the browser page.
7. A browser page printing apparatus, characterized in that the apparatus comprises:
the identification module is used for responding to a printing instruction input aiming at a browser page and carrying out label identification on the browser page to obtain a plurality of page labels of the browser page;
the paging module is used for paging the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents corresponding to the plurality of page tags, the page contents corresponding to the plurality of page tags and the size of a preset canvas to obtain at least two paged pages;
the generating module is used for generating a printing preview interface of the browser page according to the at least two paging pages;
a conversion module, configured to, if the plurality of page tags include: presetting a page tag, and converting the page content of a fixed page element corresponding to the preset page tag into a page picture; the plurality of page tags further comprising: a document title tag, a hyperlink tag;
the paging module is further configured to page the page contents corresponding to the plurality of page tags according to the arrangement information of the page contents of the fixed-page element, the size of the page picture, and the size of the preset canvas, so as to obtain the at least two paging pages.
8. A browser page printing apparatus, comprising: a processor, a memory and a bus, the memory storing program instructions executable by the processor, the processor and the memory communicating via the bus when the browser page printing apparatus is running, the processor executing the program instructions to perform the steps of the browser page printing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the browser page printing method according to any one of claims 1 to 6.
CN202211504601.7A 2022-11-29 2022-11-29 Browser page printing method, device, equipment and storage medium Active CN115543238B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211504601.7A CN115543238B (en) 2022-11-29 2022-11-29 Browser page printing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211504601.7A CN115543238B (en) 2022-11-29 2022-11-29 Browser page printing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115543238A CN115543238A (en) 2022-12-30
CN115543238B true CN115543238B (en) 2023-03-21

Family

ID=84722010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211504601.7A Active CN115543238B (en) 2022-11-29 2022-11-29 Browser page printing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115543238B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076811A (en) * 2023-10-13 2023-11-17 腾讯科技(深圳)有限公司 Webpage export method, device, equipment and storage medium
CN117234442B (en) * 2023-11-09 2024-04-19 金蝶征信有限公司 Data printing method, device, computer equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7385725B1 (en) * 2003-04-02 2008-06-10 Adobe Systems Incorporated Previewing an image rendered on multiple pages
CN112861481A (en) * 2021-01-29 2021-05-28 北京尚医智信健康管理有限公司 Paging processing method and device, electronic equipment and computer readable storage medium
CN113360106A (en) * 2021-06-30 2021-09-07 建信金融科技有限责任公司 Webpage printing method and device
CN114296662A (en) * 2021-12-28 2022-04-08 城云科技(中国)有限公司 Page-based form document paging printing method, device and application thereof
CN114969611A (en) * 2022-06-30 2022-08-30 中国工商银行股份有限公司 Webpage printing method, device, equipment and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8554791B1 (en) * 2005-07-26 2013-10-08 Advanced Micro Devices, Inc. Persistent folder associations for personal internet communicator

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7385725B1 (en) * 2003-04-02 2008-06-10 Adobe Systems Incorporated Previewing an image rendered on multiple pages
CN112861481A (en) * 2021-01-29 2021-05-28 北京尚医智信健康管理有限公司 Paging processing method and device, electronic equipment and computer readable storage medium
CN113360106A (en) * 2021-06-30 2021-09-07 建信金融科技有限责任公司 Webpage printing method and device
CN114296662A (en) * 2021-12-28 2022-04-08 城云科技(中国)有限公司 Page-based form document paging printing method, device and application thereof
CN114969611A (en) * 2022-06-30 2022-08-30 中国工商银行股份有限公司 Webpage printing method, device, equipment and medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"一种基于Web浏览器的票据打印方法";王廷蔚;《计算机时代》;20061002;全文 *
Yaxin Hou ; Ruichun Hou ; Jiguang Yu."A static shell based web page implementation method and application in Haier 3D printing platform".《2016 5th International Conference on Computer Science and Network Technology (ICCSNT)》.2017, *
基于WEB的多页打印报表动态生成;王建平;《微型电脑应用》;20060520(第05期);全文 *

Also Published As

Publication number Publication date
CN115543238A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN115543238B (en) Browser page printing method, device, equipment and storage medium
US20100202010A1 (en) Method and system for printing a web page
AU2012325747A1 (en) Systems, methods, and interfaces for display of inline content and block level content on an access device
CN104156207A (en) File display method and device
US20080100623A1 (en) Determination of Unicode Points from Glyph Elements
CN111859865A (en) Method, device, terminal and medium for converting PDF document
US9886426B1 (en) Methods and apparatus for generating an efficient SVG file
CN115033192B (en) Label printing method and device based on webpage, electronic equipment and storage medium
CN113297425B (en) Document conversion method, device, server and storage medium
CN110674437A (en) Method and device for converting webpage data into PDF (Portable document Format) attachment
CN115757272A (en) Method and system for converting HTML file into OFD file
CN112686000B (en) Format conversion method of electronic book document, electronic equipment and storage medium
CN111444452B (en) Webpage conversion method and device and storage medium
CN111724455A (en) Image processing method and electronic device
US9019552B2 (en) Information processing apparatus, system and method for outputting data to a medium
CN113655973B (en) Page segmentation method and device, electronic equipment and storage medium
CN115687825A (en) Optimization method, device, equipment and storage medium for generating PDF (Portable document Format) file
CN103488619B (en) Method and device for processing document file
US10872201B1 (en) Generation and presentation of electronic books for consumption in skim mode
US20100017708A1 (en) Information output apparatus, information output method, and recording medium
US9984053B2 (en) Replicating the appearance of typographical attributes by adjusting letter spacing of glyphs in digital publications
CN115034177A (en) Presentation file conversion method, device, equipment and storage medium
CN112882665A (en) Method and device for generating printing template, electronic equipment and storage medium
CN114676097A (en) OFD file processing method, device, equipment and medium
CN111914226A (en) Background picture generation method and device

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
GR01 Patent grant
GR01 Patent grant