Printer control method, device, electronic device and storage medium
By calculating the number of paper holes and paper cutting lines height of the chain paper and adjusting the printer's printing line spacing and line count, the printer's accurate stay at the cutting line position is achieved, solving the problem of waste and inconvenience in printing on chain paper, and improving paper utilization.
Patent Information
- Application Number
- CN202210451655.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-04-26
AI Technical Summary
Existing printers cannot accurately stay at the nearest cut line when printing chain paper, resulting in paper waste and inconvenience to tear paper.
By determining the number of paper holes and paper cutting numbers of chain paper, calculate the height of the paper cutting line, print line spacing and number of lines, adjust the printing height, so that the printer uses the inner page as the paper-moving unit, and ensures that it stays at the cutting line position after printing is completed.
Reduce paper waste, improve the convenience of tearing paper, and avoid the waste of running one page of chain paper when printing content is less than one page.
Smart Images

Figure CN114924698B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of printing technology, and in particular to a printer control method, device, electronic device, and storage medium. Background Art
[0002] With the development of information technology, information management system software has been widely used in all walks of life and is widely used to print various documents and reports. However, there are often some problems when printing documents and reports. Since the printing paper used for printing documents and reports is usually chain paper, the current printer cannot stay at the nearest paper cutting line after completing printing on the chain paper. Instead, no matter how much content is printed, the paper is fed in units of one page of chain paper during printing (one page of chain paper refers to one page of chain paper with a full number of holes within multiple paper cutting lines). This easily causes paper waste and is inconvenient for users to tear paper. Summary of the Invention
[0003] The present disclosure aims to provide a printer control method, device, electronic device and storage medium to solve the problems of paper waste and inconvenience in paper tearing in existing chain paper printing.
[0004] In order to achieve the above objectives, the present disclosure provides a first aspect of a printer control method, comprising:
[0005] determining the number of paper holes in a page of chain paper and the number of paper cut sheets of the page of chain paper according to information of the loaded chain paper;
[0006] Determining a cutting line height of an inner page according to the number of holes and the number of cut sheets, wherein the inner page is any page of the chain paper divided according to the cutting line, and the cutting line height is the distance between two cutting lines of the inner page;
[0007] Determining the printing line spacing and the number of printing lines of the inner page according to the height of the paper cutting line;
[0008] Determining the printing height of the inner page according to the printing line spacing and the number of printing lines;
[0009] Printing is performed on the chain paper according to the printing line spacing and the printing height.
[0010] Optionally, the information of the chain paper includes the paper type of the chain paper, and determining the number of paper holes in a page of chain paper and the number of paper cuts of the single page of chain paper according to the information of the loaded chain paper includes:
[0011] The number of holes and the number of paper cuts are determined according to the paper type.
[0012] Optionally, determining the height of the cutting line of the inner page according to the number of holes and the number of cutting sheets includes:
[0013] The paper cutting line height is obtained by multiplying the quotient obtained by dividing the number of holes by the number of paper cutting sheets by the hole spacing of the paper holes of the chain paper. The hole spacing is the distance from the upper edge of the first paper hole to the upper edge of the second paper hole of any two adjacent paper holes.
[0014] Optionally, determining the printing line spacing and the number of printing lines of the chain paper according to the paper cutting line height includes:
[0015] When the height of the paper cutting line is less than the maximum height of a page of chain paper, obtaining a first value from a preset line spacing array, wherein the line spacing array includes a plurality of values, each of which is used to represent a size of a line spacing;
[0016] Determine the number of rows corresponding to the first value according to the paper cutting line height and the first value;
[0017] When the number of lines corresponding to the first value is an integer, the number of lines corresponding to the first value is determined as the number of printing lines, and the line spacing corresponding to the first value is determined as the printing line spacing;
[0018] When the number of rows corresponding to the first value is not an integer, the next value in the row spacing array is used as the new first value, and the step of determining the number of rows corresponding to the first value based on the paper cutting line height and the first value is performed again until the number of rows corresponding to the first value is an integer.
[0019] Optionally, when the first value is less than or equal to a specified value, determining the number of rows corresponding to the first value according to the paper cutting line height and the first value includes:
[0020] The product of the paper cutting line height and the first value is used as the number of rows corresponding to the first value.
[0021] Optionally, when the number of lines corresponding to the first value is an integer, determining the number of lines corresponding to the first value as the number of printing lines, and determining the line spacing corresponding to the first value as the printing line spacing, includes:
[0022] If the number of lines corresponding to the first value is an integer and is less than or equal to the maximum number of lines of a page of chain paper, the number of lines corresponding to the first value is determined as the number of print lines, the maximum number of lines is the maximum number of lines under the line spacing corresponding to the first value, and the line spacing corresponding to the first value is a value obtained by multiplying the reciprocal of the first value by a specified line spacing unit;
[0023] The line distance corresponding to the first value is used as the printing line distance.
[0024] Optionally, when the first value is greater than the specified value, determining the number of rows corresponding to the first value according to the paper cutting line height and the first value includes:
[0025] Extracting a second value from a preset value range corresponding to the first value;
[0026] The quotient obtained by dividing the product of the paper cutting line height and the first value by the second value is used as the number of rows to be selected;
[0027] When the number of rows to be selected is not an integer, the next value is extracted from the preset numerical range as a new second value, and the step of dividing the product of the paper cutting line height and the first value by the second value and obtaining the quotient as the number of rows to be selected is performed again, until the number of rows to be selected is an integer or the second value is the last value in the preset numerical range, and the number of rows to be selected is used as the number of rows corresponding to the first value.
[0028] Optionally, determining the line spacing corresponding to the first value as the printing line spacing includes:
[0029] When the number of lines to be selected is an integer, a value obtained by multiplying the current ratio of the second value to the first value by a specified line spacing unit is used as the printing line spacing.
[0030] Optionally, determining the print height of the inner page according to the print line spacing and the number of print lines includes:
[0031] The value obtained by multiplying the number of printing lines of the inner page by the printing line spacing is used as the printing height of the inner page.
[0032] Optionally, printing the chain paper according to the printing line spacing and the printing height of the inner pages includes:
[0033] Determine the target number of lines to be printed according to the print content;
[0034] Determine the total printing height according to the target number of lines and the printing line spacing;
[0035] The integer obtained by rounding up the quotient of the total printing height divided by the printing height of the inner page is used as the number of inner pages fed;
[0036] The chain paper is printed according to the printing line spacing, the printing height of the inner pages, and the number of inner pages of the paper feed.
[0037] A second aspect of the present disclosure provides a printer control device, comprising:
[0038] a paper identification module, configured to determine the number of paper holes in a page of chain paper and the number of paper cuts of the page of chain paper according to information of the loaded chain paper;
[0039] a first determining module, configured to determine a cutting line height of an inner page according to the number of holes and the number of paper cut sheets, wherein the inner page is any page of the chain paper divided according to the cutting lines, and the cutting line height is the distance between two cutting lines of the inner page;
[0040] A second determining module is used to determine the printing line spacing and the number of printing lines of the inner page according to the paper cutting line height and the number of paper cutting sheets;
[0041] A third determining module is used to determine the printing height of the inner page according to the printing line spacing and the number of printing lines;
[0042] A printing module is used to print the chain paper according to the printing line spacing and the printing height.
[0043] According to a third aspect of the present disclosure, an electronic device is provided, including:
[0044] a memory having a computer program stored thereon;
[0045] A processor is used to execute the computer program in the memory to implement the steps of any one of the methods in the first aspect.
[0046] According to a fourth aspect of the present disclosure, a non-temporary computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0047] In the above technical solution, the number of paper holes in a page of chain paper and the number of paper cuts for the page of chain paper are determined based on the information of the loaded chain paper; the height of the paper cut line of the inner page is determined based on the number of holes and the number of paper cuts, the inner page being any page after the chain paper is divided according to the paper cut line, and the paper cut line height being the distance between the two paper cut lines of the inner page; the printing line spacing and the number of printing lines of the chain paper are determined based on the paper cut line height; the printing height of the inner page is determined based on the printing line spacing and the number of printing lines; and the chain paper is printed according to the printing line spacing and the printing height. Through the above technical solution, the appropriate printing line spacing and number of lines can be determined based on the number of holes and the paper cut line of the chain paper, and the printing height of each inner page can be determined accordingly, so that the printer uses the inner page as the paper feed unit when printing, so that after printing is completed, it can stay at the nearest paper cut line position, which is convenient for the operator to tear the paper manually, and avoids the problem of feeding the paper as a page of chain paper even if the printed content is less than one page, thereby reducing paper waste caused by excessive paper feeding of the printer.
[0048] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following detailed description, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0050] Figure 1 is a flowchart showing a printer control method according to an exemplary embodiment of the present disclosure.
[0051] Figure 2 The figure is a schematic structural diagram of a chain paper according to an exemplary embodiment.
[0052] Figure 3 FIG. 4 is a flowchart showing another printer control method according to an exemplary embodiment of the present disclosure.
[0053] Figure 4 FIG. 4 is a flowchart showing another printer control method according to an exemplary embodiment of the present disclosure.
[0054] Figure 5 The figure is a block diagram of a printer control device according to an exemplary embodiment.
[0055] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0056] The following describes the specific embodiments of the present disclosure in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure and are not intended to limit the present disclosure.
[0057] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the corresponding data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0058] Figure 1 is a flow chart showing a printer control method according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the printer control method may include the following steps.
[0059] In step S101, the number of holes in one page of chain paper and the number of cut sheets in one page of chain paper are determined based on information of the loaded chain paper.
[0060] The printer may be a dot matrix printer, and the chain paper is chain printing paper, also known as folding printing paper, carbon printing paper, and equal-division printing paper. The chain paper information may include the paper type of the chain paper. The printer may pre-store paper parameters corresponding to different paper types. The paper parameters may include, for example: the paper height of a page of chain paper (the paper height here refers to the maximum height of a page of chain paper. For example, the chain paper used for printing documents is generally B5, that is, a chain paper with a total length of 22n inches. A page of chain paper refers to a page of chain paper with a whole number of holes within multiple cutting lines. For a chain paper with a total length of 22n inches, the paper height of a page of chain paper is 22 inches, and n represents the total number of pages of the entire chain paper), the number of paper cuts (or the number of paper cuts), the number of paper holes (the number of holes in each embodiment of the present application refers to the number of whole cut holes), etc.
[0061] For example, chain paper is often used for documents or reports. The paper parameters of the chain paper used for printing documents and reports are different. For example, the chain paper used for printing documents is usually B5 length, with a total length of 22n inches. The number of holes for cutting a page of this chain paper is usually 27, and the number of cut sheets is 3. The chain paper used for printing reports is usually B3 length, with a total length of 22n inches. The number of holes for cutting a page of this chain paper is usually 27, and the number of cut sheets is 1 (which can be understood as the chain paper is not cut). Therefore, in this solution, it is necessary to first obtain information about the chain paper loaded in the printer to identify the paper type of the chain paper, thereby determining the number of holes and the number of cut sheets in a page of the chain paper. The chain paper information can be manually set by the user on the printer after loading the chain paper, or it can be sent to the printer via the printer's control device (such as the user's computer or mobile terminal).
[0062] In step S102, the cutting line height of the inner page is determined according to the number of holes and the number of paper cuts. The inner page is any page of the chain paper divided according to the cutting line. The cutting line height is the distance between two cutting lines of the inner page.
[0063] It is understood that there are multiple paper holes on the chain paper, which are evenly arranged on both sides of the chain paper according to a certain hole spacing. For example, Figure 2 is a schematic structural diagram of a chain paper according to an exemplary embodiment. Figure 2As shown, this chain paper is used for printing documents. A page of chain paper has 27 paper holes, which are divided into three inner pages by a paper cut line. Each inner page has nine paper holes. The hole spacing between the nine paper holes in each inner page is generally 0.5 inches. This hole spacing is the distance from the top edge of the first paper hole to the top edge of the second paper hole in any two adjacent paper holes. In each inner page, the top edge of the first paper hole coincides with the paper cut line at the top of the inner page, and the bottom edge of the last paper hole coincides with the paper cut line at the bottom of the inner page (coincidence can also be understood as tangent).
[0064] The number of holes on a page of chain paper (the number of holes on both sides is the same, and the number of holes on either side can be the same) is divided by the number of sheets of paper to be cut (for example, there are 3 sheets of paper for a document and 1 sheet of paper for a report, determined according to actual conditions) to get the number of holes on each inner page. Then, the number of holes on each inner page is multiplied by the hole spacing of the chain paper to get the height of the paper cut line for each inner page. Therefore, the height of the paper cut line can be calculated as follows:
[0065] The quotient obtained by dividing the number of holes by the number of paper cuts is multiplied by the hole spacing of the chain paper to obtain the paper cutting line height. It can be expressed as:
[0066] hegihtpage=numhole / numpage*d
[0067] Among them, hegihtpage represents the height of the inner page, that is, the height of the paper cutting line, numhole represents the number of holes in a page of chain paper, numpage represents the number of paper cutting sheets, and d represents the hole spacing. Figure 2 Taking the chain paper shown as an example, the cutting line height of the inner page = 27 ÷ 3 × 0.5 inches = 4.5 inches.
[0068] For another example, if it is chain paper (not shown) used for printing reports, the number of paper cuts is 1 and the number of holes is 27, then the paper cut line height = 27 ÷ 1 × 0.5 inches = 13.5 inches.
[0069] In addition, it is worth mentioning that the number of paper holes and the number of paper cutting pages are only exemplary and may be other numbers, which can be determined according to the actual situation of the chain paper.
[0070] In step S103 , the printing line spacing and the number of printing lines of the inner pages are determined according to the paper cutting line height.
[0071] It can be understood that the printing line spacing and number of printing lines of the inner page can be determined according to the height of the paper cutting line. When the height of the paper cutting line is equal to an integer multiple of the printing line spacing, it can be ensured that the content to be printed can be printed completely on the inner page without exceeding or missing any printing content.
[0072] In step S104 , the printing height of the inner page is determined according to the printing line spacing and the number of printing lines.
[0073] It is understandable that the number of printed lines is the total number of printed lines in each inner page. Therefore, in one embodiment, the print height of the inner page can be calculated as follows:
[0074] The value obtained by multiplying the number of print lines of the inner page by the print line spacing is the print height of the inner page.
[0075] In step S105 , the chain paper is printed according to the printing line spacing and printing height.
[0076] It can be understood that by controlling the line spacing and print height of the inner pages, the chain paper can be fed using the inner pages as the paper feed unit when printing. Therefore, regardless of the amount of printed content, the paper will stop at the nearest paper cut line after printing, making it easier to tear the paper. Moreover, compared to the prior art, when printing, the paper is fed as a single page of chain paper regardless of whether the printed content can fill a page, which can reduce paper waste to a certain extent.
[0077] Optionally, Figure 3 is a flow chart showing another printer control method according to an exemplary embodiment of the present disclosure, such as Figure 3 As shown, step S103 may include the following steps:
[0078] In step S1031, when the height of the paper cutting line is less than the maximum height of a page of chain paper, a first value is obtained from a preset line spacing array, where the line spacing array includes multiple values used to represent the size of the line spacing.
[0079] Among them, taking the maximum height of a page of chain paper as an example, in this embodiment, the maximum height of a page of chain paper can be 22 inches. If the height of the paper cutting line is less than the maximum height of a page of chain paper, the subsequent steps can be continued. If the height of the paper cutting line is greater than the maximum height of a page of chain paper, the current printing task can be stopped and a warning message of paper abnormality can be output.
[0080] Since the printing line spacing of a dot matrix printer is usually 1 / 6 inch, 1 / 8 inch, n / 60 (n ranges from 1 to 85) inch, n / 180 (n ranges from 1 to 255) inch, and n / 360 (n ranges from 1 to 255) inch, multiple values can be set to represent the size of the line spacing, namely 6, 8, 60, 180, 360, and {6, 8, 60, 180, 360} is used as the above-mentioned line spacing array, and values are selected from the line spacing array in sequence as the first value to perform steps S1032-S1034 to determine the final value of the first value and the value of the above-mentioned n, thereby determining the final printing line spacing and number of printing lines.
[0081] In step S1032 , the number of rows corresponding to the first value is determined according to the paper cutting line height and the first value.
[0082] In step S1033 , when the number of lines corresponding to the first value is an integer, the number of lines corresponding to the first value is determined as the number of printing lines, and the line spacing corresponding to the first value is determined as the printing line spacing.
[0083] In step S1034, when the number of rows corresponding to the first value is not an integer, the next value in the row spacing array is used as the new first value, and the step of determining the number of rows corresponding to the first value based on the paper cutting line height and the first value is performed again until the number of rows corresponding to the first value is an integer.
[0084] For example, since, in the above-mentioned printing line spacing, when the printing line spacing is 1 / 6 inch and 1 / 8 inch (i.e., when the first value is 6 and 8), it is not necessary to determine the value of n, but when the printing line spacing is n / 60 inch, n / 180 inch, and n / 360 inch (i.e., when the first value is 60, 180, and 360), it is necessary to determine the value of n, different calculation methods can be used for the above-mentioned two cases. For example, taking 8 as the specified value below as an example, the following steps can be included:
[0085] When the first value is less than or equal to the specified value, step S1032 may be: multiplying the paper cutting line height by the first value as the number of rows corresponding to the first value.
[0086] It can be understood that the number of rows of the inner page = the height of the paper cutting line ÷ the line spacing, where the line spacing corresponding to the first value is the value obtained by multiplying the reciprocal of the first value by the specified line spacing unit. Therefore, the value obtained by dividing the paper line height by the reciprocal of the first value and multiplying the specified line spacing unit is equivalent to multiplying the paper cutting line height by the first value. Therefore, the product of the paper cutting line height and the first value is taken as the number of rows corresponding to the first value. The number of rows corresponding to the first value can be understood as the number of rows of the inner page under the line spacing corresponding to the first value.
[0087] That is, when the first value is 6 or 8, the number of rows corresponding to the first value is calculated using the following formula:
[0088] linepage=hegihtpage*minbase[i] (1)
[0089] Among them, linepage represents the number of lines corresponding to the first value, hegihtpage represents the height of the paper cutting line, minbase[i] represents the first value, and i represents that the current first value is taken from the i-th value in the above line spacing array {6, 8, 60, 180, 360}.
[0090] Accordingly, step S1033 may include:
[0091] When the number of lines corresponding to the first value is an integer and is less than or equal to the maximum number of lines for a page of chain paper, the number of lines corresponding to the first value is determined as the number of lines to be printed. The maximum number of lines for a page of chain paper is the maximum number of lines under the line spacing corresponding to the first value. The line spacing corresponding to the first value is a value obtained by multiplying the reciprocal of the first value by a specified line spacing unit. The specified line spacing unit can be inches. For example, when the first value is 6, i.e., the corresponding line spacing is 1 / 6 inch, the maximum number of lines is 127.
[0092] The line distance corresponding to the first value is used as the printing line distance.
[0093] If the number of rows corresponding to the first value is not an integer, or the number of rows corresponding to the first value is greater than the maximum number of rows for the chain paper, then exit, select the next value from the above-mentioned row spacing array {6, 8, 60, 180, 360} as the new first value, and execute the above steps again.
[0094] Among them, when the first value is 6 or 8, that is, the line spacing is 1 / 6 inch or 1 / 8 inch, the maximum number of lines can be 127. For example, when minbase[i]=6, if the number of lines linepage corresponding to minbase[i]=6 is an integer and less than or equal to 127, then linepage is used as the final number of printed lines, and 1 / 6 inch is used as the printing line spacing; if the number of lines linepage corresponding to minbase[i]=6 is not an integer or greater than 127, then 8 is taken from {6, 8, 60, 180, 360} and the above formula (1) is used again to calculate linepage. If the number of lines linepage corresponding to minbase[i]=8 is an integer and less than or equal to 127, then linepage corresponding to minbase[i]=8 is used as the final number of printed lines, and 1 / 8 inch is used as the printing line spacing. Otherwise, the calculation is performed according to the following situation where the first value is greater than the specified value.
[0095] When the first value is greater than the specified value, step S1032 may include:
[0096] (1) extracting a second value from a preset value range corresponding to the first value;
[0097] Among them, taking the above-mentioned line spacing array {6, 8, 60, 180, 360} as an example, the case where the first value is greater than the specified value is that the line spacing array is 60, 180 or 360. In this case, the corresponding line spacings are k / 60 (k ranges from 1 to 85) inches, n / 180 (n ranges from 1 to 255) inches, and k / 360 (n ranges from 1 to 255) inches. Therefore, according to the value of the first value, the corresponding preset value range can be determined. For example, when the first value is 60, the corresponding preset value range is 1 to 85, when the first value is 180, the corresponding preset value range is 1 to 255, and when the first value is 360, the corresponding preset value range is 1 to 255. After obtaining the preset value range corresponding to the first value, traverse from the first number in the preset value range and perform the steps shown in the following steps (2)-(3) in sequence.
[0098] (2) The quotient obtained by dividing the product of the paper cutting line height and the first value by the second value is used as the number of rows to be selected.
[0099] It can be understood that since the first value is taken from the line spacing array {60, 180, 360}, the corresponding line spacings are k / 60 inches, k / 180, and k / 360, respectively. Therefore, the line spacing is represented by k / minbase[i]. The corresponding number of rows can be obtained by dividing the height of the paper cutting line of the inner page by k / minbase[i]. Therefore, the following formula (2) can be obtained.
[0100] That is, when the first value is 60, 180 or 360, the number of rows corresponding to the first value is calculated by the following formula:
[0101] linepage=hegihtpage*minbase[i] / k (2)
[0102] Among them, linepage represents the number of lines corresponding to the first value, hegihtpage represents the height of the paper cutting line, minbase[i] represents the first value, i represents the current first value is taken from the i-th value in the above line spacing array {6, 8, 60, 180, 360}, and k represents the second value currently taken from the preset value range.
[0103] (3) When the number of rows to be selected is not an integer, the next value is extracted from the preset numerical range as the new second value, and step (2) is executed again until the number of rows to be selected is an integer or the second value is the last value in the preset numerical range, and the number of rows to be selected is used as the number of rows corresponding to the first value.
[0104] Accordingly, step S1033 may include:
[0105] When the number of lines to be selected is an integer, a value obtained by multiplying the current ratio of the second value to the first value by a specified line spacing unit is used as the printing line spacing.
[0106] For example, when minbase[i]=60, starting from k=1, traverse one by one in the range of 1 to 85 to calculate the corresponding linepage, until there is a value x in 1 to 85 such that the linepage calculated using the above formula (2) is an integer. At this time, when minbase[i]=60 and k=x, the linepage calculated can be determined as the first value, that is, the number of lines corresponding to minbase[i]=60, which can be used as the final number of printing lines, and x / 60 inches is the printing line spacing; if the linepage calculated by traversing one by one in the range of 1 to 85 until k=85 is traversed is also not an integer, it means that the first value, that is, the number of lines corresponding to minbase[i]=60, is not an integer, and it is necessary to take another value 180 from {6, 8, 60, 180, 360} and repeat the above steps (2)-(3) based on the value range 1 to 255 corresponding to minbase[i]=60, and so on, until the calculated linepage is an integer.
[0107] By using the above method, it can be ensured that the height of the paper cutting line is equal to an integer multiple of the printing line spacing.
[0108] Optionally, Figure 3 is a flowchart of another printer control method according to an exemplary embodiment of the present disclosure, such as Figure 3 As shown, step S105 may include the following steps:
[0109] In step S1051 , the target number of lines to be printed is determined according to the printing content.
[0110] In step S1052, the total printing height is determined according to the target number of lines and the printing line spacing.
[0111] For example, the product obtained by multiplying the target number of lines by the printing line spacing is the total printing height.
[0112] In step S1053, the quotient of the total printed height divided by the printed height of the inner pages is rounded up to an integer, which is used as the number of inner pages fed.
[0113] It is understandable that rounding up is to ensure that the printed content can be completely printed without missing any content.
[0114] In step S1054, the chain paper is printed according to the printing line spacing, the printing height of the inner pages, and the number of inner pages of the paper feed.
[0115] It is understandable that the number of inner pages fed can be determined based on the printing height of the inner pages. For example, when printing, the number of inner pages can be increased by 1 for each inner page printed, thereby monitoring the current number of paper feeds. When the above number of inner pages fed is reached, the current inner page is the last inner page to be printed. When the last inner page is printed, printing is stopped to ensure that it stops at the nearest paper cutting line. Through the above method, the inner page can be used as the paper feeding unit. If the printed content is small and not enough to use a page of chain paper, the paper will be fed to the nearest paper cutting line after printing is completed. Compared with the existing printing method, even if only one line of content is printed, a page of chain paper will still be fed, which reduces paper waste to a certain extent.
[0116] Through the above technical solution, the appropriate printing line spacing and number of lines can be determined according to the number of holes and the paper cutting line of the chain paper, and the printing height of each inner page can be determined accordingly, so that the printer uses the inner page as the paper feeding unit when printing, so that after printing is completed, it can stay at the nearest paper cutting line position, which is convenient for the operator to tear the paper manually and avoids paper waste caused by excessive paper feeding of the printer.
[0117] Figure 5 FIG. 1 is a block diagram of a printer control device according to an exemplary embodiment. Figure 5 As shown, the printer control device 500 may include:
[0118] The paper identification module 501 is used to determine the number of holes in a page of chain paper and the number of cut sheets of a page of chain paper according to information of the loaded chain paper;
[0119] A first determining module 502 is configured to determine a cutting line height of an inner page according to the number of holes and the number of paper cuts, wherein the inner page is any page of a chain paper divided according to the cutting lines, and the cutting line height is the distance between two cutting lines of the inner page;
[0120] The second determining module 503 is used to determine the printing line spacing and the number of printing lines of the inner page according to the paper cutting line height;
[0121] A third determining module 504 is configured to determine the print height of the inner page according to the print line spacing and the number of print lines;
[0122] The printing module 505 is used to print the chain paper according to the printing line spacing and printing height.
[0123] Optionally, the information of the chain paper includes the paper type of the chain paper, and the paper identification module 501 is used to determine the number of holes and the number of cut sheets according to the paper type.
[0124] Optionally, the first determination module 502 is used to: multiply the quotient obtained by dividing the number of holes by the number of paper cutting sheets by the hole spacing of the chain paper to obtain the paper cutting line height, where the hole spacing is the distance from the upper edge of the first paper hole to the upper edge of the second paper hole of any two adjacent paper holes.
[0125] Optionally, the second determining module 503 includes:
[0126] a value obtaining submodule, configured to obtain a first value from a preset line spacing array when the height of the paper cutting line is less than the maximum height of a page of chain paper, the line spacing array including a plurality of values used to represent the size of the line spacing;
[0127] a calculation submodule, configured to determine the number of rows corresponding to the first value according to the paper cutting line height and the first value;
[0128] a determination submodule, configured to, when the number of lines corresponding to the first value is an integer, determine the number of lines corresponding to the first value as the number of printing lines, and determine the line spacing corresponding to the first value as the printing line spacing;
[0129] The determination submodule is further configured to, when the number of rows corresponding to the first value is not an integer, use the next value in the row spacing array as a new first value, and again execute the step of determining the number of rows corresponding to the first value based on the paper cutting line height and the first value until the number of rows corresponding to the first value is an integer.
[0130] Optionally, when the first value is less than or equal to a specified value, the calculation submodule is configured to:
[0131] A quotient obtained by multiplying the paper cutting line height and the first value is used as the row number corresponding to the first value.
[0132] Optionally, the determination submodule is used to:
[0133] When the number of lines corresponding to the first value is an integer and is less than or equal to the maximum number of lines for a page of chain paper, the number of lines corresponding to the first value is determined as the number of lines to be printed; the maximum number of lines is the maximum number of lines under the line spacing corresponding to the first value, and the line spacing corresponding to the first value is the value obtained by multiplying the reciprocal of the first value by the specified line spacing unit.
[0134] The line distance corresponding to the first value is used as the printing line distance.
[0135] Optionally, the calculation submodule is further configured to:
[0136] Extracting a second value from a preset value range corresponding to the first value;
[0137] The quotient obtained by dividing the product of the paper cutting line height and the first value by the second value is used as the number of rows to be selected;
[0138] When the number of rows to be selected is not an integer, the next value is extracted from the preset numerical range as a new second value, and the step of taking the quotient obtained by dividing the product of the paper cutting line height and the first value by the second value as the number of rows to be selected is performed again, until the number of rows to be selected is an integer or the second value is the last value in the preset numerical range, and the number of rows to be selected is taken as the number of rows corresponding to the first value.
[0139] Optionally, the determination submodule is further configured to:
[0140] When the number of lines to be selected is an integer, a value obtained by multiplying the current ratio of the second value to the first value by a specified line spacing unit is used as the printing line spacing.
[0141] Optionally, the third determining module 504 is configured to:
[0142] The value obtained by multiplying the number of print lines of the inner page by the print line distance is used as the print height of the inner page.
[0143] Optionally, the printing module 505 is configured to:
[0144] Determine the target number of lines to be printed according to the print content;
[0145] Determine the total printing height according to the target number of lines and the printing line spacing;
[0146] The integer obtained by rounding up the quotient of the total printing height divided by the printing height of the inner page is used as the number of inner pages fed;
[0147] The chain paper is printed according to the printing line spacing, the printing height of the inner page and the number of inner pages of the paper feed.
[0148] Through the above technical solution, the appropriate printing line spacing and number of lines can be determined according to the number of holes and the paper cutting line of the chain paper, and the printing height of each inner page can be determined accordingly, so that the printer uses the inner page as the paper feeding unit when printing, so that after printing is completed, it can stay at the nearest paper cutting line position, which is convenient for the operator to tear the paper manually. It also avoids the problem of feeding the paper as a page of chain paper even if the printed content is less than one page, and reduces paper waste caused by excessive paper feeding of the printer.
[0149] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon. When the program instructions are executed by a processor, the steps of an information extraction method provided by the present disclosure are implemented.
[0150] Figure 6FIG. 6 is a block diagram of an electronic device 600 according to an exemplary embodiment. Figure 6 As shown, the electronic device 600 may include: a processor 601 , a memory 602 , and may further include one or more of a multimedia component 603 , an input / output (I / O) interface 604 , and a communication component 605 .
[0151] The processor 601 is used to control the overall operation of the electronic device 600 to complete all or part of the steps in the above-mentioned printer control method. The memory 602 is used to store various types of data to support the operation of the electronic device 600. Such data may include, for example, instructions for any application or method operating on the electronic device 600, as well as application-related data, such as contact information, sent and received messages, images, audio, video, etc. The memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 603 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 602 or sent via the communication component 605. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 604 provides an interface between the processor 601 and other interface modules. The above-mentioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more thereof, is not limited here. Therefore, the corresponding communication component 605 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0152] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned printer control method.
[0153] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided. When executed by a processor, the program instructions implement the steps of the above-described printer control method. For example, the computer-readable storage medium may be the aforementioned memory 602 including the program instructions. The program instructions may be executed by the processor 601 of the electronic device 600 to implement the above-described printer control method.
[0154] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned printer control method when executed by the programmable device.
[0155] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the scope of protection of the present disclosure.
[0156] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction.
[0157] In addition, the various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A printer control method, characterized in that: The method comprises: determining the number of paper holes in a page of chain paper and the number of paper cut sheets of the page of chain paper according to information of the loaded chain paper; Determining the height of the paper cutting line of the inner page according to the number of holes and the number of cutting sheets; determining the height of the paper cutting line of the inner page according to the number of holes and the number of cutting sheets includes: multiplying the quotient obtained by dividing the number of holes by the number of cutting sheets by the hole spacing of the paper holes of the chain paper to obtain the paper cutting line height, wherein the hole spacing is the distance from the upper edge of the first paper hole to the upper edge of the second paper hole of any two adjacent paper holes, the inner page is any page of the chain paper divided according to the paper cutting line, and the paper cutting line height is the distance between the two paper cutting lines of the inner page; Determining the printing line spacing and the number of printing lines of the inner page according to the paper cutting line height, the determining the printing line spacing and the number of printing lines of the inner page according to the paper cutting line height comprising: when the paper cutting line height is less than the maximum height of a page of chain paper, obtaining a first value from a preset line spacing array, the line spacing array comprising a plurality of values, the values being used to represent the size of the line spacing; determining the number of lines corresponding to the first value according to the paper cutting line height and the first value; when the number of lines corresponding to the first value is an integer, determining the number of lines corresponding to the first value as the number of printing lines, and determining the line spacing corresponding to the first value as the printing line spacing; when the number of lines corresponding to the first value is not an integer, using the next value in the line spacing array as a new first value, and performing the step of determining the number of lines corresponding to the first value according to the paper cutting line height and the first value again until the number of lines corresponding to the first value is an integer; Determining the printing height of the inner page according to the printing line spacing and the number of printing lines; Printing is performed on the chain paper according to the printing line spacing and the printing height.
2. The printer control method according to claim 1, wherein: The information of the chain paper includes the paper type of the chain paper, and the method of determining the number of paper holes in a page of chain paper and the number of paper cuts of a single page of chain paper according to the information of the loaded chain paper includes: The number of holes and the number of paper cuts are determined according to the paper type.
3. The method according to claim 1, characterized in that When the first value is less than or equal to a specified value, determining the number of rows corresponding to the first value according to the paper cutting line height and the first value includes: The product of the paper cutting line height and the first value is used as the number of rows corresponding to the first value.
4. The method according to claim 3, characterized in that In a case where the number of lines corresponding to the first value is an integer, determining the number of lines corresponding to the first value as the number of printing lines, and determining the line spacing corresponding to the first value as the printing line spacing, includes: If the number of lines corresponding to the first value is an integer and is less than or equal to the maximum number of lines of a page of chain paper, the number of lines corresponding to the first value is determined as the number of print lines, the maximum number of lines is the maximum number of lines under the line spacing corresponding to the first value, and the line spacing corresponding to the first value is a value obtained by multiplying the reciprocal of the first value by a specified line spacing unit; The line distance corresponding to the first value is used as the printing line distance.
5. The method according to claim 1, wherein When the first value is greater than a specified value, determining the number of rows corresponding to the first value according to the paper cutting line height and the first value includes: Extracting a second value from a preset value range corresponding to the first value; The quotient obtained by dividing the product of the paper cutting line height and the first value by the second value is used as the number of rows to be selected; When the number of rows to be selected is not an integer, the next value is extracted from the preset numerical range as a new second value, and the step of dividing the product of the paper cutting line height and the first value by the second value and obtaining the quotient as the number of rows to be selected is performed again, until the number of rows to be selected is an integer or the second value is the last value in the preset numerical range, and the number of rows to be selected is used as the number of rows corresponding to the first value.
6. The method according to claim 5, characterized in that The step of determining the line spacing corresponding to the first value as the printing line spacing includes: When the number of lines to be selected is an integer, a value obtained by multiplying the current ratio of the second value to the first value by a specified line spacing unit is used as the printing line spacing.
7. The method according to claim 1, characterized in that Determining the printing height of the inner page according to the printing line spacing and the number of printing lines includes: The value obtained by multiplying the number of printing lines of the inner page by the printing line spacing is used as the printing height of the inner page.
8. The method according to claim 1, characterized in that Printing the chain paper according to the printing line spacing and the printing height of the inner page includes: Determine the target number of lines to be printed according to the print content; Determine the total printing height according to the target number of lines and the printing line spacing; The integer obtained by rounding up the quotient of the total printing height divided by the printing height of the inner page is used as the number of inner pages fed; The chain paper is printed according to the printing line spacing, the printing height of the inner pages, and the number of inner pages of the paper feed.
9. A printer control device, characterized in that: The device comprises: a paper identification module, configured to determine the number of paper holes in a page of chain paper and the number of paper cuts of the page of chain paper according to information of the loaded chain paper; A first determining module is used to determine the height of the paper cutting line of the inner page according to the number of holes and the number of paper cutting sheets; Determining the paper cutting line height of the inner page based on the number of holes and the number of cut sheets includes: multiplying the quotient obtained by dividing the number of holes by the number of cut sheets by the hole spacing of the paper holes of the chain paper to obtain the paper cutting line height, wherein the hole spacing is the distance from the upper edge of the first paper hole to the upper edge of the second paper hole of any two adjacent paper holes, the inner page is any page of the chain paper divided according to the paper cutting line, and the paper cutting line height is the distance between the two paper cutting lines of the inner page; A second determining module is configured to determine the printing line spacing and the number of printing lines of the inner page according to the paper cutting line height, wherein the determining the printing line spacing and the number of printing lines of the inner page according to the paper cutting line height includes: obtaining a first value from a preset line spacing array when the paper cutting line height is less than the maximum height of a page of chain paper, the line spacing array including a plurality of values, each of which is used to represent the size of the line spacing; determining the number of lines corresponding to the first value according to the paper cutting line height and the first value; determining the number of lines corresponding to the first value as the number of printing lines and the line spacing corresponding to the first value as the printing line spacing when the number of lines corresponding to the first value is an integer; and using the next value in the line spacing array as a new first value when the number of lines corresponding to the first value is not an integer, and performing the step of determining the number of lines corresponding to the first value according to the paper cutting line height and the first value again until the number of lines corresponding to the first value is an integer; A third determining module is used to determine the printing height of the inner page according to the printing line spacing and the number of printing lines; A printing module is used to print the chain paper according to the printing line spacing and the printing height.
10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Printing control method and system
CN101807140A
Printing control method, printer, printing system and self-service terminal
CN102442089A