Linux system multi-paper type conversion and printing method based on Web printing control

By configuring the business system on the Linux system and dynamically converting paper information into a type that can be recognized by the printer, the problem of custom paper type printing on the Linux system is solved, and a simplified printing process and improved printing efficiency are achieved.

CN119759301APending Publication Date: 2025-04-04PANOVASIC TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411902673.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

On Linux systems, the existing technology cannot implement printing of custom paper types, and the paper list in the printer settings is inconsistent with the actual supported paper types, making it difficult for developers to detect the internal relationship and must use hard-coded methods to fix the paper types.

Method used

By configuring the business system and recording the label template and paper information, dynamically convert the paper information configured by the label template to the type recognized by the printer. Use the SET_PRINT_PAGESIZE function of the Web printing control to set the paper size to generate a printed document.

Benefits of technology

It realizes custom paper type printing on Linux systems, avoids the cumbersomeness of users to manually adjust printer settings, reduces the need for software developers to hardcode specified paper types, simplifies the printing process, and improves printing efficiency and software flexibility and maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759301A_ABST
    Figure CN119759301A_ABST
Patent Text Reader

Abstract

The invention discloses a Linux system multi-paper type conversion and printing method based on a Web printing control, which is characterized in that the complexity of manually adjusting the setting of a printer by a user is avoided by dynamically converting the paper types, and meanwhile, the requirement of software developers for hard coding and appointing the paper types is reduced; a user is allowed to pay attention to correctness of paper setting in a business system and only need to focus on business process and template selection, so that the printing process is greatly simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a Linux system multi-paper type conversion and printing method based on a Web printing control. Background Art

[0002] At present, with the rapid development of Web technology, many printing functions can be realized through Web printing controls on browsers. You only need to install a small (several M) printing control on a Windows or Linux computer (or server) to easily realize various printing. However, on Linux systems, these controls cannot realize custom paper (roll) printing. You can only use the fixed paper types preset by the printer, such as 100*70mm, 60*40mm, 50*30mm, etc., instead of random paper types, such as 62*41mm, etc.; this results in the designed label templates can only be these fixed size paper types. When using a printer to print on a Linux operating system, there is also a problem. The paper type displayed in the paper list in the printer settings is inconsistent with the actual supported paper type, similar to the relationship between KEY and VALUE. For example, the paper type displayed on the interface is '60*40mm', but the actual corresponding is 'w170h113'. This makes it difficult for developers to perceive the internal relationship and can only use hard coding to fix the paper type. Therefore, a method is needed to flexibly set the printing paper type according to the label template paper configuration information. When the customer or user needs to print, he or she only needs to install the paper and simply calibrate the paper without any other additional operations. Summary of the invention

[0003] The purpose of the present invention is to provide a Linux system multi-paper type conversion and printing method based on Web printing control in order to solve the above problems. The present invention realizes the support of custom paper types on the Linux system, so that customers only need to focus on business and template selection on the business system without worrying about whether the paper is set correctly. The conversion method is simple and easy.

[0004] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0005] A Linux system multi-paper type conversion and printing method based on Web printing control includes the following steps:

[0006] Step 1, configuring a business system, and recording a label template associated with a printing business of the business system, and label paper information in the label template;

[0007] Step 2: according to the paper information (width and height, usually in mm) configured in the label template, convert the paper information into a paper type that can be recognized by the printer according to the configuration relationship;

[0008] Step 3, according to the function SET_PRINT_PAGESIZE (intOrient: printing direction, pageWidth: paper width, pageHeight: paper height, strPageName: paper type name) that sets the paper size of the Web print control, set the fourth parameter to the paper type finally converted by S1;

[0009] Step 4: Generate a print document based on the paper type and label template.

[0010] A further solution is that in step 1, the label template is provided with a plurality of regular sizes, and the regular sizes refer to the regular sizes supported by the label paper manufacturers (such as 30*10mm, 60*40mm, 80*60mm, etc.), and the printer on the Linux system also supports the regular sizes by default.

[0011] A further solution is that in step 2, the configuration relationship refers to the unit conversion relationship: 1 in (inch) = 2.54 cm (centimeter) = 25.4 mm (millimeter) = 72 pt (pound).

[0012] A further solution is that in step 2, the paper size (usually in mm) configured by the label template is converted into pt according to the above-mentioned unit conversion relationship, and the conversion ratio is 1 mm = 2.8346 pt.

[0013] A further solution is that in step 2, a conversion mapping relationship table is made according to the conversion relationship, so that it can be called at any time when used. The final converted paper type is a simple regular string data, such as "w170h113", where w represents width, h represents height, 170 represents the converted paper width (rounded off), and 113 represents the converted paper height (rounded off). "w170h113" corresponds to "60*40mm".

[0014] A further solution is that in step 3, the fourth parameter strPageName of the function SET_PRINT_PAGESIZE for setting the paper size of Web printing is set to the paper type supported by the printer. In order to automatically switch the paper type when switching the label template, it is necessary to call SET_PRINT_PAGESIZE() after switching the label template and pass the paper type finally converted in step 2 as the fourth parameter (such as the above-mentioned "w170h113"), so as to achieve the purpose of dynamically switching the paper type.

[0015] The beneficial effects of the present invention are:

[0016] The present invention discloses a Linux system multi-paper type conversion and printing method based on a Web printing control. By dynamically converting paper types, the tediousness of manually adjusting printer settings by users is avoided, and the need for software developers to hard-code specified paper types is reduced. Users are allowed to focus on business processes and template selection without having to worry about the correctness of paper settings in the business system, thereby greatly simplifying the printing process. This method not only improves printing efficiency, but also enhances the flexibility and maintainability of the software, providing users with a smoother and more convenient printing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flow chart of the present invention.

[0019] Figure 2 The embodiment of the present invention creates a conversion mapping relationship table according to the conversion relationship. DETAILED DESCRIPTION

[0020] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0021] In any embodiment, if Figure 1 As shown, a Linux system multiple paper type conversion and printing method based on a Web print control of the present invention comprises:

[0022] Configure the business system, and record the label template associated with the printing business of the business system, and the label paper information in the label template;

[0023] (Size conversion): According to the paper information configured in the label template, the paper information includes the width information of the label paper (usually in mm) and the height information of the label paper (usually in mm), and the width and height of the label paper are converted into the paper type that the printer can recognize according to a certain configuration relationship;

[0024] (Set paper type): Use the function SET_PRINT_PAGESIZE(intOrient: print direction, pageWidth: paper width, pageHeight: paper height, strPageName: paper type name) of the Web print control to set the paper size, and set the fourth parameter to the paper type finally converted by S1;

[0025] Generates printed documents based on paper type and label template.

[0026] In the customer business system, when printing, the label template information (including paper information, data source, template component information, etc.) will be pulled from the server according to the associated label template ID. Different label templates can be printed after the above steps, without the need for customers to manually switch and select paper types.

[0027] Taking label template A (60*30mm) as an example, it is bound to the customer business system a module for printing. Taking label template B (60mm*50mm) as an example, it is bound to the customer business system b module for printing. The label templates associated with module a and module b have different sizes. According to conventional practice, after the customer changes the paper and calibrates the paper on the printer, he must manually select the corresponding paper type on the printer and apply it. In this patent application, the customer no longer needs to manually select the paper type (customers often do not know where to manually select the paper type), and the printing of different business modules is seamlessly switched.

[0028] The conversion in (Size Conversion) is based on the relationship of 1in (inch) = 2.54cm (centimeter) = 25.4mm (millimeter) = 72pt (pound), which derives 1mm = 2.8346pt; this conversion relationship is generally difficult to detect.

[0029] Specifically, taking label template A (60mm*30mm) as an example, both 60mm and 30mm will be converted according to the above conversion formula, and it is concluded that 60mm can be converted to 170pt (60*2.8346), and 30mm can be converted to 85pt (30*2.8346), because the paper type supported by printing on Linux is a string such as "w170h113", which is a simple regular string data, where w represents width, h represents height, 170 represents the converted paper width (rounded off), and 113 represents the converted paper height (rounded off);

[0030] It should be mentioned here that the paper type in the form of 'w170h113' string is obtained through the GET_PAGESIZES_LIST() function, which can get the list of all paper type names supported by the printer. The return result is a long list of strings, such as: 'w85h28,w85h43,w85h57,w85h71,w85h85,w85h99,w85h113,w85h128,w85h142,w85h156,w85h170,w85h184,w85h198,w85h213,w85h227,w85h 5h241,w85h255,w85h269,w85h283,……w312h28,w312h43,w312h57,w312h71,w312h85,w312h99,w312h113,w312h128,w312h142,w312h156,w312h170,w312h184,w312h198,w312h213,w312h227,w312h241,w312h255,w312h269,w312h283', and the size conversion relationship is based on this thinking;

[0031] The paper type obtained after the size conversion step is the paper type supported by the printer itself, and then proceed to the next step. After calling SET_PRINT_PAGESIZE(), the paper type has been determined, and finally the PRINT() function is called to achieve printing.

[0032] The label template size conversion mapping relationship table of the embodiment of the present invention is as follows: Figure 2 As shown: Figure 2 The paper types obtained after the above S1 step from 60mm*10mm to 60mm*100 (from w170h28 to w170h283) are shown in the figure. This is just an example. The common paper sizes with a width of 30mm range from 30mm*10mm to 30mm*100mm, with a height interval of 5mm. The paper sizes with a width of 40mm range from 40mm*10mm to 40mm*100mm, with a height interval of 5mm. And so on, until the paper size width is 110mm (which is also the maximum paper output width supported by most label printers).

[0033] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further explain various possible combinations. In addition, the various different embodiments of the present invention can also be combined arbitrarily, as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.

Claims

1. A Linux system multi-paper type conversion and printing method based on Web printing control, characterized in that: The following steps are involved: Step 1, configuring a business system, and recording a label template associated with a printing business of the business system, and label paper information in the label template; Step 2, according to the paper information configured in the label template, convert the paper information into a paper type that can be recognized by the printer according to the configuration relationship; Step 3, according to the function SET_PRINT_PAGESIZE (intOrient: printing direction, pageWidth: paper width, pageHeight: paper height, strPageName: paper type name) that sets the paper size of the Web print control, set the fourth parameter to the paper type finally converted by S1; Step 4: Generate a print document based on the paper type and label template.

2. A Linux system multiple paper type conversion and printing method based on Web printing control as claimed in claim 1, characterized in that: In step 1, the label template is provided with a plurality of conventional sizes, and the conventional sizes are sizes supported by printers and label paper manufacturers on the Linux system.

3. A Linux system multiple paper type conversion and printing method based on Web printing control as claimed in claim 1, characterized in that: In step 2, the configuration relationship refers to the unit conversion relationship: 1 in = 2.54 cm = 25.4 mm = 72 pt.

4. A Linux system multiple paper type conversion and printing method based on Web print control as claimed in claim 3, characterized in that: In the step 2, the paper size configured by the label template is converted from mm to pt according to the unit conversion relationship, and the conversion ratio is 1 mm = 2.8346 pt.

5. A Linux system multiple paper type conversion and printing method based on Web printing control as claimed in claim 3, characterized in that: In the step 2, a conversion mapping relationship table is prepared according to the conversion relationship, so as to facilitate calling at any time when in use, and the paper type finally converted is a simple regular character string data.

6. A Linux system multiple paper type conversion and printing method based on Web printing control as claimed in claim 1, characterized in that: In step 3, the fourth parameter strPageName of the function SET_PRINT_PAGESIZE for setting the paper size of Web printing is set to the paper type supported by the printer. After switching the label template, SET_PRINT_PAGESIZE() is called to pass the paper type finally converted in step 2 as the fourth parameter to achieve the purpose of dynamically switching the paper type.