Invention content
This application provides a kind of port Method of printings, while holding print speed fast advantage, moreover it is possible to allow finalUser conveniently sets up oneself required layout, improves user satisfaction.
A kind of port Method of printing provided by the embodiments of the present application, including:
Printer page is divided at least one region, at least one label is arranged for each region, each label is fixedIt is shown in a region;
Print attribution is predefined in graphical interfaces, needs the label substance printed and the tag attributes for setting;
The tag attributes set are preserved according to customized format into configuration file;
Printer receives the content to be printed by print.er port, the configuration file is loaded, in being printedAppearance is substituted into the corresponding position of label, and according to each region in configuration file successively printer page.
Preferably, the label includes constant label and signature;Constant label corresponds to fixed printing content;VariableValue when label is according to each printing, the corresponding position of signature is substituted by the content to be printed, and is printed correspondingContent.
Preferably, the tag attributes include:Whether label visible, label font, the position of label in the zone.
Preferably, by check box come abstract factory whether as it can be seen that by dragging every label substance in preview pageTo adjust the position of label in the zone.
Preferably, the print attribution is big including printing paper size, printing paper back gauge, Header font size, text typeIt is small, title height, content height and note height.
The embodiment of the present application also provides a kind of port printing equipments, including:
At least one label is arranged for each region for printer page to be divided at least one region in division module,Each label, which is fixed in a region, to be shown;
Predefined module, for print attribution is predefined in graphical interfaces, need the label substance printed and forThe tag attributes of setting;
Configuration file generation module, for being preserved the tag attributes set at configuration text according to customized formatPart;
Printing drive module is matched for driving printer to receive the content to be printed by print.er port described in loadFile is set, the content to be printed is substituted into the corresponding position of signature, and according in configuration file successively printer pageEach region.
Preferably, the label includes constant label and signature;Constant label corresponds to fixed printing content;VariableValue when label is according to each printing, the corresponding position of signature is substituted by the content to be printed, and is printed correspondingContent.
Preferably, the tag attributes include:Whether label visible, label font, the position of label in the zone.
Preferably, by check box come abstract factory whether as it can be seen that by dragging every label substance in preview pageTo adjust the position of label in the zone.
Preferably, the print attribution is big including printing paper size, printing paper back gauge, Header font size, text typeIt is small, title height, content height and note height.
It as can be seen from the above technical solutions, can be easily by the way that the attribute of each label is arranged in graphical interfacesDetermine the every content and layout to be printed.The application is based on port communication mode, and flying print may be implemented, andAnd make end user without grasping special knowledge, oneself required layout can be also conveniently set up, user is improvedSatisfaction.
Specific implementation mode
To keep the technical principle, feature and technique effect of technical scheme clearer, below in conjunction with specific realityExample is applied technical scheme is described in detail.
The embodiment of the present application provides a kind of flow of port Method of printing, as shown in Figure 1, including the following steps:
Step 101:Printer page is divided at least one region, at least one label is arranged for each region, eachLabel is fixed in a region and shows.
Wherein, label and region are many-to-one relationships, and a label can only be shown in a region, but an areaThere can be multiple labels in domain.
Label can be divided into constant label and signature according to the difference of content.The wherein corresponding printing of constant labelContent is fixed, and signature prints corresponding content then according to value when printing every time.
Step 102:Print attribution is predefined in graphical interfaces, needs the label substance printed and the mark for settingSign attribute.
According to the embodiment of the present application, in label setting up procedure, show that the predefined content is in graphical interfacesIt is possible that the content occurred in bill, end user can hide wherein unwanted content fall, only according to oneself demandPrint the part needed.
According to another embodiment of the application, the tag attributes include but not limited to:Whether label visible, label wordThe position of body, label in the zone.Controlled by check box as it can be seen that by dragged in preview page every label substance comeThe position of label in the zone is adjusted, overstriking can only be arranged in font, and the font of support is determined by printer, cannot be increased or be deletedExcept label.Wherein, what constant label was shown in graphical interfaces is exactly the label substance itself, and signature is in graphical interfacesIn be shown the label code, actually print when, the code position replace be actually subjected to printing content.
Step 103:The tag attributes set are preserved according to customized format into configuration file.
Fig. 2 is the schematic diagram provided by the embodiments of the present application that configuration file is arranged by visualization interface.Most right one in Fig. 2Row give the configuration information for including in configuration file.Wherein preceding 7 row gives print attribution, including printing paper size, printingTrimming away from, Header font size, text type size, title height, content height and explain height.Wherein each label substanceFront indicates whether this print attribution comes into force respectively to hook " √ " or cross "×".8-26 behavior constant label substances,Whether this label substance is visible to be indicated respectively to hook " √ " or cross "×" before each label substance.It is past from the 27th rowIt is signature afterwards, this label substance whether may be used is indicated respectively to hook " √ " or cross "×" before each label substanceSee.The centre position of Fig. 2 shows the preview page of wanted printer page.The page-size and margin of the preview page are away from asThe printing paper size and printing paper back gauge, and the every content wherein shown is also consistent with every print attribution.
It shown below an example of configuration file:
>Wine list>BillAuto//wine list prints forms title
&CSetPaper_S
It prints paper size # and prints paper size #01# (284,378) #0#0#0#0#0#0
&CSetPaper_P
Printing paper back gauge # printing paper back gauges #01# (0,0) #0#0#0#0#0#0
&CSetF_T
Header font size # Header font sizes #01#11#0#0#0#0#0#0
&CSetF_S
Text type size # text type sizes #01#11#0#0#0#0#0#0
&CSetPnl_H
Title height #1#pnl_title#144#0#0#0#0#0#0
Content height #2#pnl_detail#19#0#0#0#0#0#0
Explain height #3#pnl_summary#188#0#0#0#0#0#0
&CSetF_N_P
Box title # box titles:#Bill_RoomAuto#(5,40)#-1#pnl_title#2#1#0#0
Bill # bills number:#Bill_CheckOutAuto#(130,40)#-1#pnl_title#2#3#0#0
Single time under lower list time #:#Bill_OrderDateTimeAuto#(5,60)#-1#pnl_title#3#1#0#0
The person of the placing an order # persons of placing an order:#Bill_OperatorNameAuto#(5,80)#-1#pnl_title#4#1#0#0
Drinks odd numbers # drinks odd numbers:#Bill_WineListAuto#(5,100)#-1#pnl_title#5#1#0#0
Management style # management styles:#Bill_ManageStyleNameAuto#(130,100)#-1#pnl_title#5#3#0#0
// single classification # point list classifications:#Bill_WineTypeAuto#(5,120)#-1#pnl_title#7#1#0#0
Trade name # trade names #Bill_MaterNameAuto# (5,125) #-1#pnl_title#7#1#15#0
Unit # units #Bill_materialUnitAuto# (80,125) #-1#pnl_title#7#2#6#0
Quantity # quantity #Bill_OrderNumberAuto# (115,125) #-1#pnl_title#7#3#5#0
Monovalent # unit prices #Bill_CheckOutPriceAuto# (150,125) #-1#pnl_title#7#4#6#0
The amount of money # amount of money #Bill_MoneytotalAuto# (185,125) #-1#pnl_title#7#5#7#0
// additional information # additional informations #Bill_MaterRemarkAuto# (220,125) #-1#pnl_title#9#6#7#0
Amount in Total # Amounts in Total:#Bill_TotalAuto#(5,10)#-1#pnl_summary#10#1#0#0
Product machine # product machines:#Bill_machineAuto#(130,10)#-1#pnl_summary#10#3#0#0
It beats list time # and beats single time:#Bill_TimeAuto#(5,30)#-1#pnl_summary#11#1#0#0
Producer # producer:#Bill_OperatorAuto#(130,30)#-1#pnl_summary#11#3#0#0
Remarks # remarks:#Bill_RemarkVAuto#(8,55)#-1#pnl_summary#12#1#0#0
// leader signature # leader's signatures:#Bill_SignNameAuto#(5,50)#-1#pnl_summary#16#1#0#0
&CSetF_P
Title # measuring unit wine list #Bill_TitleAuto# (31,13) #1#pnl_title#1#1#40#0
Box name-value # box name-values #Bill_RoomVAuto# (75,40) #-1#pnl_title#2#2#10#0
Bill number value # bill number values #Bill_CheckOutVAuto# (190,40) #-1#pnl_title#2#4#10#0
List time value #Bill_OrderDateTimeVAuto# (75,60) #-1#pnl_title#3# under lower list time value #2#10#0
The person's of placing an order value the # person's of placing an order values #Bill_OperatorNameVAuto# (75,80) #-1#pnl_title#4#2#10#0
Drinks odd numbers value # drinks odd numbers value #Bill_WineListVAuto# (75,100) #-1#pnl_title#5#2#15#0
Management style value # management style values #Bill_ManageStyleNameVAuto# (190,100) #-1#pnl_title#5#4#15#0
// list class label # point list class label #Bill_WineTypeVAuto# (75,140) #-1#pnl_title#7#2#15#0
Trade name value # trade name values #Bill_MaterNameVAuto# (5,5) #-1#pnl_detail#8#1#15#1
Unit value # packets #Bill_materialUnitVAuto# (75,5) #-1#pnl_detail#8#2#6#1
Quantitative value # quantitative values #Bill_OrderNumberVAuto# (115,5) #-1#pnl_detail#8#3#5#1
Unit price value # unit price values #Bill_CheckOutPriceVAuto# (150,5) #-1#pnl_detail#8#4#6#1
The amount of money value # amount of money values #Bill_MoneytotalVAuto# (185,5) #-1#pnl_detail#8#5#7#1
// the amount of money value # amount of money values #Bill_ManageStyleNameVAuto# (185,5) #-1#pnl_detail#8#5#7#1
// additional information value # additional information values #Bill_MaterRemarkVAuto# (220,5) #-1#pnl_detail#10#6#7#1
Amount in Total value # Amount in Total values #Bill_TotalVAuto# (75,10) #-1#pnl_summary#10#2#10#0
Product machine value # product machine values #Bill_machineVAuto# (200,10) #-1#pnl_summary#10#4#10#0
It beats list time value # and beats list time value #Bill_TimeVAuto# (75,30) #-1#pnl_summary#11#2#13#0
Producer value # producer's value #Bill_OperatorVAuto# (200,30) #-1#pnl_summary#11#4#7#0
Remarks value # remarks values #Bill_RemarkVAuto# (54,55) #-1#pnl_summary#12#2#13#0
[complement] # [complement] #Bill_PrintVAuto# (6,110) #-1#pnl_summary#13#1#0#0
Join number # and joins number #Bill_PrintNumVAuto# (121,162) #-1#pnl_summary#14#1#0#0
&CSetLine
Cut-off rule 1# cut-off rules 1#Bill_Shape1# (5,121,265) #0#pnl_title#6#1#40#0
Cut-off rule 2# cut-off rules 2#Bill_Shape2# (5,5,265) #0#pnl_summary#9#1#40#0
Step 104:Printer receives the content to be printed by print.er port, loads the configuration file, will be wantedThe content of printing is substituted into the corresponding position of label, and prints full page according to configuration file.
Another embodiment of the application additionally provides a kind of port printing equipment, as shown in figure 3, including:
At least one mark is arranged for each region for printer page to be divided at least one region in division module 301Label, each label are fixed in a region and show;
Predefined module 302, for predefining print attribution in graphical interfaces, needing the label substance printed and canFor the tag attributes of setting;
Configuration file generation module 303, for being preserved the tag attributes set at configuration according to customized formatFile;
Printing drive module 304, for driving printer to receive the content to be printed by print.er port, described in loadThe content to be printed is substituted into the corresponding position of label by configuration file, and according in configuration file successively printer pageEach region.
According to another embodiment of the application, the label includes constant label and signature;Constant label, which corresponds to, to be fixedPrinting content;Value when signature is according to each printing, prints corresponding content.
According to another embodiment of the application, the tag attributes include:Whether label visible, label font, label existPosition in region.
According to another embodiment of the application, by check box come abstract factory whether as it can be seen that by being dragged in preview pageItems label substance is moved to adjust the position of label in the zone.
According to another embodiment of the application, the print attribution is big including printing paper size, printing paper back gauge, Header fontSmall, text type size, title height, content height and note height.
The application example of an application scheme is provided below in conjunction with product receipt:
The paper width of the product receipt such as figure is set as 75MM, be highly set as 90MM (wherein top margin height be 38MM,Single line of data region height is 7MM, page footing height is 45MM), left margin and top margin are all 0MM, the font of title and textSize is all No. 11, title overstriking.
The printer page of product receipt is divided into three print areas, is followed successively by:Top margin, data area, page footing.
Top margin region includes 14 labels and 1 cut-off rule, wherein 9, constant label (such as:Trade name, unit, quantityDeng), signature 5 is (such as:Title, box name-value, lower single time value etc.).
Data area include 5 signatures (such as:Trade name value, unit value, quantitative value etc.).
Page footing region includes 12 labels and 1 cut-off rule, wherein 5, constant label (such as:Amount in Total, goes out at producerProduct machine etc.), signature 7 is (such as:Amount in Total value, producer's value, product machine value etc.).
The realization step of printing product receipt provided by the embodiments of the present application is as shown in figure 5, include the following steps:
Step 501:It reads and parses printing configuration file.
Step 502:By inquiry database return two datasets, the variate-value of top margin and page footing is placed on a data setIt is returned in A, the merchandise news of number of regions, which is placed in a data set B, to be returned.
Step 503:Open port ready-to-print.
Step 504:The signature that top margin is filled according to the value of data set A, is sent to printer and is printed.
Step 505:According to the height in the record number calculation data area domain of data set B, each of data set B is taken out successivelyIt records to fill the signature of data area, generates and need the content printed to be printed per a line.
Step 506:The signature that page footing is filled according to the value of data set A, is sent to printer and is printed.
Step 507:Close port terminates to print.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be bySoftware adds the mode of required hardware platform to realize, naturally it is also possible to all implemented by hardware, but in many cases beforePerson is more preferably embodiment.Based on this understanding, technical scheme of the present invention contributes to background technology whole orPerson part can be expressed in the form of software products, which can be stored in a storage medium, such asROM/RAM, magnetic disc, CD etc., including some instructions are used so that a computer equipment (can be personal computer, serviceDevice either network equipment etc.) execute method described in certain parts of each embodiment of the present invention or embodiment.
The foregoing is merely the preferred embodiments of the application, not to limit the protection domain of the application, it is allWithin the spirit and principle of technical scheme, any modification, equivalent substitution, improvement and etc. done should be included in this ShenWithin the scope of please protecting.