CN110221790B - Universal printing method and apparatus, analyzer, and storage medium - Google Patents

Universal printing method and apparatus, analyzer, and storage medium Download PDF

Info

Publication number
CN110221790B
CN110221790B CN201910452437.1A CN201910452437A CN110221790B CN 110221790 B CN110221790 B CN 110221790B CN 201910452437 A CN201910452437 A CN 201910452437A CN 110221790 B CN110221790 B CN 110221790B
Authority
CN
China
Prior art keywords
page
generate
data
binding
printing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910452437.1A
Other languages
Chinese (zh)
Other versions
CN110221790A (en
Inventor
张静
李冰
罗李林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maccura Medical Electronics Co Ltd
Original Assignee
Maccura Medical Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maccura Medical Electronics Co Ltd filed Critical Maccura Medical Electronics Co Ltd
Priority to CN201910452437.1A priority Critical patent/CN110221790B/en
Publication of CN110221790A publication Critical patent/CN110221790A/en
Application granted granted Critical
Publication of CN110221790B publication Critical patent/CN110221790B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1242Image or content composition onto a page
    • G06F3/1243Variable data printing, e.g. document forms, templates, labels, coupons, advertisements, logos, watermarks, transactional printing, fixed content versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client
    • G06F3/1257Configuration of print job parameters, e.g. using UI at the client by using pre-stored settings, e.g. job templates, presets, print styles

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Record Information Processing For Printing (AREA)

Abstract

The invention discloses a universal printing method and device, an analysis instrument and a storage medium. The general printing method comprises the following steps: determining identification data and result data to be printed; binding the identification data and a first field name in the fixed area template to generate a first page; binding the result data with the list parameters in the adjustable area template to generate a second page; combining the first page and the second page to generate a new page; a new page is printed. By adopting the technical scheme in the embodiment of the invention, the printed content can be bound with the template, so that the template can be adjusted when any modification occurs to the printed content, and the code does not need to be modified to recompile software.

Description

Universal printing method and apparatus, analyzer, and storage medium
Technical Field
The invention relates to the field of data printing, in particular to a universal printing method and device, an analysis instrument and a storage medium.
Background
FIG. 1 is a simple example of a verification report.
The printing method of the inspection report in the prior art is as follows: the printed content is written in code such that a separate function or library is required for each type of test report to be printed and any modification to the printed content requires the software to be recompiled.
The printing mode is suitable for the scenes with fixed printing contents and simpler printing scenes. The disadvantage is that the development approach is too low-level. Any modification of the printing content needs to modify codes and recompile software, so that the later maintenance is not facilitated.
Disclosure of Invention
The embodiment of the invention provides a universal printing method and device, an analysis instrument and a storage medium, which can bind printed contents with a template, so that the template can be adjusted when any modification occurs to the printed contents, and the software does not need to be recompiled by modifying codes.
In a first aspect, an embodiment of the present invention provides a general printing method, including:
determining identification data and result data to be printed;
binding the identification data and the fixed area template to generate a first page;
binding the result data with the adjustable area template to generate a second page;
combining the first page and the second page to generate a new page;
a new page is printed.
In a possible implementation manner of the first aspect, the adjustable area template is configured with a height parameter for indicating a height of the list that can be accommodated by a single page; the step of combining the first page and the second page to generate a new page comprises the following steps: determining the total list height of the result data in the second page; if the total list height is larger than the list height indicated by the height parameter, dividing the second page into a plurality of sub-pages, and combining the first page and the sub-page to generate a new page aiming at each sub-page; and if the total list height is less than or equal to the list height indicated by the height parameter, combining the first page and the second page to generate a new page.
In a possible implementation manner of the first aspect, the adjustable region template is further configured with an offset distance of the second page top relative to the first page top; the step of combining the first page and the second page to generate a new page comprises the following steps: and combining the first page and the second page according to the offset distance to generate a new page.
In a possible implementation of the first aspect, the identification data comprises a first field name and a corresponding variable value; the step of binding the identification data and the fixed area template to generate a first page comprises the following steps: loading variable values under the first field names into corresponding first structure bodies by utilizing the corresponding relation between the preset first field names and the first structure bodies; and binding the variable values loaded into the first structures with the corresponding display fields in the fixed area template to generate a first page.
In a possible implementation manner of the first aspect, the result data is organized in an array, and each element in the array includes a second field name and a corresponding variable value; and binding the result data with the adjustable area template to generate a second page, wherein the step comprises the following steps: loading variable values of all elements in the array into the second structure body by utilizing the corresponding relation between the preset array parameters and the second structure body; and binding the variable value loaded into the second structure body with the list parameter in the adjustable area template to generate a second page.
In a possible implementation manner of the first aspect, at least one of the following parameters is further configured in the adjustable region template: printing direction, form attribute parameter, font attribute parameter.
In a possible embodiment of the first aspect, the fastening area comprises at least a header area and/or a footer area.
In one possible implementation of the first aspect, before the step of determining identification data and result data to be printed, the method further comprises: receiving a printing message, wherein the printing message comprises a message ID and a parameter ID; determining a storage path corresponding to the message ID; indexing a fixed area template, an adjustable area template and a data binding configuration document corresponding to the parameter ID according to the storage path; the data binding configuration document is configured with a corresponding relation between a preset first field name and a first structure body and/or a corresponding relation between a preset array parameter and a second structure body.
In a possible implementation manner of the first aspect, the print message further includes a print mode instruction, and the step of printing the new page includes: and printing the new page according to the printing mode instruction.
In a second aspect, an embodiment of the present invention provides a universal printing apparatus, including:
the data determining module is used for determining the identification data and the result data to be printed;
the first data binding and page generating module is used for binding the identification data and the fixed area template to generate a first page;
the second data binding and page generating module is used for binding the result data and the adjustable area template to generate a second page;
the merging processing module is used for merging the first page and the second page to generate a new page;
and the printing module is used for printing the new page.
In a third aspect, embodiments of the present invention provide an analysis apparatus, which includes a universal printing apparatus as described above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium on which a program is stored, the program, when executed by a processor, implementing the general-purpose printing method as described above.
When printing, the identification data and the result data to be printed are determined, then the identification data and the fixed area template are bound to generate a first page, and the result data and the adjustable area template are bound to generate a second page. And generating a new page by combining the first page and the second page, and directly printing the new page.
Compared with the prior art that the printed content needs to be written in the code, the embodiment of the invention respectively sets the templates for each page of the fixed display content and the uncertain display content in the detection report, so that when any modification occurs to the printed content, only the corresponding template needs to be adjusted. For example, only the fixed area template needs to be adjusted when the identification data is modified, only the adjustable area template needs to be adjusted when the result data is modified, and the code does not need to be modified to recompile software, so that the printing effect is high, the later maintenance is facilitated, and the modification difficulty is greatly reduced.
Drawings
The present invention may be better understood from the following description of specific embodiments thereof taken in conjunction with the accompanying drawings, in which like or similar reference characters identify like or similar features.
FIG. 1 is a simple example of a verification report;
FIG. 2 is a flow chart illustrating a general printing method according to a first embodiment of the present invention;
FIG. 3 is an example of a page of a fixed-area template corresponding to FIG. 1;
FIG. 4 is a flowchart illustrating a general printing method according to a second embodiment of the present invention;
FIG. 5 is a flowchart illustrating a general printing method according to a third embodiment of the present invention;
FIG. 6 is a schematic diagram of page merge provided by the embodiment of the present invention;
FIG. 7 is a flowchart illustrating a general printing method according to a fourth embodiment of the present invention;
FIG. 8 is a schematic diagram of general printing logic provided by an embodiment of the present invention;
FIG. 9 is a flowchart illustrating a general printing method according to a fifth embodiment of the present invention;
fig. 10 is a schematic structural diagram of a general printing apparatus according to an embodiment of the present invention.
Detailed Description
Features of various aspects of embodiments of the invention and exemplary embodiments will be described in detail below. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of embodiments of the invention.
The embodiment of the invention provides a universal printing method and device, an analysis instrument and a storage medium. By adopting the embodiment of the invention, the printed content can be bound with the template, so that the template can be adjusted when any modification occurs to the printed content, and the software does not need to be recompiled after the code is modified.
Fig. 2 is a flowchart illustrating a general printing method according to a first embodiment of the present invention.
As shown in fig. 2, the general printing method includes steps 201 to 205.
In step 201, identification data and result data to be printed are determined.
In step 202, a first page is generated by binding the identification data with the fixed-area template.
In step 203, a second page is generated by binding the result data with the adjustable region template.
In step 204, the first page and the second page are merged to generate a new page.
In step 205, a new page is printed.
Fig. 3 is an example of a page of a fixed-area template corresponding to fig. 1.
The nouns in the above steps are briefly described below with reference to fig. 1 and 3.
The "fixed area" is an area where the display content is fixedly displayed for each page at the time of printing.
In one example, the fixed area includes a header area.
In one example, the fixed region includes a header region and a footer region.
In an example, the fixed area further includes a picture display area (not shown in the figure) for loading pictures.
The "adjustable area" is an area where the content is not definitely displayed for each page at the time of printing.
The "identification data to be printed" plays a role of identification in the detection report.
In an example, the identification data includes data for identifying examiner information, detected object information, sample information, and the like. Such as "name: cindy "," physician: 203"," sample type: serum/plasma "and" sample number: n00240", and the like.
In one example, the identification data further includes data for identifying a detection time, a report print date, and the like. Such as "detection time" located in the table tail region: 2019/01/21: 2019/05/09.
The "result data to be printed" is the result data in the detection report.
In one example, the result data is displayed in a list format. The detection results corresponding to 4 items are shown in FIG. 1, and are TSH, HIV Ag/Ab, CA 19-9, CA 19-9*2.
Correspondingly, the result data is issued in an Array (Array) form.
The "fixed region template" is used to configure the display content of the "fixed region".
The adjustable area module is used for configuring the display content of the adjustable area.
In one example, the fixed region template and the adjustable region module can be in a xaml format, which is one of xml, which has the advantages of being programmable in a visual programming language, simple and easy to understand programming logic, supporting font modification, font size modification, loading pictures through configuration, and the like.
In an example, the identification data and result data to be printed may be in xml format.
As described above, in the embodiment of the present invention, when printing, identification data and result data to be printed are determined, then the identification data and the fixed region template are bound to generate a first page, and the result data and the adjustable region template are bound to generate a second page. And generating a new page by combining the first page and the second page, and directly printing the new page.
Compared with the prior art that the printed content needs to be written in the code, the embodiment of the invention respectively sets the templates for the fixed display content and the uncertain display content of each page in the detection report, so that when any modification occurs to the printed content, only the corresponding template needs to be adjusted. For example, only the fixed area template needs to be adjusted when the identification data is modified, only the adjustable area template needs to be adjusted when the result data is modified, and the code recompilation software does not need to be modified, so that the printing effect is high, the later maintenance is facilitated, and the modification difficulty is greatly reduced.
Fig. 4 is a flowchart illustrating a general printing method according to a second embodiment of the present invention.
Fig. 4 is different from fig. 2 in that step 202 in fig. 2 can be subdivided into step 2021 and step 2022 in fig. 4, and is used for the data binding and page generation process of the identification data and the fixed-area template.
In step 2021, the variable value under each first field name is loaded into the corresponding first structure using the preset correspondence between the first field name and the first structure.
In step 2022, the variable values loaded into the first structures are bound to the corresponding display fields in the fixed region templates, respectively, to generate a first page.
Referring to fig. 1 and 2, among the field names located in the header area:
the "name", "doctor", "sample type", "sample number", "detection time", and "report date" can be understood as the first field name. The "Cindy", "203", "serum/plasma", "N00240", "2019/01/21" and "2019/05/09 14 are variable values corresponding to the respective first field names.
The "serial number", "item name", "detection result", "state", "unit", and "reference range" can be understood as the second field name.
In specific implementation, the name: cindy "is taken as an example, and the variable value corresponding to" name "is" Cindy ". The "Cindy" may be loaded into the first structure body G1 by using a preset correspondence between the first field name "and the first structure body G1, and then the variable value" Cindy "loaded into G1 is data-bound with the display field" name "in the fixed-area template.
With "detection time: 2019/01/21. The "2019/01/21/16.
And obtaining the first page after loading and binding the variable values corresponding to all the first field names in the data to be identified and the corresponding display fields in the fixed area template.
Fig. 5 is a flowchart illustrating a general printing method according to a third embodiment of the present invention.
Fig. 5 differs from fig. 2 in that step 203 in fig. 2 can be detailed as step 2031 and step 2032 in fig. 5 for the data binding and page generation process of the result data with the fixed-area template.
In step 2031, the variable values of all elements in the array are loaded into the second structure by using the corresponding relationship between the preset array parameters and the second structure.
In step 2032, the variable values loaded into the second structure are bound with the list parameters in the adjustable region template, and a second page is generated.
As can be seen from the above, the result data is organized in an Array (Array), and each element in the Array includes a second field name and a corresponding variable value. The definition of the second field name is referred to above.
Taking fig. 1 as an example, fig. 1 shows the detection results corresponding to 4 items in total, and the Array parameters can be represented as Array [4,6], which represents 4 rows and 6 columns, wherein,
the first row represents the detection results under item TSH.
The second row shows the results of the detection under item HIV Ag/Ab.
The third row shows the test results under item CA 19-9.
The fourth row shows the detection results in items CA 19-9*2.
The first row and the first column are "number, 1", and the variable value under the second field name "number" is 32.365.
The first row and the second column are "item name, TSH", and the variable value indicating the second field name "item name" is TSH.
The first row and the third column are "detection result, 32.365", and the variable value indicating the second field name "detection result" is 32.365.
The fourth column in the first row is "state, empty", indicating that the variable value of the second field name "state" is empty.
The fifth column in the first row is "unit, μ IU/mL", indicating that the variable value of the second field name "unit" is μ IU/mL.
The sixth column in the first row is "reference range, empty", indicating that the variable value of the second field name "reference range" is 32.365.
During specific implementation, variable values of all elements in the Array [4,6] can be loaded into the second structure body G2 by using a preset corresponding relationship between the Array parameters and the second structure body, and then the variable values loaded into G2 are subjected to data binding with the list parameters in the adjustable area template to obtain a second page.
It should be noted that, the format of the first structure and the second structure can be obtained by retrieving the related data by the techniques in the art, and the details are not described herein.
In some optional embodiments, at least one of the following parameters is also configured in the adjustable region template: print direction, form attribute parameters, and font attribute parameters.
Wherein the printing direction includes a lateral printing or a longitudinal printing.
The table attribute parameters include: the line types, thickness degrees, display parameters (divided into display and non-display) and the like of the table frame and the cell frame.
Font property parameters: font type and font size, etc.
Fig. 6 is a schematic diagram of page merging according to an embodiment of the present invention, and is used to describe in detail a merging process of a new page in step 204.
Referring to fig. 6, height denotes the Height of the first page, and Height =297mm in the case of A4 paper longitudinal printing, for example. The adjustable area template is also provided with a Height proportion parameter Ratio, the Height of a list which can be accommodated by the single page can be indicated by multiplying the Ratio by Height, and the number of lines which can be accommodated by the single page can be obtained by dividing the Height of the list which can be accommodated by the single page by the Height of the line.
Meanwhile, the total list height of the result data in the second page is determined, and the total row number in the second page can be obtained by dividing the total list height by the row height.
In an example, if the total list height of the result data in the second page is greater than the list height indicated by the height parameter, that is, the total number of lines in the second page is greater than the number of lines that a single page can accommodate, the second page may be divided into a plurality of sub-pages. For example, if the total number of lines of the second page is 100 lines and the number of lines that a single page can accommodate is 30 lines, the second page may be divided into 4 sub-pages. Then, aiming at each sub-page, the first page and the sub-page are respectively merged to generate a new page.
In an example, if the total list height of the result data in the second page is less than or equal to the list height indicated by the height parameter, that is, the total number of rows is less than or equal to the number of rows that can be accommodated by the single page, for example, if the total number of rows in the second page is 4 rows and the number of rows that can be accommodated by the single page is 30 rows, the first page and the second page are directly merged to generate a new page.
Referring to fig. 6, the adjustable region template is further configured with an offset distance Move of the second page top relative to the first page top. During merging, the top of the second page (or the sub-page of the second page) is shifted downwards along the top of the first sub-page by the distance Move, and a new page is generated.
Fig. 7 is a flowchart illustrating a general printing method according to a fourth embodiment of the present invention.
Fig. 7 differs from fig. 2 in that steps 206 to 208 in fig. 7 are further included before step 201 in fig. 2.
In step 206, a print message is received, the print message including a message ID and a parameter ID.
In step 207, a storage path corresponding to the message ID is determined.
In step 208, the fixed region template, the tunable region template, and the data binding configuration document corresponding to the parameter ID are indexed according to the storage path.
The data binding configuration document is configured with the above-mentioned corresponding relationship between the preset first field name and the first structure, and/or the above-mentioned corresponding relationship between the preset array parameter and the second structure.
In one example, the data binding configuration document is in xml format.
To facilitate understanding by those skilled in the art, the scheme in fig. 7 is illustrated below.
Assume the overall configuration under the print software catalog: printconfig.xml.
If the message ID is 9026, the parameter tempID is 123456.
The storage path corresponding to the message ID 9026 includes: template configuration file path ConfigFilePath, and data transfer document (data to be printed) path TempFilePath.
Wherein, the document under the path ConfigFilePath includes:
xaml for fixed area (head and tail) template; xaml, variable region (data content) template; xml, and a data binding configuration document dataconfig.
Documents under the path TempFilePath include:
data transmission document tempdata123456.Xml corresponding to parameter tempID.
Xml actual use will add a suffix (e.g., 123456) to the message parameter to prevent multiple repeated calls from overwriting the previous data.
Reference is next made to fig. 8 to facilitate an understanding of the general printing logic of embodiments of the present invention by those skilled in the art.
The global data.m _ orderExample is used for defining a first structure body and a second structure body, and the data binding configuration document DataConfig.xml is used for defining the corresponding relation between the first field name of the identification data in the data transmission document tempdata.xml and the first structure body, and the corresponding relation between the array parameters of the result data and the second structure body.
In one aspect, the identification data in the tempdata.xml of the data transmission document may be loaded into the first structure through the data binding configuration document dataconfig.xml, and then the loaded data in the first structure is data-bound with the display field in the fixed area template (header.
On the other hand, the result data in the data transmission document tempdata.xml can be loaded into the second structural body through the data binding configuration document dataconfig.xml, and then the loaded data in the second structural body is subjected to data binding with the list parameters in the adjustable area template (data.xaml) to generate a second page docData.
And then the first page docHeader and the second page docData are combined to generate new page information of the PaginatoHeaderFooter.
In an optional embodiment, the printing message further includes a printing mode instruction, and the user may print the new page according to the printing mode instruction.
In one example, if the printing mode instruction indicates direct printing, the PrintDlg may be directly called to print a new page.
In an example, if the print mode instruction indicates a print preview, the new page generation XPS file is displayed on the Documentview interface, and the user may perform operations such as zooming in and out on the page when browsing. The interface has an export print option.
If the user chooses to export the print, the system may call PrintDlg to output the new page to the default printer for printing.
If the user chooses to save, the default printer is set to pdf printer, the system can call PrintDlg to output the new page as a pdf document, and the original default printer is restored after the output is completed.
Fig. 9 is a flowchart illustrating a general printing method according to a fifth embodiment of the present invention, which is used to illustrate a printing method for loading data and templates through messaging in conjunction with fig. 8.
Steps 901 to 908 are shown in fig. 9.
Firstly, the printing software is started, and a message waiting state is entered.
In step 901, it is determined whether a new message is received. The message includes a message ID, a parameter tempID and a parameter instruction type.
If yes, go to step 902, otherwise return to step 901.
In step 902, it is determined whether all the configuration documents and transmission data documents corresponding to the message exist. The configuration file of the printing software stores the configuration template path and the file name corresponding to each message ID, and the parameter tempID is combined with the file name of the transmitted data to determine the path and the document stored in the temporarily transmitted data. Referring to fig. 8, the general print-required configuration document includes: xaml, a fixed zone template (header), a tunable zone template (data xaml), and a data binding configuration document dataconfig. Xml, the transmission data document is tempdata.
If yes, go to step 903, otherwise return to step 901.
In step 903, the transport data is loaded according to the data binding profile and the data binding is completed.
In step 904, the print direction is confirmed according to the settings in the adjustable region template.
In step 905, the page size is determined according to the Ratio setting (Ratio) in the adjustable region template, paging is performed, and each page is combined with the sub-pages in the first page corresponding to the fixed region template and the second page corresponding to the adjustable region template according to fig. 6, so as to generate new page information, and a page number identifier is added. The content of each page in the first page is the same, and the content of each sub-page in the second page is different.
In step 906, if the type is direct print, the PrintDlg is called to output a new page to the default printer for printing.
In step 907, if the parameter instruction type is print preview, the new page generation XPS file is displayed on the Documentview interface, and printing is performed after the user confirms export printing.
In step 908, if the parameter instruction type is pdf printing, the default printer is set as pdf printer, and PrintDlg is called to output a new page to the default printer for printing, and the original default printer is restored after printing.
As described above, by adopting the technical scheme in the embodiment of the invention, the xml document of the data to be printed can be generated only before the printing client starts the printing software and acquires the software handle for sending the message.
For the case that the subsequent printing content is changed: if only the page layout is modified and the display of data pictures is reduced, the original template is adjusted, if the binding data (fields in the template) is changed, the data binding configuration file is modified, if the transmission data xml has the data, the modification is very convenient, the printing server does not need to be informed to modify codes, the modification is flexible and variable, if the data volume is enough transmitted, the codes of the client side do not need to be modified, and therefore the data which is possibly used during the use can be transmitted together for later use, and the printing efficiency cannot be influenced.
Due to the simplicity of the scheme, when a company uses the printing software, only template files of the header.xaml and the data.xaml and a data binding configuration file of the config.xml are required to be prepared in advance according to requirements, corresponding messages, paths of the configuration file and a transmission data file are written into the printconfig.xml, and the transmission data xml is written and then a correct message is sent to the printing software to complete printing.
Xaml can flexibly set the header and footer of a print page (e.g., the header height and page height can be adjusted by adjusting the parameters "move" and "height" in fig. 3), and even can bind specific data. Especially for printing with large data volume, one page of paper can not print all data content, the method solves the problems of automatic paging and adding of head and tail, and a user only needs to transmit data, and as for printing several pages, the user does not need to worry about how many lines of data are displayed on each page and what font is used. If the font is modified to cause the reduction of the display line number of each page, the increase of the page number and the like, the modification is automatically finished, a user only needs to modify the font size, and other changes are given to the printing software, so that the modification difficulty is greatly reduced.
It should be noted that, in the specific implementation, the printing task may be started by receiving a message, or the printing may be started by clicking on an interface by setting parameters such as a path position and a printing type of a configuration file on the interface. The parameters of the message may not necessarily be consistent with the text, and a configuration file may be found.
Further, if the user transmission data content can be directly loaded as the printing software content binding data, the data binding profile can also be omitted.
Fig. 10 is a schematic structural diagram of a general printing apparatus according to an embodiment of the present invention.
As shown in fig. 10, the general-purpose printing apparatus includes a data determination module 1001, a first data binding and page generation module 1002, a second data binding and page generation module 1003, a merge processing module 1004, and a printing module 1005.
The data determination module 1001 is configured to determine identification data and result data to be printed.
The first data binding and page generating module 1002 is configured to bind the identification data and the first field name in the fixed area template to generate a first page.
The second data binding and page generating module 1003 is configured to bind the result data and the list parameter in the adjustable region template to generate a second page.
The merging processing module 1004 is configured to merge the first page and the second page to generate a new page.
The printing module 1005 is used to print a new page.
The embodiment of the invention also provides an analysis instrument which comprises the universal printing device.
An embodiment of the present invention also provides a computer-readable storage medium on which a program is stored, which, when executed by a processor, implements the general printing method as described above.
It should be clear that the embodiments in this specification are described in a progressive manner, and the same or similar parts in the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. For the device embodiments, reference may be made to the description of the method embodiments in the relevant part. Embodiments of the invention are not limited to the specific steps and structures described above and shown in the drawings. Those skilled in the art may make various changes, modifications and additions or change the order between the steps after appreciating the spirit of the embodiments of the invention. Also, a detailed description of known process techniques is omitted herein for the sake of brevity.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of an embodiment of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
Embodiments of the present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. For example, the algorithms described in the specific embodiments may be modified without departing from the basic spirit of the embodiments of the present invention. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the embodiments of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

Claims (9)

1. A universal printing method, comprising:
determining identification data and result data to be printed; the identification data comprises a first field name and a corresponding variable value; the organization form of the result data is an array, and each element in the array comprises a second field name and a corresponding variable value;
binding the identification data and a fixed area template to generate a first page;
binding the result data with an adjustable area template to generate a second page;
merging the first page and the second page to generate a new page;
printing the new page;
the adjustable area template is also provided with an offset distance of the top end of the second page relative to the top end of the first page;
the step of merging the first page and the second page to generate a new page includes:
combining the first page and the second page according to the offset distance to generate a new page;
the step of binding the identification data and the fixed area template to generate a first page comprises the following steps:
loading variable values under the first field names into corresponding first structure bodies by utilizing the corresponding relation between the preset first field names and the first structure bodies;
binding the variable values loaded into the first structure bodies with the corresponding display fields in the fixed area template respectively to generate a first page;
the step of binding the result data and the adjustable region template to generate a second page comprises the following steps:
loading variable values of all elements in the array into a second structure body by utilizing a preset corresponding relation between array parameters and the second structure body;
and binding the variable value loaded into the second structure body with the list parameter in the adjustable area template to generate a second page.
2. The method of claim 1, wherein the adjustable region template is configured with a height parameter for indicating a list height that a single page can accommodate;
the step of merging the first page and the second page to generate a new page includes:
determining a total list height of the result data in the second page;
if the total list height is larger than the list height indicated by the height parameter, dividing the second page into a plurality of sub-pages, and combining the first page and each sub-page to generate a new page;
and if the total list height is less than or equal to the list height indicated by the height parameter, combining the first page and the second page to generate a new page.
3. The method of claim 1, wherein the adjustable region template is further configured with at least one of the following parameters: print direction, form attribute parameters, and font attribute parameters.
4. The method of claim 1, wherein the fixed area comprises at least a header area and/or a footer area.
5. The method of claim 1, wherein prior to the step of determining identification data and result data to be printed, the method further comprises:
receiving a printing message, wherein the printing message comprises a message ID and a parameter ID;
determining a storage path corresponding to the message ID;
indexing the fixed area template, the adjustable area template and the data binding configuration document corresponding to the parameter ID according to the storage path;
and the data binding configuration document is configured with a corresponding relation between a preset first field name and a first structure body and/or a corresponding relation between a preset array parameter and a second structure body.
6. The method of claim 5, wherein the print message further includes a print mode command, and wherein the step of printing the new page comprises:
and printing the new page according to the printing mode instruction.
7. A universal printing apparatus, comprising:
the data determining module is used for determining the identification data and the result data to be printed; the identification data comprises a first field name and a corresponding variable value; the organization form of the result data is an array, and each element in the array comprises a second field name and a corresponding variable value;
the first data binding and page generating module is used for binding the identification data and the fixed area template to generate a first page;
the second data binding and page generating module is used for binding the result data and the adjustable area template to generate a second page;
the merging processing module is used for merging the first page and the second page to generate a new page;
the printing module is used for printing the new page; the adjustable area template is also provided with an offset distance of the top end of the second page relative to the top end of the first page;
the merging processing module is specifically configured to:
combining the first page and the second page according to the offset distance to generate a new page;
the first data binding and page generating module is specifically configured to:
loading variable values under the first field names into corresponding first structure bodies by utilizing the corresponding relation between the preset first field names and the first structure bodies;
binding the variable values loaded into the first structure bodies with the corresponding display fields in the fixed area template respectively to generate a first page;
the second data binding and page generating module is specifically configured to:
loading variable values of all elements in the array into a second structure body by utilizing the corresponding relation between preset array parameters and the second structure body;
and binding the variable value loaded into the second structure body with the list parameter in the adjustable area template to generate a second page.
8. An analysis instrument comprising the universal printing apparatus of claim 7.
9. A computer-readable storage medium on which a program is stored, the program, when executed by a processor, implementing the universal printing method according to any one of claims 1-6.
CN201910452437.1A 2019-05-28 2019-05-28 Universal printing method and apparatus, analyzer, and storage medium Active CN110221790B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910452437.1A CN110221790B (en) 2019-05-28 2019-05-28 Universal printing method and apparatus, analyzer, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910452437.1A CN110221790B (en) 2019-05-28 2019-05-28 Universal printing method and apparatus, analyzer, and storage medium

Publications (2)

Publication Number Publication Date
CN110221790A CN110221790A (en) 2019-09-10
CN110221790B true CN110221790B (en) 2023-02-21

Family

ID=67818231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910452437.1A Active CN110221790B (en) 2019-05-28 2019-05-28 Universal printing method and apparatus, analyzer, and storage medium

Country Status (1)

Country Link
CN (1) CN110221790B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111090978B (en) * 2019-12-25 2023-09-19 金蝶软件(中国)有限公司 Document processing method and device and storage medium
CN113256170A (en) * 2021-06-28 2021-08-13 浙江大胜达包装股份有限公司 Graph processing device and method for preprinting paper products

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101324833A (en) * 2008-07-30 2008-12-17 金蝶软件(中国)有限公司 Method and apparatus for saving page resource
CN101458771A (en) * 2007-12-14 2009-06-17 北京大学 Printing method and apparatus thereof
CN101582018A (en) * 2008-05-16 2009-11-18 佳能株式会社 Printing apparatus and printing method
CN105607879A (en) * 2015-12-21 2016-05-25 珠海奔图电子有限公司 Portrait adjustment control method and apparatus suitable for preprinted paper
CN106406775A (en) * 2016-08-31 2017-02-15 无锡雅座在线科技发展有限公司 Bill printing method and device
CN106528006A (en) * 2015-09-10 2017-03-22 阿里巴巴集团控股有限公司 Page printing method and device
CN107943426A (en) * 2017-10-13 2018-04-20 用友网络科技股份有限公司 Document page-by-page printing method, document print page system and computer installation
CN109240625A (en) * 2018-08-09 2019-01-18 深圳市口袋网络科技有限公司 A kind of document structure tree method, apparatus and computer storage medium suitable for printing

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4756870B2 (en) * 2005-02-03 2011-08-24 キヤノン株式会社 Document processing apparatus, document processing method, and program
KR100823265B1 (en) * 2006-04-13 2008-04-17 삼성전자주식회사 Method and apparatus for transmitting XHTML-Print document at mobile device
JP5228543B2 (en) * 2008-03-07 2013-07-03 セイコーエプソン株式会社 Print job processing system and print job processing method
CN103679515A (en) * 2012-09-26 2014-03-26 梅特勒-托利多(常州)测量技术有限公司 Receipt printing method and receipt printing system
CN104571978B (en) * 2015-01-09 2017-11-21 中科宇图天下科技有限公司 A kind of method that document print page is carried out based on html tag
KR101571482B1 (en) * 2015-02-16 2015-11-24 주식회사 세중에스앤씨 Paper save printing appapratus and method for ulti-size variable data printed matter
JP2017039258A (en) * 2015-08-19 2017-02-23 三星電子株式会社Samsung Electronics Co.,Ltd. Image forming device, image forming method, and program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458771A (en) * 2007-12-14 2009-06-17 北京大学 Printing method and apparatus thereof
CN101582018A (en) * 2008-05-16 2009-11-18 佳能株式会社 Printing apparatus and printing method
CN101324833A (en) * 2008-07-30 2008-12-17 金蝶软件(中国)有限公司 Method and apparatus for saving page resource
CN106528006A (en) * 2015-09-10 2017-03-22 阿里巴巴集团控股有限公司 Page printing method and device
CN105607879A (en) * 2015-12-21 2016-05-25 珠海奔图电子有限公司 Portrait adjustment control method and apparatus suitable for preprinted paper
CN106406775A (en) * 2016-08-31 2017-02-15 无锡雅座在线科技发展有限公司 Bill printing method and device
CN107943426A (en) * 2017-10-13 2018-04-20 用友网络科技股份有限公司 Document page-by-page printing method, document print page system and computer installation
CN109240625A (en) * 2018-08-09 2019-01-18 深圳市口袋网络科技有限公司 A kind of document structure tree method, apparatus and computer storage medium suitable for printing

Also Published As

Publication number Publication date
CN110221790A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
US8045198B2 (en) System and method for processing a change history of a PDF file
KR20040111060A (en) Cellular telephone protocol adaptive printing
US20030041102A1 (en) Methods and systems for scaling inappropriately-sized documents in a distributed environment
CN110221790B (en) Universal printing method and apparatus, analyzer, and storage medium
CN114296662B (en) Form document paging printing method and device based on webpage and application of form document paging printing method and device
CN110673847A (en) Configuration page generation method and device, electronic equipment and readable storage medium
CN101114300A (en) Image forming system and image forming method
CN113312033A (en) Template protocol generation and management method
CN111562911A (en) Webpage editing method and device and storage medium
US7973956B2 (en) High speed printing method and apparatus
US9600593B2 (en) Communication system and computer readable medium used therein
EP1724674A2 (en) Terminal apparatus, printing apparatus, printing system, information processing method, and recording medium
CN116484038A (en) SVG logging data interaction management software method and system
JP2006065467A (en) Device for creating data extraction definition information and method for creating data extraction definition information
CN102880433B (en) Signal conditioning package and control method
CN111399834B (en) Form style self-defining method, device, computer equipment and storage medium
CN114371762A (en) Method and device for printing customized label and storage medium
US20170316108A1 (en) Data processsing system, data processing device, and program for editing webpage
CN113778429A (en) Walk-through method, walk-through device and storage medium
JP2007104128A (en) Image processing apparatus, mobile phone, image processing method, and image processing program
CN112818642B (en) Method and device for converting PDF (Portable document Format) file into form file, computer equipment and storage medium
US20050015715A1 (en) Form processing method, form processing program, and form processing apparatus
US20090287733A1 (en) Method for preparing prepress image data
JP2003044412A (en) Adding method for background color
CN114356793B (en) Data processing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant