CTID intelligent door lock bar code printing method and system

文档序号:886915 发布日期:2021-03-23 浏览:5次 中文

阅读说明:本技术 一种ctid智能门锁条码打印方法及系统 (CTID intelligent door lock bar code printing method and system ) 是由 吴太亮 于 2020-10-29 设计创作,主要内容包括:本发明提供了智能门锁技术领域的一种CTID智能门锁条码打印方法及系统,方法包括如下步骤:步骤S10、创建一空白文档,设置所述空白文档的属性以及绑定的喷墨打印机;步骤S20、将需要打印的条码字符串转换为条码图片,将所述条码图片添加到所述空白文档上生成打印文档;步骤S30、基于所述打印文档生成打印请求,并将所述打印请求发送给绑定的喷墨打印机;步骤S40、喷墨打印机基于接收的所述打印请求对打印文档进行打印。本发明的优点在于:实现利用喷墨打印机动态打印CTID智能门锁的条码,进而极大的降低了条码打印成本。(The invention provides a CTID intelligent door lock bar code printing method and a system thereof, belonging to the technical field of intelligent door locks, wherein the method comprises the following steps: step S10, creating a blank document, setting the property of the blank document and the bound ink-jet printer; step S20, converting the bar code character string to be printed into a bar code picture, and adding the bar code picture to the blank document to generate a printed document; step S30, generating a printing request based on the printing document, and sending the printing request to the bound ink-jet printer; and step S40, the ink-jet printer prints the printing document based on the received printing request. The invention has the advantages that: the realization utilizes ink jet printer developments to print the bar code of CTID intelligence lock, and then very big reduction the bar code and printed the cost.)

1. A CTID intelligent door lock bar code printing method is characterized in that: the method comprises the following steps:

step S10, creating a blank document, setting the property of the blank document and the bound ink-jet printer;

step S20, converting the bar code character string to be printed into a bar code picture, and adding the bar code picture to the blank document to generate a printed document;

step S30, generating a printing request based on the printing document, and sending the printing request to the bound ink-jet printer;

and step S40, the ink-jet printer prints the printing document based on the received printing request.

2. The CTID intelligent door lock bar code printing method of claim 1, wherein the method comprises the following steps: the step S10 specifically includes:

creating a blank document on a computer, setting the blank document to comprise the attributes of margin and printing size, and binding an ink-jet printer through a driver and an api interface.

3. The CTID intelligent door lock bar code printing method of claim 2, wherein the method comprises the following steps: the print size is set based on the size, number of barcodes and the conversion ratio of inches to pixels.

4. The CTID intelligent door lock bar code printing method of claim 1, wherein the method comprises the following steps: the step S20 specifically includes:

converting the bar code character string to be printed into a bar code picture by using a picture tool, converting the self-defined character to be printed into a character picture by using a picture tool, adding the bar code picture and the character picture to the blank document, and typesetting each bar code picture and the character picture to generate a printed document.

5. The CTID intelligent door lock bar code printing method of claim 1, wherein the method comprises the following steps: the step S30 specifically includes:

and generating a printing request which can be identified by the ink-jet printer based on the printing document, the driver and the api interface, and sending the printing request to the bound ink-jet printer.

6. The utility model provides a CTID intelligence lock bar code print system which characterized in that: the system comprises the following modules:

the blank document creating module is used for creating a blank document, setting the attribute of the blank document and the bound ink-jet printer;

the bar code conversion adding module is used for converting the bar code character string to be printed into a bar code picture and adding the bar code picture to the blank document to generate a printed document;

the printing request sending module is used for generating a printing request based on the printing document and sending the printing request to the bound ink-jet printer;

and the barcode printing module is used for printing the printing document by the ink-jet printer based on the received printing request.

7. The CTID intelligent door lock barcode printing system of claim 6, wherein: the blank document creating module is specifically as follows:

creating a blank document on a computer, setting the blank document to comprise the attributes of margin and printing size, and binding an ink-jet printer through a driver and an api interface.

8. The CTID intelligent door lock barcode printing system of claim 7, wherein: the print size is set based on the size, number of barcodes and the conversion ratio of inches to pixels.

9. The CTID intelligent door lock barcode printing system of claim 6, wherein: the bar code conversion adding module specifically comprises:

converting the bar code character string to be printed into a bar code picture by using a picture tool, converting the self-defined character to be printed into a character picture by using a picture tool, adding the bar code picture and the character picture to the blank document, and typesetting each bar code picture and the character picture to generate a printed document.

10. The CTID intelligent door lock barcode printing system of claim 6, wherein: the printing request sending module is specifically as follows:

and generating a printing request which can be identified by the ink-jet printer based on the printing document, the driver and the api interface, and sending the printing request to the bound ink-jet printer.

Technical Field

The invention relates to the technical field of intelligent door locks, in particular to a CTID intelligent door lock bar code printing method and system.

Background

After the CTID intelligent door locks are produced, a bar code needs to be attached to each CTID intelligent door lock for unique identification, and then factory test is carried out. However, the drivers and the api interfaces of different barcode printers are different, the barcode printers also have preset printing templates, and the factory test software needs to develop corresponding printing functions according to the drivers and the api interfaces of the current barcode printers and reset the corresponding printing templates.

The CTID intelligent door lock is produced by different manufacturers, the models of the bar code printers of each manufacturer are different, even if the same manufacturer updates the bar code printers, the models of the bar code printers of different models exist at the same time, so that the printing function needs to be developed and debugged on site for the bar code printers of different models independently, the research and development cost is increased undoubtedly, time and labor are wasted, and the development difficulty is further increased when the driving interface cannot find the official api interface due to various reasons; and because of the inherent characteristics of small bar code word size and the like, the bar code cannot be directly printed by using a common ink-jet printer.

Therefore, how to provide a method and a system for printing a barcode of a CTID intelligent door lock to dynamically print the barcode of the CTID intelligent door lock by using an inkjet printer and reduce the barcode printing cost becomes a problem to be solved urgently.

Disclosure of Invention

The invention aims to solve the technical problem of providing a CTID intelligent door lock bar code printing method and system, which can realize dynamic printing of the bar code of the CTID intelligent door lock by using an ink-jet printer and reduce the bar code printing cost.

In a first aspect, the invention provides a CTID intelligent door lock barcode printing method, which comprises the following steps:

step S10, creating a blank document, setting the property of the blank document and the bound ink-jet printer;

step S20, converting the bar code character string to be printed into a bar code picture, and adding the bar code picture to the blank document to generate a printed document;

step S30, generating a printing request based on the printing document, and sending the printing request to the bound ink-jet printer;

and step S40, the ink-jet printer prints the printing document based on the received printing request.

Further, the step S10 is specifically:

creating a blank document on a computer, setting the blank document to comprise the attributes of margin and printing size, and binding an ink-jet printer through a driver and an api interface.

Further, the print size is set based on the size, the number, and the conversion ratio of inches and pixels of the barcode.

Further, the step S20 is specifically:

converting the bar code character string to be printed into a bar code picture by using a picture tool, converting the self-defined character to be printed into a character picture by using a picture tool, adding the bar code picture and the character picture to the blank document, and typesetting each bar code picture and the character picture to generate a printed document.

Further, the step S30 is specifically:

and generating a printing request which can be identified by the ink-jet printer based on the printing document, the driver and the api interface, and sending the printing request to the bound ink-jet printer.

In a second aspect, the invention provides a CTID intelligent door lock barcode printing system, which comprises the following modules:

the blank document creating module is used for creating a blank document, setting the attribute of the blank document and the bound ink-jet printer;

the bar code conversion adding module is used for converting the bar code character string to be printed into a bar code picture and adding the bar code picture to the blank document to generate a printed document;

the printing request sending module is used for generating a printing request based on the printing document and sending the printing request to the bound ink-jet printer;

and the barcode printing module is used for printing the printing document by the ink-jet printer based on the received printing request.

Further, the blank document creation module specifically includes:

creating a blank document on a computer, setting the blank document to comprise the attributes of margin and printing size, and binding an ink-jet printer through a driver and an api interface.

Further, the print size is set based on the size, the number, and the conversion ratio of inches and pixels of the barcode.

Further, the barcode conversion adding module specifically comprises:

converting the bar code character string to be printed into a bar code picture by using a picture tool, converting the self-defined character to be printed into a character picture by using a picture tool, adding the bar code picture and the character picture to the blank document, and typesetting each bar code picture and the character picture to generate a printed document.

Further, the print request sending module specifically includes:

and generating a printing request which can be identified by the ink-jet printer based on the printing document, the driver and the api interface, and sending the printing request to the bound ink-jet printer.

The invention has the advantages that:

the method comprises the steps of creating a blank document on a computer, setting attributes and binding an ink-jet printer, converting a bar code character string to be printed into a bar code picture, adding the bar code picture into the blank document to generate a printed document, generating a printing request capable of being identified by the ink-jet printer based on the printed document, sending the printing request to the bound ink-jet printer to print, namely finishing the printing of the ink-jet printer on a bar code, not needing to develop a printing function independently for bar code printers of different models in the prior art, not needing to set a printing format according to a printing template preset by the bar code printer, finally realizing the dynamic printing of the bar code of the CTID intelligent door lock by the ink-jet printer, and greatly reducing the bar code printing cost.

Drawings

The invention will be further described with reference to the following examples with reference to the accompanying drawings.

FIG. 1 is a flow chart of a CTID intelligent door lock bar code printing method of the invention.

FIG. 2 is a schematic structural diagram of a CTID intelligent door lock barcode printing system.

Detailed Description

The technical scheme in the embodiment of the application has the following general idea: the bar code character strings to be printed are converted into blank documents which are created by inserting pictures to generate printing documents, and then the printing documents are sent to the bound ink-jet printer to be printed by utilizing a document printing mode provided by an operating system, so that the bar code character strings are printed by utilizing the ink-jet printer.

Referring to fig. 1 to 2, a preferred embodiment of a method for printing a barcode on a CTID intelligent door lock according to the present invention includes the following steps:

step S10, creating a blank document, setting the property of the blank document and the bound ink-jet printer;

step S20, converting the bar code character string to be printed into a bar code picture, adding the bar code picture to the blank document to generate a printed document, namely printing the bar code character string in the format of the picture, so as to overcome the defects that the bar code character string is small in font, needs special drive and api interface to print and the like;

step S30, generating a printing request which can be identified by the ink-jet printer based on the printing document, the driver and the api interface, and sending the printing request to the bound ink-jet printer;

and step S40, the ink-jet printer prints the printing document based on the received printing request.

In specific implementation, before the printing request is generated, the printing file can be encoded and compressed to improve the transmission rate, and the inkjet printer conducts decompression printing after the printing request is verified.

The step S10 specifically includes:

creating a blank document on a computer, setting the blank document to comprise the attributes of margin and printing size, and binding an ink-jet printer through a driver and an api interface.

The print size is set based on the size, number of barcodes and the conversion ratio of inches to pixels.

The step S20 specifically includes:

converting a bar code character string to be printed into a bar code picture by using a picture tool (such as a screenshot tool), converting a custom character to be printed into a character picture by using the picture tool, adding the bar code picture and the character picture to the blank document, and typesetting the bar code picture and the character picture to generate a printed document.

The invention discloses a preferred embodiment of a CTID intelligent door lock bar code printing system, which comprises the following modules:

the blank document creating module is used for creating a blank document, setting the attribute of the blank document and the bound ink-jet printer;

the bar code conversion adding module is used for converting the bar code character string to be printed into a bar code picture, adding the bar code picture to the blank document to generate a printed document, namely printing the bar code character string in a picture format, so as to overcome the defects that the bar code character string is small in font, needs a special driver and an api interface to print and the like;

the printing request sending module is used for generating a printing request which can be identified by the ink-jet printer based on the printing document, the driver and the api interface and sending the printing request to the bound ink-jet printer;

and the barcode printing module is used for printing the printing document by the ink-jet printer based on the received printing request.

In specific implementation, before the printing request is generated, the printing file can be encoded and compressed to improve the transmission rate, and the inkjet printer conducts decompression printing after the printing request is verified.

The blank document creating module is specifically as follows:

creating a blank document on a computer, setting the blank document to comprise the attributes of margin and printing size, and binding an ink-jet printer through a driver and an api interface.

The print size is set based on the size, number of barcodes and the conversion ratio of inches to pixels.

The bar code conversion adding module specifically comprises:

converting a bar code character string to be printed into a bar code picture by using a picture tool (such as a screenshot tool), converting a custom character to be printed into a character picture by using the picture tool, adding the bar code picture and the character picture to the blank document, and typesetting the bar code picture and the character picture to generate a printed document.

In summary, the invention has the advantages that:

the method comprises the steps of creating a blank document on a computer, setting attributes and binding an ink-jet printer, converting a bar code character string to be printed into a bar code picture, adding the bar code picture into the blank document to generate a printed document, generating a printing request capable of being identified by the ink-jet printer based on the printed document, sending the printing request to the bound ink-jet printer to print, namely finishing the printing of the ink-jet printer on a bar code, not needing to develop a printing function independently for bar code printers of different models in the prior art, not needing to set a printing format according to a printing template preset by the bar code printer, finally realizing the dynamic printing of the bar code of the CTID intelligent door lock by the ink-jet printer, and greatly reducing the bar code printing cost.

Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种印刷机的喷墨机构

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类