CN111208955A - Printing method, printing device and server - Google Patents

Printing method, printing device and server Download PDF

Info

Publication number
CN111208955A
CN111208955A CN201811392708.0A CN201811392708A CN111208955A CN 111208955 A CN111208955 A CN 111208955A CN 201811392708 A CN201811392708 A CN 201811392708A CN 111208955 A CN111208955 A CN 111208955A
Authority
CN
China
Prior art keywords
difference
document
size
page
margin
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.)
Granted
Application number
CN201811392708.0A
Other languages
Chinese (zh)
Other versions
CN111208955B (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.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile 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 Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Guangzhou Kingsoft Mobile Technology Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201811392708.0A priority Critical patent/CN111208955B/en
Publication of CN111208955A publication Critical patent/CN111208955A/en
Application granted granted Critical
Publication of CN111208955B publication Critical patent/CN111208955B/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/1218Reducing or saving of used resources, e.g. avoiding waste of consumables or improving usage of hardware resources
    • G06F3/1219Reducing or saving of used resources, e.g. avoiding waste of consumables or improving usage of hardware resources with regard to consumables, e.g. ink, toner, paper
    • 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/1211Improving printing performance
    • G06F3/1215Improving printing performance achieving increased printing speed, i.e. reducing the time between printing start and printing end
    • 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/1224Client or server resources management
    • G06F3/1227Printer definition files
    • 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/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1284Local printer device
    • 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

Abstract

According to the printing method, the printing device and the server provided by the embodiment of the invention, the document to be printed is obtained and analyzed, so that a plurality of objects forming the document content of the document to be printed are obtained, and the background object is identified from the plurality of objects by utilizing a preset background identification algorithm. And after receiving the printing instruction, rendering the non-background object in the document to be printed as the printing object based on the identification result of the background object to obtain a rendered document. And sending the rendered document to the printing device so as to enable the printing device to print the rendered document. Under the condition of not changing the content of the document, the purpose of not printing the background object in the document is realized. And then saved consumptive material and time when printing the background object, reduced the consumptive material cost, improved printing efficiency.

Description

Printing method, printing device and server
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a printing method, an apparatus, and a server.
Background
When a document is prepared, a user may add a background picture to a document page to make the document more aesthetic, highlight a theme, identify, and the like. For example, a landscape image is added to each page of a PPT document (PowerPoint, slide presentation) as a background image of the PPT document, which is a travel topic. An animal picture is added to a cover sheet of a PDF (Portable document format) document popular in animal science as a background image.
In practical applications, the document is not only displayed on a display screen in the form of an electronic document, but also printed into a paper file for a user to read. However, for a document to which a background image is added, since the background image is generally an image occupying a larger area in a page of the document, not only is more ink used when printing, increasing consumable costs, but printing efficiency is also reduced, as compared to a document of the same content without the background image.
Disclosure of Invention
The embodiment of the invention aims to provide a printing method, a printing device and a printing server, so that when a document containing a background image is printed, the cost of consumable materials is reduced and the printing efficiency is improved under the condition that the content of the document is not changed. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a printing method, which is applied to a server, and the method includes:
acquiring a document to be printed;
analyzing a document to be printed to obtain a plurality of objects forming the document content of the document to be printed;
identifying a background object from a plurality of objects by using a preset background identification algorithm;
after a printing instruction is received, rendering a non-background object in the document to be printed as a printing object based on the identification result of the background object to obtain a rendered document;
and sending the rendered document to the printing device so as to enable the printing device to print the rendered document.
In a second aspect, an embodiment of the present invention provides a printing apparatus, including:
the content analysis module is used for acquiring a document to be printed; analyzing a document to be printed to obtain a plurality of objects forming the document content of the document to be printed;
the object identification module is used for identifying a background object from a plurality of objects by using a preset background identification algorithm;
the rendering module is used for rendering the non-background object in the document to be printed into the printing object based on the identification result of the background object after receiving the printing instruction, so as to obtain a rendered document;
and the sending module is used for sending the rendered document to the printing equipment so as to enable the printing equipment to print the rendered document.
In a third aspect, an embodiment of the present invention provides a server, where the server includes:
the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the bus; a memory for storing a computer program; and a processor for executing the program stored in the memory to implement the steps of the printing method provided by the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the printing method provided in the first aspect.
According to the printing method, the printing device and the server provided by the embodiment of the invention, the document to be printed is obtained and analyzed, so that a plurality of objects forming the document content of the document to be printed are obtained, and the background object is identified from the plurality of objects by utilizing a preset background identification algorithm. And after receiving the printing instruction, rendering the non-background object in the document to be printed as the printing object based on the identification result of the background object to obtain a rendered document. And sending the rendered document to the printing device so as to enable the printing device to print the rendered document. Compared with a printing mode of directly printing all objects in the document, the background object is excluded from the printing object by utilizing the rendered document, so that the aim of not printing the background object in the document is fulfilled under the condition of not changing the content of the document. And then saved consumptive material and time when printing the background object, reduced the consumptive material cost, improved printing efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a schematic flow chart of a printing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a printing method according to another embodiment of the present invention;
FIG. 3 is a diagram illustrating a page including a background object according to another embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a printing apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a printing apparatus according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
A printing method according to an embodiment of the present invention will be described first.
The printing method provided by the embodiment of the present invention may be applied to a server connected to a printing device, where the server may include a desktop computer, a portable computer, an internet television, an intelligent mobile terminal, a wearable intelligent terminal, and the like, and is not limited herein, and any server that can implement the embodiment of the present invention belongs to the protection scope of the embodiment of the present invention.
As shown in fig. 1, a flow of a printing method according to an embodiment of the present invention is applied to a server, and the method may include:
s101, acquiring a document to be printed.
The document to be printed may be a PDF document, a Word document, a PPT document, and the like. The mode of acquiring the document to be printed may specifically be receiving the document to be printed transmitted to the server by the user, or actively downloading the document to be printed from the cloud by the server.
S102, analyzing the document to be printed to obtain a plurality of objects forming the document content of the document to be printed.
The content of the document to be printed is composed of a plurality of objects, such as pictures, characters, tables, and the like. An object may be a picture, a table, a word or a plurality of words. Before a document to be printed is printed, the document may be parsed to obtain a plurality of objects that constitute the document content of the document.
And S103, identifying a background object from the plurality of objects by using a preset background identification algorithm.
The preset background recognition algorithm may be a pre-trained target recognition algorithm, or may be an algorithm for distinguishing background objects from each object based on attribute information of each object and page information of a document page. Of course, the pre-trained target recognition algorithm is obtained by pre-training with a plurality of collected sample documents marked with background objects and background object positions.
And S104, after receiving the printing instruction, rendering the non-background object in the document to be printed as the printing object based on the identification result of the background object to obtain a rendered document.
The printing object may specifically be a picture object. The document is rendered for printing by a printing device.
For example, the document content of the document to be printed is composed of a text object W, a background object B, a picture object P, and a form object E. And after receiving the printing instruction, rendering the character object W, the picture object P and the table object E as printing objects based on the recognition result object B of the background object as the background object to obtain a rendered document. The rendered document does not contain background objects, while the document to be printed itself is not altered.
And S105, sending the rendered document to the printing device so as to enable the printing device to print the rendered document.
The printing equipment is connected with the server and prints after receiving the document sent by the server. After the rendering document is sent to the printing equipment, the printing equipment prints the rendering document with the background object removed from the printing object, so that the background object is not required to be printed during printing, the cost of consumable materials is reduced, and the printing efficiency is improved.
In addition, in practical application, a document to be printed may be printed in an achromatic color, and for a document to which a background image is added, a situation that a color of a non-background image part is close to that of the background image easily occurs in the printed achromatic color paper document, so that the problems that the non-background image part, such as a text and the background image, in the paper document cannot be clearly distinguished, and the non-background image part is blurred and is not easy to read are caused. In contrast, the printing method without printing the background object can also avoid the problems of blurring and difficulty in reading of the non-background object caused by the background object during the non-color printing.
Compared with a printing mode of directly printing all objects in a document, the printing method, the printing device and the server provided by the embodiment of the invention utilize the rendered document to exclude the background object from the printed object, thereby achieving the purpose of not printing the background object in the document under the condition of not changing the content of the document. And then saved consumptive material and time when printing the background object, reduced the consumptive material cost, improved printing efficiency.
Optionally, step S103 in the embodiment of fig. 1 of the present invention may specifically include:
and acquiring attribute information of each object and page information of the document to be printed. The attribute information includes the size of the object, and the page information includes the page size of the document to be printed.
After the document to be printed is analyzed, the attribute information of each object carried by the document to be printed and the page information of the document to be printed can be obtained. The size of the object may be the area of the object, or the length and width of the object, and the page size of the document to be printed may be the area of the page, or the length and width of the page.
For example, the acquired attribute information of the character object W is 10 cm long and 5 cm wide of the whole character paragraph, the attribute information of the background object B is 20 cm long and 29 cm wide, the attribute information of the picture object P is 5 cm long and 6 cm wide, and the attribute information of the form object E is 20 cm long and 10 cm wide. The page information of the document to be printed was 21 cm in length and 29.7 cm in width.
For each object, a size difference of the object from the page size is obtained based on the size of the object and the page size.
The size difference between the object and the page size is the difference between the object size and the page size.
For example, based on the size and the page size of each of the above-described objects, the size difference of the object W from the page size is obtained as 21 cm to 10 cm to 11 cm in length, and 29.7 cm to 5 cm to 24.7 cm in width. The size difference between the object B and the page size is 21 cm-20 cm-1 cm in length and 29.7 cm-29 cm-0.7 cm in width. The size difference between the object P and the page size is 21 cm to 5 cm to 16 cm in length and 29.7 cm to 6 cm to 23.7 cm in width. The size difference between the object E and the page size is 21 cm-20 cm-1 cm in length, and 29.7 cm-10 cm-19.7 cm in width. Of course, if the object size is the object area and the page size is the page area, the size difference is the difference between the object area and the page area.
And judging whether the size difference meets a preset size difference condition or not.
Optionally, the preset size difference condition may specifically include:
the size difference belongs to a preset size difference interval.
For example, if the preset size difference condition is that the length difference belongs to a preset size difference interval [0 cm, 2 cm ], and the width difference belongs to a preset size difference interval [0 cm, 2 cm ], then the length difference of the object B of the above objects is 1 cm, and the width difference of the object B is 0.7 cm, which satisfy the preset size difference condition, and the recognition result of the object B is determined to be the background object.
Alternatively, the size difference is less than a preset size difference threshold.
And if the preset size difference condition is met, determining that the identification result of the object is the background object.
For example, if the preset size difference condition is that the size difference is smaller than the preset size difference threshold value of 2 cm, the length difference of the object B is 1 cm, and the width difference of 0.7 cm in the object satisfies the preset size difference condition, and the recognition result of the object B is determined to be the background object.
In practical applications, since one object constituting the document content may be the whole text in the page, for example, only one line of text in the page, one line of text is one object. If a page is composed of a background object and a page of text, and the whole page of text is an object, the size difference between the size of the text object and the size of the page may satisfy the preset size difference condition. Alternatively, the size difference between the size of the table object in the document and the page size may also satisfy the preset size difference condition. Therefore, if the background object is identified only on the basis of the size difference, a non-background object whose size difference satisfies a preset size difference condition may be erroneously determined as the background object, resulting in a decrease in background object identification accuracy.
For this reason, optionally, the attribute information in the above embodiment may further include a type of the object.
The types of objects may include images, tables, and text, among others.
Accordingly, before obtaining the size difference between the object and the page size based on the size of the object and the page size, the printing method of the present invention may further include:
and judging whether the object is a picture object or not based on the type of the object.
The obtaining the size difference between the object and the page size based on the size of the object and the page size may specifically include:
and if the object is a picture object, obtaining the size difference between the object and the page size based on the size of the object and the page size.
In general, the image size for illustration and description in the document to be printed rarely satisfies the preset size difference condition, and therefore, after it is determined that the object is a picture object based on the type of the object, the identification of the background object can be performed based on the size difference between the size of the object and the page size.
For example, among the objects constituting the document content of the document to be printed, the type of the object W is a character, the type of the object B is an image, the type of the object P is a picture, and the type of the object E is a table. Then for object B and object P, the size difference of the object from the page size is obtained based on the size of the object and the page size.
Optionally, the attribute information of the object may further include a position of the object in the page.
Correspondingly, step S104 in the embodiment of fig. 1 of the present invention may specifically include:
and rendering the non-background object in the document to be printed as the printing object based on the identification result of the background object.
The print object may specifically be an image, and is used to compose document content of the rendered document. For example, if the background object is recognized as the background object B, the object W, the object P, and the object E are rendered as images as print objects for composing the document contents of the rendered document.
And arranging the printing objects in the printing document based on the positions of the non-background objects in the document to be printed to obtain a rendering document.
Since the attribute information of the object may further include the position of the object in the page, when the rendered document is obtained, the printed object may be arranged in the printed document based on the position of the non-background object in the document to be printed, so that the rendered document has the same page layout and document content as the document to be printed, and is different from the document to be printed only in that the background object is not included. The printing document is a document for arranging printing objects, is a document independent from the document to be printed, does not affect the content of the document to be printed, and is only used for obtaining a rendering document.
For example, if the position of the object W in the document to be printed is the center of the page, the printing object obtained by rendering the object W is also arranged at the center of the layout page in the printed document.
Optionally, after receiving the printing instruction in the embodiment of fig. 1 of the present invention, before rendering the non-background object in the document to be printed as the image based on the recognition result of the background object and obtaining the rendered document, the printing method in the embodiment of the present invention may further include:
and if the identification result is that the background object exists in the document to be printed, outputting prompt information of whether the page background is printed or not.
The prompt information of whether to print the page background may specifically be output prompt information including a "hide page background" option, or output a prompt window of "whether to print the page background", or the like.
And after receiving an instruction of not printing the background object input by a user, rendering the non-background object in the document to be printed into an image based on the identification result of the background object to obtain a rendered document.
The instruction for not printing the background object may specifically be the instruction that the user selects the option of "hiding the page background", or the instruction for outputting the prompt window of "whether to print the page background", and the user inputs the instruction for not printing the background object through the prompt window.
And outputting the prompt information before rendering the non-background object, and rendering the non-background object after receiving an instruction of not printing the page background input by a user.
In the above-described embodiment of fig. 1, the background object is an image having a size close to the size of a page, but in practical applications, a part of the background may not be a picture occupying the entire page, but may be a special size in which only the background is arranged for a document title. Meanwhile, there may be picture objects other than background objects in the page, which may cause misrecognition if the size difference condition is directly adjusted. Therefore, the size difference condition has a problem that it is difficult to satisfy both the recognition accuracy and the background size diversity, which leads to missing recognition.
In order to combine the recognition accuracy and the diversity of the background sizes to reduce the missing recognition of the background object, as shown in fig. 2, a flow of a printing method according to another embodiment of the present invention may include:
s201, acquiring a document to be printed.
S202, analyzing the document to be printed to obtain a plurality of objects forming the document content of the document to be printed.
S201 to S202 are the same as S101 to S102 in the embodiment of fig. 1, and are not repeated herein, for details, see the description of the embodiment of fig. 1.
S203, acquiring the attribute information of each object and the page information of the document to be printed.
S204, aiming at each object, obtaining the size difference between the object and the page size based on the size of the object and the page size;
and S205, judging whether the size difference meets a preset size difference condition. If the preset size difference condition is satisfied, S206 is performed. If the preset size difference condition is not satisfied, S207 is performed.
S206, determining the identification result of the object as a background object.
S203 to S206 are the same as the steps of identifying the background object in the alternative embodiment of fig. 1, and are not repeated herein, for details, see the description of the alternative embodiment of fig. 1.
S207, judging whether the object is in the middle of the page or not based on the attribute information of the object. If it is at the middle position of the page, S208 to S209 are performed.
The attribute information of the object may further include a position of the object in the page. The page information may also include margins of the page. The size of the object may include the length and width of the object.
And when the size difference between the object and the page does not meet the preset size difference condition, judging the position of the object in the page. Normally, a background object having a particular size will be in the middle of the page, such as a background object set only for the document title. Of course, the middle position may be specifically the page center of the page, or may be other positions parallel to the page center, for example, the middle position near the top margin of the page.
As shown in fig. 3, the position of the object 302 in the page 301 may be a distance between the object 302 and a boundary of the page 301, or may be a coordinate of the object 302 in a two-dimensional coordinate axis in which the length of the page 301 is taken as a horizontal axis and the width is taken as a vertical axis.
S208, obtaining the margin difference between the size difference of the object and the margin of the page based on the size difference of the object and the margin of the page. The size difference of the object and the page size may specifically include a length difference and a width difference of the object and the page.
The size difference of the object and the margin difference of the margin of the page may specifically be a difference value between the size difference of the object and the margin of the page.
In practical applications, the margins of the pages may be the same, and therefore, the size difference of the object and the margin difference of the margins of the pages may be a difference between the length difference and the margins, and a difference between the width difference and the margins.
Of course, the margins of the pages may also be different, and as shown in fig. 3, the margins of the pages may specifically include an upper margin 303, a lower margin 304, a left margin 305, and a right margin 306.
Correspondingly, the edge distance difference specifically may include: the width difference of the object and the upper margin difference of the upper margin, the width difference of the object and the lower margin difference of the lower margin, the length difference of the object and the left margin difference of the left margin, and the length difference of the object and the right margin difference of the right margin.
For example, the difference in length of object 302 is the difference between the length of object 302 and the length of page 301, i.e., distance 309 and distance 310 between the broadside of object 302 and the broadside of page 301. The width difference of the object 302 is the difference between the width of the object 302 and the width of the page 301, that is, the distance 308 and the distance 307 between the long edge of the object 302 and the long edge of the page 301.
The object width difference 307 is equal to the upper margin difference of the upper margin 303, i.e., width difference 307-upper margin 303. The width difference 308 of the object is equal to the margin difference 308-margin 304 of the margin 304. The long disparity 310 of the object is the left disparity of the left margin 305-long disparity 310-left margin 305. The right distance difference between the long difference 309 and the right distance 306 of the object is long difference 309-right distance 306.
S209, judging whether the edge distance difference meets a preset edge distance difference condition. If the preset margin difference condition is satisfied, S210 to S212 are performed.
Corresponding to step S208, the optional preset margin difference condition specifically includes:
at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference belongs to a preset margin difference interval.
Or at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference is smaller than a preset margin difference threshold value.
Typically, the illustrated and described pictures have a large margin difference from the margin, while background objects are typically close to the margin of the page and have a small margin difference from the margin. Therefore, if at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference of the object meets the preset margin difference condition, the object is the background object.
For example, the predetermined edge distance difference condition is that at least one of the upper edge distance difference, the lower edge distance difference, the left edge distance difference and the right edge distance difference belongs to a predetermined edge distance difference interval [0 cm, 0.5 cm ]. Alternatively, the predetermined size difference condition is that the size difference is less than a predetermined size difference threshold of 0.6 cm.
The object T1 is located immediately to the left of the page, and has a difference of 0 cm in left margin, 1 cm in right margin, 5 cm in upper margin, and 5 cm in lower margin, then the object T1 is the background object.
The object T2 is located at the center of the page, the difference between the left margin and the right margin is 0.5 cm, the difference between the upper margin and the lower margin is 5 cm, and the object T2 is a background object.
The object T3 is located on the upper side of the page, the difference between the left margin and the right margin is 0 cm, the difference between the upper margin and the lower margin is 0 cm, and the difference between the lower margin and the upper margin is 10 cm, so the object T3 is a background object.
The object T4 is located at the lower side of the page, the difference of the left margin is 0.5 cm, the difference of the right margin is 0.5 cm, the difference of the upper margin is 0.5 cm, and the difference of the lower margin is 0.5 cm, and then the object T4 is a background object.
S210, determining the identification result of the object as a background object.
S211, after receiving the printing instruction, rendering the non-background object in the document to be printed as the printing object based on the identification result of the background object, and obtaining a rendered document.
S212, the rendered document is sent to the printing device, so that the printing device prints the rendered document.
S211 to S212 are the same as S104 to S105 in the embodiment of fig. 1, and are not repeated herein, for details, see the description of the embodiment of fig. 1.
Corresponding to the method embodiment, the embodiment of the invention also provides a printing device.
As shown in fig. 4, the printing apparatus according to an embodiment of the present invention may include:
a content analysis module 401, configured to obtain a document to be printed; analyzing a document to be printed to obtain a plurality of objects forming the document content of the document to be printed;
an object recognition module 402, configured to recognize a background object from a plurality of objects by using a preset background recognition algorithm;
the rendering module 403 is configured to, after receiving the printing instruction, render a non-background object in the document to be printed as a printing object based on the identification result of the background object, so as to obtain a rendered document;
a sending module 404, configured to send the rendered document to a printing device, so that the printing device prints the rendered document.
Compared with a printing mode of directly printing all objects in a document, the printing device provided by the embodiment of the invention utilizes the rendering document to exclude the background object from the printing object, thereby achieving the purpose of not printing the background object in the document under the condition of not changing the content of the document. And then saved consumptive material and time when printing the background object, reduced the consumptive material cost, improved printing efficiency.
Optionally, the object identifying module 402 in the embodiment of fig. 4 of the present invention may be specifically configured to:
acquiring attribute information of each object and page information of the document to be printed; the attribute information includes the size of the object, and the page information includes the page size of the document to be printed;
for each object, obtaining the size difference between the object and the page size based on the size of the object and the page size;
judging whether the size difference meets a preset size difference condition or not;
and if the preset size difference condition is met, determining that the identification result of the object is the background object.
Optionally, the preset size difference condition in the embodiment of fig. 4 of the present invention may specifically include:
the size difference belongs to a preset size difference interval;
alternatively, the size difference is less than a preset size difference threshold.
Optionally, the attribute information in the embodiment of fig. 4 of the present invention may further include a position of the object in the page; the page information may also include a margin of the page; the dimensions may include the length and width of the object; the size difference of the object and the page size comprises a length difference and a width difference of the object and the page;
accordingly, the object identifying module 402 in the embodiment of fig. 4 of the present invention may be further configured to:
after judging whether the size difference meets a preset size difference condition, if not, judging whether the object is in the middle position of the page based on the attribute information of the object;
if the size difference is in the middle position of the page, the edge distance difference between the size difference of the object and the edge distance of the page is obtained based on the size difference of the object and the edge distance of the page;
judging whether the edge distance difference meets a preset edge distance difference condition or not;
and if the preset edge distance difference condition is met, determining that the identification result of the object is the background object.
Optionally, the margins in the embodiment of fig. 4 of the present invention may specifically include an upper margin, a lower margin, a left margin, and a right margin;
the edge distance difference may specifically include: the width difference of the object and the upper margin difference of the upper margin, the width difference of the object and the lower margin difference of the lower margin, the length difference of the object and the left margin difference of the left margin, and the length difference of the object and the right margin difference of the right margin;
the preset edge distance difference condition may specifically include:
at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference belongs to a preset margin difference interval;
or at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference is smaller than a preset margin difference threshold value.
Optionally, the attribute information in the embodiment of fig. 4 of the present invention may further include a type of the object;
accordingly, the object identifying module 402 in the embodiment of fig. 4 of the present invention may be further configured to:
before the size difference between the object and the page size is obtained based on the size of the object and the page size, judging whether the object is a picture object based on the type of the object;
the object identification module 402 is specifically configured to:
and if the object is a picture object, obtaining the size difference between the object and the page size based on the size of the object and the page size.
Optionally, the rendering module 403 in the embodiment of fig. 4 of the present invention may be specifically configured to:
rendering non-background objects in the document to be printed as printing objects based on the recognition result of the background object;
and arranging the printing objects in the document to be printed based on the position of the non-background object in the document to be printed to obtain a rendered document.
As shown in fig. 5, the printing apparatus according to another embodiment of the present invention may include:
a content analysis module 501, configured to obtain a document to be printed; analyzing the document to be printed to obtain a plurality of objects forming the document content of the document to be printed;
an object recognition module 502, configured to recognize a background object from the plurality of objects by using a preset background recognition algorithm;
the rendering module 503 is configured to render, after receiving the printing instruction, a non-background object in the document to be printed as a printing object based on the identification result of the background object, so as to obtain a rendered document;
the content analysis module 501, the object identification module 502, and the rendering module 503 are the same as the content analysis module 401, the object identification module 402, and the rendering module 403 in the embodiment of fig. 4 of the present invention.
An information prompt module 504, configured to render, after the rendering module 503 receives the print instruction, a non-background object in the document to be printed as an image based on the identification result of the background object, and output prompt information indicating whether to print a page background if the identification result of the identification module 502 indicates that the background object exists in the document to be printed before the document is rendered; after receiving an instruction of not printing a page background input by a user, rendering a non-background object in a document to be printed into an image based on an identification result of a background object to obtain a rendered document;
a sending module 505, configured to send the rendered document to a printing device after receiving an instruction input by a user to not print a page background, so that the printing device prints the rendered document.
Corresponding to the foregoing embodiment, an embodiment of the present invention further provides a server, and as shown in fig. 6, the server may include:
the system comprises a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory complete mutual communication through the communication bus 604 through the 603;
a memory 603 for storing a computer program;
the processor 601 is configured to implement the steps of any of the printing methods in the above embodiments when executing the computer program stored in the memory 603.
Compared with a server for directly printing all objects in a document, the server provided by the embodiment of the invention utilizes the rendered document to exclude the background object from the printed object when the document is printed, thereby achieving the purpose of not printing the background object in the document under the condition of not changing the content of the document. And then saved consumptive material and time when printing the background object, reduced the consumptive material cost, improved printing efficiency.
The Memory may include a RAM (Random Access Memory) or an NVM (Non-Volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processor), an ASIC (Application specific integrated Circuit), an FPGA (Field-Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
The computer-readable storage medium provided by an embodiment of the present invention is included in a server, and a computer program is stored in the computer-readable storage medium, and when being executed by a processor, the computer program implements the steps of any one of the printing methods in the foregoing embodiments.
The computer-readable storage medium provided by an embodiment of the present invention is embodied in a server, and the computer-readable storage medium stores therein a computer program, which when executed by a processor, excludes a background object from a printed object by rendering a document when printing the document, as compared with a server that directly prints all objects in the document, thereby achieving a purpose of not printing the background object in the document without changing the content of the document. And then saved consumptive material and time when printing the background object, reduced the consumptive material cost, improved printing efficiency.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the printing method as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber, DSL (Digital Subscriber Line), or wireless (e.g., infrared, radio, microwave, etc.), the computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more integrated servers, data centers, etc., the available medium may be magnetic medium (e.g., floppy disk, hard disk, magnetic tape), optical medium (e.g., DVD (Digital versatile Disc, digital versatile disc)), or a semiconductor medium (e.g.: SSD (Solid state disk)), etc.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device and server embodiments, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (18)

1. A printing method applied to a server, the method comprising:
acquiring a document to be printed;
analyzing the document to be printed to obtain a plurality of objects forming the document content of the document to be printed;
identifying a background object from the plurality of objects by using a preset background identification algorithm;
after a printing instruction is received, rendering a non-background object in the document to be printed as a printing object based on an identification result of the background object to obtain a rendered document;
and sending the rendered document to a printing device so as to enable the printing device to print the rendered document.
2. The method of claim 1, wherein identifying background objects from the plurality of objects using a predetermined background identification algorithm comprises:
acquiring attribute information of each object and page information of the document to be printed; the attribute information comprises the size of the object, and the page information comprises the page size of the document to be printed;
for each object, obtaining a size difference of the object and the page size based on the size of the object and the page size;
judging whether the size difference meets a preset size difference condition or not;
and if the preset size difference condition is met, determining that the identification result of the object is a background object.
3. The method of claim 2, wherein the predetermined size difference condition comprises:
the size difference belongs to a preset size difference interval;
alternatively, the size difference is less than a preset size difference threshold.
4. The method of claim 2, wherein the attribute information further includes a location of the object in the page; the page information further comprises a margin of the page;
the dimensions include a length and a width of the object;
the size difference of the object and the page size comprises a length difference and a width difference of the object and the page;
after the determining whether the size difference satisfies a preset size difference condition, the method further includes:
if the preset size difference condition is not met, judging whether the object is in the middle position of the page or not based on the attribute information of the object;
if the page is in the middle position, obtaining the margin difference between the size difference of the object and the margin of the page based on the size difference of the object and the margin of the page;
judging whether the edge distance difference meets a preset edge distance difference condition or not;
and if the preset edge distance difference condition is met, determining that the identification result of the object is a background object.
5. The method of claim 4, wherein the margins include an upper margin, a lower margin, a left margin, and a right margin;
the edge distance difference comprises: a width difference of the object and an upper margin difference of the upper margin, a width difference of the object and a lower margin difference of the lower margin, a length difference of the object and a left margin difference of the left margin, and a length difference of the object and a right margin difference of the right margin;
the preset edge distance difference condition comprises the following steps:
at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference belongs to a preset margin difference interval;
or at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference is smaller than a preset margin difference threshold value.
6. The method of claim 4, wherein the attribute information further includes a type of the object;
before obtaining the size difference between the object and the page size based on the size of the object and the page size, the method further comprises:
judging whether the object is a picture object or not based on the type of the object;
the obtaining the size difference between the object and the page size based on the size of the object and the page size comprises:
and if the object is a picture object, obtaining the size difference between the object and the page size based on the size of the object and the page size.
7. The method according to claim 1, wherein rendering non-background objects in the document to be printed as an image based on the recognition result of the background object to obtain a rendered document comprises:
rendering non-background objects in the document to be printed as printing objects based on the identification result of the background objects;
and arranging the printing objects in the printing document based on the position of the non-background object in the document to be printed to obtain a rendering document.
8. The method according to claim 1, wherein after receiving the printing instruction, before rendering the non-background object in the document to be printed as an image based on the recognition result of the background object to obtain a rendered document, the method further comprises:
if the identification result is that the background object exists in the document to be printed, outputting prompt information whether to print the page background;
the rendering the non-background object in the document to be printed into an image based on the recognition result of the background object to obtain a rendered document, including:
and after receiving an instruction of not printing the background object input by a user, rendering the non-background object in the document to be printed into an image based on the identification result of the background object to obtain a rendered document.
9. A printing apparatus, included in a server, the apparatus comprising:
the content analysis module is used for acquiring a document to be printed; analyzing the document to be printed to obtain a plurality of objects forming the document content of the document to be printed;
an object recognition module for recognizing a background object from the plurality of objects using a preset background recognition algorithm;
the rendering module is used for rendering a non-background object in the document to be printed into a printing object based on the identification result of the background object after receiving the printing instruction, so as to obtain a rendered document;
and the sending module is used for sending the rendered document to printing equipment so as to enable the printing equipment to print the rendered document.
10. The apparatus of claim 9, wherein the object identification module is specifically configured to:
acquiring attribute information of each object and page information of the document to be printed; the attribute information comprises the size of the object, and the page information comprises the page size of the document to be printed;
for each object, obtaining a size difference of the object and the page size based on the size of the object and the page size;
judging whether the size difference meets a preset size difference condition or not;
and if the preset size difference condition is met, determining that the identification result of the object is a background object.
11. The apparatus of claim 10, wherein the predetermined size difference condition comprises:
the size difference belongs to a preset size difference interval;
alternatively, the size difference is less than a preset size difference threshold.
12. The apparatus of claim 10, wherein the attribute information further comprises a location of the object in the page; the page information further comprises a margin of the page; the dimensions include a length and a width of the object; the size difference of the object and the page size comprises a length difference and a width difference of the object and the page;
the object identification module is further configured to:
after judging whether the size difference meets a preset size difference condition, if not, judging whether the object is in the middle position of the page based on the attribute information of the object;
if the page is in the middle position, obtaining the margin difference between the size difference of the object and the margin of the page based on the size difference of the object and the margin of the page;
judging whether the edge distance difference meets a preset edge distance difference condition or not;
and if the preset edge distance difference condition is met, determining that the identification result of the object is a background object.
13. The apparatus of claim 12, wherein the margins include an upper margin, a lower margin, a left margin, and a right margin;
the edge distance difference comprises: a width difference of the object and an upper margin difference of the upper margin, a width difference of the object and a lower margin difference of the lower margin, a length difference of the object and a left margin difference of the left margin, and a length difference of the object and a right margin difference of the right margin;
the preset edge distance difference condition comprises the following steps:
at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference belongs to a preset margin difference interval;
or at least one of the upper margin difference, the lower margin difference, the left margin difference and the right margin difference is smaller than a preset margin difference threshold value.
14. The apparatus of claim 12, wherein the attribute information further comprises a type of the object;
the object identification module is further configured to:
before obtaining the size difference between the object and the page size based on the size of the object and the page size, judging whether the object is a picture object based on the type of the object;
the object identification module is specifically configured to:
and if the object is a picture object, obtaining the size difference between the object and the page size based on the size of the object and the page size.
15. The apparatus of claim 12, wherein the rendering module is specifically configured to:
rendering non-background objects in the document to be printed as printing objects based on the identification result of the background objects;
and arranging the printing objects in the printing document based on the position of the non-background object in the document to be printed to obtain a rendering document.
16. The apparatus of claim 9, further comprising an information prompting module configured to:
after the rendering module receives a printing instruction, rendering a non-background object in the document to be printed into an image based on an identification result of a background object, and outputting prompt information of whether a page background is printed or not before obtaining the rendered document if the identification result of the identification module indicates that the background object exists in the document to be printed; and after receiving an instruction of not printing the page background input by a user, rendering the non-background object in the document to be printed into an image based on the identification result of the background object to obtain a rendered document.
17. A server is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the bus; a memory for storing a computer program; a processor for executing a program stored in the memory to perform the method steps of any of claims 1-8.
18. A computer-readable storage medium, in which a computer program is stored which is embodied in a server and which, when being executed by a processor, carries out the method steps of any one of claims 1 to 8.
CN201811392708.0A 2018-11-21 2018-11-21 Printing method, device and server Active CN111208955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811392708.0A CN111208955B (en) 2018-11-21 2018-11-21 Printing method, device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811392708.0A CN111208955B (en) 2018-11-21 2018-11-21 Printing method, device and server

Publications (2)

Publication Number Publication Date
CN111208955A true CN111208955A (en) 2020-05-29
CN111208955B CN111208955B (en) 2024-01-30

Family

ID=70783950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811392708.0A Active CN111208955B (en) 2018-11-21 2018-11-21 Printing method, device and server

Country Status (1)

Country Link
CN (1) CN111208955B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130782A (en) * 2020-09-22 2020-12-25 上海汉图科技有限公司 Printing method and device and printing client
CN113760202A (en) * 2021-08-11 2021-12-07 广州快批信息科技有限公司 Document printing method, server, system and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11112821A (en) * 1997-10-03 1999-04-23 Nec Corp Color image processing system, image output device provided with the same and recording medium recording program for color image processing
KR20070035335A (en) * 2005-09-27 2007-03-30 주식회사 인프라웨어 Method of printing web page
US20080079962A1 (en) * 2006-09-28 2008-04-03 Konica Minolta Systems Laboratory, Inc. Background color conversion for toner-saving printing
CN101419423A (en) * 2007-10-25 2009-04-29 夏普株式会社 Imaging equipment
US20090161146A1 (en) * 2007-12-21 2009-06-25 Schlumberger Technology Corporation Preparing an electronic document of continuous information for document exchange that supports continuous and page-by-page printing
WO2009154589A2 (en) * 2008-01-31 2009-12-23 Hewlett-Packard Development Company L.P. Printing structured documents
US20100214614A1 (en) * 2009-02-23 2010-08-26 Andrew Rodney Ferlitsch Context-aware printing method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11112821A (en) * 1997-10-03 1999-04-23 Nec Corp Color image processing system, image output device provided with the same and recording medium recording program for color image processing
KR20070035335A (en) * 2005-09-27 2007-03-30 주식회사 인프라웨어 Method of printing web page
US20080079962A1 (en) * 2006-09-28 2008-04-03 Konica Minolta Systems Laboratory, Inc. Background color conversion for toner-saving printing
CN101419423A (en) * 2007-10-25 2009-04-29 夏普株式会社 Imaging equipment
US20090161146A1 (en) * 2007-12-21 2009-06-25 Schlumberger Technology Corporation Preparing an electronic document of continuous information for document exchange that supports continuous and page-by-page printing
WO2009154589A2 (en) * 2008-01-31 2009-12-23 Hewlett-Packard Development Company L.P. Printing structured documents
US20100214614A1 (en) * 2009-02-23 2010-08-26 Andrew Rodney Ferlitsch Context-aware printing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130782A (en) * 2020-09-22 2020-12-25 上海汉图科技有限公司 Printing method and device and printing client
CN113760202A (en) * 2021-08-11 2021-12-07 广州快批信息科技有限公司 Document printing method, server, system and storage medium

Also Published As

Publication number Publication date
CN111208955B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
US10432820B2 (en) Image processing apparatus, image processing system, control method for image processing apparatus, and non-transitory computer readable medium
CN109934244B (en) Format type learning system and image processing apparatus
US10140510B2 (en) Machine print, hand print, and signature discrimination
US20140325348A1 (en) Conversion of a document of captured images into a format for optimized display on a mobile device
CN113313111B (en) Text recognition method, device, equipment and medium
US9558433B2 (en) Image processing apparatus generating partially erased image data and supplementary data supplementing partially erased image data
CN105095166A (en) Method for generating stream-type electronic book and website system
CN111950557A (en) Error problem processing method, image forming apparatus and electronic device
CN111208955B (en) Printing method, device and server
US20210397798A1 (en) Information processing apparatus and non-transitory computer readable medium
JP2017212575A (en) Image reading device and program
KR101477642B1 (en) Flat board printer
US20150347376A1 (en) Server-based platform for text proofreading
CN111199136A (en) Document content display method, device and equipment
US9135517B1 (en) Image based document identification based on obtained and stored document characteristics
CN110942075A (en) Information processing apparatus, storage medium, and information processing method
JP6311347B2 (en) Information processing apparatus, information processing system, and program
CN111062377B (en) Question number detection method, system, storage medium and electronic equipment
CN114598921A (en) Video frame extraction method and device, terminal equipment and storage medium
CN110633457B (en) Content replacement method and device, electronic equipment and readable storage medium
US10867168B2 (en) Information processing apparatus and non-transitory computer readable medium storing program
US20210182477A1 (en) Information processing apparatus and non-transitory computer readable medium storing program
CN113298122A (en) Target detection method and device and electronic equipment
CN106384111B (en) Picture detection method and device
CN113051235A (en) Document loading method and device, terminal and storage medium

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