Movatterモバイル変換


[0]ホーム

URL:


CN112926294A - Template file generation method and device - Google Patents

Template file generation method and device
Download PDF

Info

Publication number
CN112926294A
CN112926294ACN202110327630.XACN202110327630ACN112926294ACN 112926294 ACN112926294 ACN 112926294ACN 202110327630 ACN202110327630 ACN 202110327630ACN 112926294 ACN112926294 ACN 112926294A
Authority
CN
China
Prior art keywords
template
setting
elements
file
user
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.)
Pending
Application number
CN202110327630.XA
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank CorpfiledCriticalChina Construction Bank Corp
Priority to CN202110327630.XApriorityCriticalpatent/CN112926294A/en
Publication of CN112926294ApublicationCriticalpatent/CN112926294A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种模板文件的生成方法和装置,涉及自动程序设计技术领域。该方法的一具体实施方式包括:基于用户操作确定模板要素和模板要素的设置;基于模板要素和模板要素的设置,得到自定义模板;根据自定义模板生成模板文件。该实施方式能够减小定制模板的误差和操作步骤,提高格式通用性和兼容性,降低人工成本和定制成本,降低维护成本,解决程序升级维护困难的问题。

Figure 202110327630

The invention discloses a method and device for generating a template file, and relates to the technical field of automatic program design. A specific implementation of the method includes: determining template elements and settings of the template elements based on user operations; obtaining a custom template based on the template elements and the settings of the template elements; generating a template file according to the custom template. This embodiment can reduce errors and operation steps of customized templates, improve format versatility and compatibility, reduce labor costs and customization costs, reduce maintenance costs, and solve the problem of difficulty in program upgrade and maintenance.

Figure 202110327630

Description

Template file generation method and device
Technical Field
The invention relates to the technical field of automatic program design, in particular to a template file generation method and device.
Background
In a business scenario involving credential file generation, a large number of credential generation tasks are handled by customizing multiple styles of credential templates. There are two current schemes for credential template customization: the first scheme is a traditional manual template customization scheme, a worker draws a certificate sample by using office software and prints a paper template, position information of template elements is obtained on the paper template in a manual measurement mode and is configured in a printing program in a parameter mode to generate the certificate template; and the second scheme is that a template is generated through voucher template customization software, and workers design the voucher template based on software such as CrystalReport (crystal report) and JasperReports (report generation tool) and generate files with specific formats (for example, the JasperReports system can generate files with jrxml formats).
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: in the first scheme, the customized template is stored in an off-line file mode, so that the data safety is poor, the labor cost is high, and the error of manual measurement is large; in the second scheme, the voucher template customizing software has high cost, complicated operation steps, poor format universality and compatibility and difficult software program upgrading and maintenance.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a template file, which can reduce errors and operation steps of a customized template, improve format universality and compatibility, reduce labor cost and customization cost, reduce maintenance cost, and solve the problem of difficult program upgrade and maintenance.
To achieve the above object, according to an aspect of an embodiment of the present invention, a method for generating a template file is provided.
A template file generation method comprises the following steps: determining a template element and a setting of the template element based on a user operation; obtaining a self-defined template based on the template elements and the setting of the template elements; and generating a template file according to the self-defined template.
Optionally, the template element is determined from the elements to be selected based on an element dragging operation of a user.
Optionally, determining the setting of the template element comprises: and determining the position setting of the template element according to the dragging position of the template element.
Optionally, the determining the position setting of the template element according to the dragging position of the template element includes: recording a start position, an end position, and size information of the template element being dragged, and determining a position setting of the template element based on the recorded start position, end position, and size information.
Optionally, the custom template is displayed in a page of a user; after determining the position setting of the template element, the method includes: and saving the position setting of the template element, and displaying the position setting of the template element in a specific display area of the page.
Optionally, the page is a browser page of the user.
Optionally, the user operates the user's operations sent as browsers of one or more users.
Optionally, the determining the setting of the template element includes: and for a first template element of the template elements to be input with the content, determining the content setting of the first template element based on the content input operation of a user.
Optionally, the determining the setting of the template element includes: and for a second template element of the template elements with the pattern to be set, acquiring the pattern corresponding to the second template element from the pattern to be selected according to the pattern configuration operation of the user so as to determine the pattern setting of the second template element.
Optionally, the pattern comprises one or more of size, color, alignment.
Optionally, the type of the template element includes one or more types of text, image, and table.
Optionally, the template file is in a JSON format; after the template file is generated according to the custom template, the method comprises the following steps: and converting the template file in the JSON format into a file in a specific format which can be used for browser preview and/or printing.
Optionally, the template element is set by a Canvas element of a hypertext markup language, and the setting includes one or more of a position setting, a content setting, and a style setting.
Optionally, the template file is a credential file.
According to another aspect of the embodiments of the present invention, an apparatus for generating a template file is provided.
An apparatus for generating a template file, comprising: a template element determination module for determining a template element and a setting of the template element based on a user operation; the custom template generating module is used for obtaining a custom template based on the template elements and the setting of the template elements; and the template file generation module is used for generating a template file according to the self-defined template.
Optionally, the template element determination module is further configured to: and determining the template element from the elements to be selected based on element dragging operation of a user.
Optionally, the template element determination module is further configured to: and determining the position setting of the template element according to the dragging position of the template element.
Optionally, the template element determination module is further configured to: recording a start position, an end position, and size information of the template element being dragged, and determining a position setting of the template element based on the recorded start position, end position, and size information.
Optionally, the custom template is displayed in a page of a user; the template element determination module is further configured to: and saving the position setting of the template element, and displaying the position setting of the template element in a specific display area of the page.
Optionally, the page is a browser page of the user.
Optionally, the user operates the user's operations sent as browsers of one or more users.
Optionally, the template element determination module is further configured to: and for a first template element of the template elements to be input with the content, determining the content setting of the first template element based on the content input operation of a user.
Optionally, the template element determination module is further configured to: and for a second template element of the template elements with the pattern to be set, acquiring the pattern corresponding to the second template element from the pattern to be selected according to the pattern configuration operation of the user so as to determine the pattern setting of the second template element.
Optionally, the pattern comprises one or more of size, color, alignment.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; a memory for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method for generating a template file provided by an embodiment of the present invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer-readable medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing a method for generating a template file according to an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: determining a template element and a setting of the template element based on a user operation; obtaining a self-defined template based on the template elements and the setting of the template elements; and generating a template file according to the self-defined template. The method can reduce errors and operation steps of the customized template, improve format universality and compatibility, reduce labor cost and customization cost, reduce maintenance cost and solve the problem of difficult program upgrading and maintenance.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a main flow diagram of a method of generating a template file according to an embodiment of the present invention;
FIG. 2 is a schematic flow diagram for generating a template file according to one embodiment of the present invention;
FIG. 3 is a diagram illustrating the placement of border template elements, according to one embodiment of the present invention;
FIG. 4 is a diagram of setting up elements of a text template according to one embodiment of the invention;
FIG. 5 is a diagram illustrating the setting of styles for template elements, according to one embodiment of the present invention;
FIG. 6 is a schematic diagram of setting up an image template element according to one embodiment of the invention;
FIG. 7 is a schematic diagram of the main modules of a template file generation apparatus according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a main flow diagram of a method for generating a template file according to an embodiment of the present invention.
As shown in fig. 1, the method for generating a template file according to an embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: the template element and the setting of the template element are determined based on a user operation.
The user actions may be user actions sent by one or more of the user's browsers. The user's operation is generated by the user terminal in response to the user instruction, and includes, but is not limited to, an element drag operation, a content input operation, a style configuration operation, and the like. The device such as the server executing the template file generation method according to the embodiment of the present invention may receive the user operation sent by the browser.
And determining the template elements from the elements to be selected based on element dragging operation of a user. The elements dragged by the user at the terminal are the template elements, and the terminal generates element dragging operation of the user according to a dragging instruction of the user.
Determining the settings of the template elements may include: and determining the position setting of the template element according to the dragging position of the template element.
In one embodiment, determining the position setting of the template element according to the dragging position of the template element may include: recording the start position, end position and size information of the dragged template element, and determining the position setting of the template element based on the recorded start position, end position and size information.
In another embodiment, determining the position setting of the template element according to the dragging position of the template element may include: the start position and the end position of the dragging of the template element are recorded, and the position setting of the template element is determined based on the recorded start position and end position.
After determining the position setting of the template element, the method may include: the position setting of the template element is saved, and the position setting of the template element is displayed in a specific display area of the page.
The page may be a browser page of the user's terminal.
Determining the settings of the template elements may include: for a first template element of contents to be input among the template elements, a content setting of the first template element is determined based on a content input operation by a user.
Determining the settings of the template elements may include: and for a second template element of the pattern to be set in the template elements, acquiring the pattern corresponding to the second template element from the pattern to be selected according to the pattern configuration operation of the user so as to determine the pattern setting of the second template element.
The first template element of the content to be input and the second template element of the style to be set are determined according to corresponding selection instructions sent by a browser of a user. The selection instruction is for selecting the first template element or the second template element accordingly.
The pattern may comprise one or more of size, color, alignment.
The type of the template element may include one or more types of text, image, and table.
The template elements are set through a Canvas element of the hypertext markup language, and the setting can comprise one or more of position setting, content setting and style setting.
The Canvas element of the hypertext markup language is specifically a Canvas element in the HTML5 technology.
Step S102: and obtaining the self-defined template based on the template elements and the setting of the template elements.
The custom template is displayed in a user's page, such as a browser page of the user terminal.
Step S103: and generating a template file according to the self-defined template.
And generating a template file according to the custom template, specifically, saving the custom template as a JSON format file to obtain the template file.
After generating the template file according to the custom template, the method may include: the template file in the JSON format is converted into a file in a specific format, such as a file in a PDF format, which can be used for preview and/or printing by a browser.
The template file may be a credential file.
The following describes the template file generation method according to an embodiment of the present invention in detail, taking the credential template customization based on the Web (global wide area network) as an example.
The embodiment of the invention provides a graphical, universal, flexible and low-cost voucher template customizing method based on a B/S (Browser/Server) framework (Browser/Server structure), supports a user to access through a Browser, realizes an operation customizing function based on the Browser mode, can perform visual customized operation in the template customizing process, is not limited by a platform environment, supports cross-platform (independent of an operating system and a hardware environment), reduces the voucher template customizing and maintaining cost, generates a customized template file into a file in a JSON (JavaScript Notation) format, wherein the JSON format is a light data exchange format and can be used as a format for data exchange between a Server and an application, and the JSON format is a data expression mode and a data exchange standard on the Web, the method has the characteristics of no relation with platforms and manufacturers in use and universality. The embodiment of the invention optimizes and unifies the voucher generation format, so that the voucher can be previewed and generated conveniently and quickly, the operation efficiency and the user experience are improved, the data safety is ensured, the voucher template customization cost is reduced, and a solution is provided for the informatization and the standardization of the voucher template.
The embodiment of the invention is based on the canvas characteristic in the HTML5 technology, and can realize the acquisition of the position coordinates of the dynamic elements in the image on the Web and the customization of the template style by the method and the attribute provided in the Javascript technology. HTML5 is a specification of core language HTML (hypertext markup language) in Web, HTML format is converted into recognizable information through technical processing in a browser so as to facilitate Web browsing for a user, JavaScript is a computer program development language and is widely used in a scripting language on the browser, methods and attributes provided in JavaScript technology can include methods of drawing lines, tables and texts and obtaining mouse position coordinates, for example, attributes of canvas include colors, thicknesses and the like, and methods include drawing lines, drawing frames and the like.
FIG. 2 is a flow diagram of generating a credential template file according to one embodiment of the invention.
As shown in fig. 2, a method for generating a template file is implemented by template element definition and template design in a template customization module, and a credential template file (i.e., JSON file) in JSON format is generated; filling dynamic template elements through transaction data transmission service in the template generation module, and generating a certificate through the certificate generation service; the voucher template file and the voucher can be converted into a PDF file for previewing and printing to obtain a PDF voucher and a paper voucher.
The template elements are contents to be displayed on the template and can be divided into fixed template elements and dynamic template elements, the contents of the template can be texts, images or forms, wherein the fixed template elements are text elements with fixed template contents, the contents cannot be changed in subsequent operations, and the dynamic template elements refer to template elements with template contents needing to be filled in the subsequent operations. For example, data such as customer information, money amount, remarks, etc. are generated in the process of banking transaction and processing, and when the voucher template is generated, the dynamic data is filled in dynamic text elements (i.e. dynamic template elements whose contents are texts), and fixed data such as voucher titles, operation instructions, etc. are filled in fixed text elements (i.e. fixed template elements whose contents are texts).
In template design, the position setting, content setting, and style setting of template elements are determined. Specifically, on the page, the user pulls the position of the required template element and the position of the mobile template element by means of mouse dragging, and the server of the embodiment of the present invention obtains the position information of the element by obtaining the start position, the end position and the size information (for example, length, width, height, etc.) of the mouse during dragging. Fig. 3 is a schematic diagram of setting a border template element according to an embodiment of the present invention, and as shown in fig. 3, position information (position setting) is also displayed on the right side of the page in real time during the mouse dragging process, and the position information of the border element is represented by the position of the upper left corner of the border, and the width and height (i.e., size information) of the border. Fig. 4 is a schematic diagram of setting a text template element according to an embodiment of the present invention, and as shown in fig. 4, position information of a fixed text element and a dynamic text element may be represented by recording a start position when a mouse is dragged and size information of a text content.
Fig. 5 is a schematic diagram of setting a style of a template element according to an embodiment of the present invention.
As shown in fig. 5, in the embodiment of the present invention, style setting of template elements may be performed, where the style may include size, color, alignment, and the like, for example, font size, font color, text alignment mode, and the like of a text, and the style and the layout basis are used in later template generation.
Fig. 6 is a schematic diagram of setting an image template element according to an embodiment of the present invention.
As shown in fig. 6, the image template element according to the embodiment of the present invention may be set by importing an image material, and setting the position of the image template element and the length and width (i.e., size information) of the image template element by dragging with a mouse, where the image material may be a two-dimensional code picture, an enterprise trademark picture, or the like.
After the template elements are set, the user-defined template is obtained, the user-defined template is stored as a template file in a JSON format through the embodiment of the invention so as to store the user-defined template elements and information such as position setting, style setting and the like of the template elements, and the template file in the JSON format can be converted into a file in a PDF format so as to facilitate the preview and printing of a user on a browser.
In one embodiment, a template file in JSON format is as follows:
Figure BDA0002995220180000091
Figure BDA0002995220180000101
Figure BDA0002995220180000111
fig. 7 is a schematic diagram of main blocks of a template file generation apparatus according to an embodiment of the present invention.
As shown in fig. 5, a templatefile generating apparatus 700 according to an embodiment of the present invention mainly includes: a templateelement determining module 701, a customtemplate generating module 702 and a templatefile generating module 703.
A templateelement determining module 701, configured to determine a template element and a setting of the template element based on a user operation.
And a customtemplate generating module 702, configured to obtain a custom template based on the template elements and the settings of the template elements.
The templatefile generating module 703 is configured to generate a template file according to the custom template.
In one embodiment, the template element determination module is specifically configured to: and determining the template elements from the elements to be selected based on element dragging operation of a user.
In one embodiment, the template element determination module is specifically configured to: and determining the position setting of the template element according to the dragging position of the template element.
In one embodiment, the template element determination module is specifically configured to: recording the start position, end position and size information of the dragged template element, and determining the position setting of the template element based on the recorded start position, end position and size information.
In one embodiment, the custom template is displayed in the user's page; the template element determination module is specifically configured to: the position setting of the template element is saved, and the position setting of the template element is displayed in a specific display area of the page.
In one embodiment, the page may be a browser page of the user.
In one embodiment, the user actions may be user actions sent by one or more of the user's browsers.
In one embodiment, the template element determination module is specifically configured to: for a first template element of contents to be input among the template elements, a content setting of the first template element is determined based on a content input operation by a user.
In one embodiment, the template element determination module is specifically configured to: and for a second template element of the pattern to be set in the template elements, acquiring the pattern corresponding to the second template element from the pattern to be selected according to the pattern configuration operation of the user so as to determine the pattern setting of the second template element.
In one embodiment, the pattern may include one or more of size, color, alignment.
In one embodiment, the types of template elements may include one or more types of text, images, tables.
In one embodiment, the template file is in a JSON format; the template previewing module can be further included for: and converting the template file in the JSON format into a file in a specific format which can be used for previewing and/or printing by a browser.
In one embodiment, template elements are set by a Canvas element of the hypertext markup language, and the settings may include one or more of location settings, content settings, and style settings.
In one embodiment, the template file may be a credential file.
In addition, the detailed implementation of the template file generation device in the embodiment of the present invention has been described in detail in the above template file generation method, and therefore, the repeated description is not repeated here.
Fig. 8 shows anexemplary system architecture 800 of a template file generation method or a template file generation apparatus to which an embodiment of the present invention can be applied.
As shown in fig. 8, thesystem architecture 800 may includeterminal devices 801, 802, 803, anetwork 804, and aserver 805. Thenetwork 804 serves to provide a medium for communication links between theterminal devices 801, 802, 803 and theserver 805.Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use theterminal devices 801, 802, 803 to interact with aserver 805 over anetwork 804 to receive or send messages or the like. Theterminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
Theterminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
Theserver 805 may be a server that provides various services, such as a back-office management server (for example only) that supports shopping-like websites browsed by users using theterminal devices 801, 802, 803. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for generating the template file provided by the embodiment of the present invention is generally executed by theserver 805, and accordingly, the apparatus for generating the template file is generally disposed in theserver 805.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, a block diagram of acomputer system 900 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, thecomputer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from astorage section 908 into a Random Access Memory (RAM) 903. In theRAM 903, various programs and data necessary for the operation of thesystem 900 are also stored. TheCPU 901,ROM 902, andRAM 903 are connected to each other via abus 904. An input/output (I/O)interface 905 is also connected tobus 904.
The following components are connected to the I/O interface 905: aninput portion 906 including a keyboard, a mouse, and the like; anoutput section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; astorage portion 908 including a hard disk and the like; and acommunication section 909 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 909 performs communication processing via a network such as the internet. Thedrive 910 is also connected to the I/O interface 905 as necessary. Aremovable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on thedrive 910 as necessary, so that a computer program read out therefrom is mounted into thestorage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through thecommunication section 909, and/or installed from theremovable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a template element determining module, a self-defined template generating module and a template file generating module. Here, the names of these modules do not constitute a limitation of the module itself in some cases, and for example, the template element determination module may also be described as "a module for determining the template element and the setting of the template element based on a user operation".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: determining a template element and a setting of the template element based on a user operation; obtaining a self-defined template based on the template elements and the setting of the template elements; and generating a template file according to the self-defined template.
According to the technical scheme of the embodiment of the invention, the template elements and the setting of the template elements are determined based on user operation; obtaining a self-defined template based on the template elements and the setting of the template elements; and generating a template file according to the self-defined template. The method can reduce errors and operation steps of the customized template, improve format universality and compatibility, reduce labor cost and customization cost, reduce maintenance cost and solve the problem of difficult program upgrading and maintenance.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (17)

1. A method for generating a template file is characterized by comprising the following steps:
determining a template element and a setting of the template element based on a user operation;
obtaining a self-defined template based on the template elements and the setting of the template elements;
and generating a template file according to the self-defined template.
2. The method according to claim 1, wherein the template element is determined from the elements to be selected based on an element drag operation by a user.
3. The method of claim 2, wherein determining the settings of the template elements comprises:
and determining the position setting of the template element according to the dragging position of the template element.
4. The method of claim 3, wherein determining the position setting of the template element according to the drag position of the template element comprises:
recording a start position, an end position, and size information of the template element being dragged, and determining a position setting of the template element based on the recorded start position, end position, and size information.
5. The method of claim 3 or 4, wherein the custom template is displayed in a user's page;
after determining the position setting of the template element, the method includes:
and saving the position setting of the template element, and displaying the position setting of the template element in a specific display area of the page.
6. The method of claim 5, wherein the page is a user's browser page.
7. The method of claim 6, wherein the user actions are user actions sent by one or more user browsers.
8. The method of claim 2, wherein determining the settings of the template elements comprises:
and for a first template element of the template elements to be input with the content, determining the content setting of the first template element based on the content input operation of a user.
9. The method of claim 2, wherein determining the settings of the template elements comprises:
and for a second template element of the template elements with the pattern to be set, acquiring the pattern corresponding to the second template element from the pattern to be selected according to the pattern configuration operation of the user so as to determine the pattern setting of the second template element.
10. The method of claim 9, wherein the pattern comprises one or more of size, color, and alignment.
11. The method of claim 1, wherein the types of the template elements comprise one or more types of text, images, and tables.
12. The method of claim 1, wherein the template file is in JSON format;
after the template file is generated according to the custom template, the method comprises the following steps:
and converting the template file in the JSON format into a file in a specific format which can be used for browser preview and/or printing.
13. The method of claim 1, wherein the template elements are set via a Canvas element of a hypertext markup language, and wherein the setting comprises one or more of a location setting, a content setting, and a style setting.
14. The method of claim 1, wherein the template file is a credential file.
15. An apparatus for generating a template file, comprising:
a template element determination module for determining a template element and a setting of the template element based on a user operation;
the custom template generating module is used for obtaining a custom template based on the template elements and the setting of the template elements;
and the template file generation module is used for generating a template file according to the self-defined template.
16. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-14.
17. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-14.
CN202110327630.XA2021-03-262021-03-26Template file generation method and devicePendingCN112926294A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110327630.XACN112926294A (en)2021-03-262021-03-26Template file generation method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110327630.XACN112926294A (en)2021-03-262021-03-26Template file generation method and device

Publications (1)

Publication NumberPublication Date
CN112926294Atrue CN112926294A (en)2021-06-08

Family

ID=76176239

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110327630.XAPendingCN112926294A (en)2021-03-262021-03-26Template file generation method and device

Country Status (1)

CountryLink
CN (1)CN112926294A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113961272A (en)*2021-12-202022-01-21广州半城云信息科技有限公司Personalized page display method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105302507A (en)*2015-11-112016-02-03中国建设银行股份有限公司Certificate printing control method and certificate template setting method and system
CN107562706A (en)*2017-08-232018-01-09深圳赛盒科技有限公司Self-defined ticket templates method and system
CN108681530A (en)*2018-05-042018-10-19北京天元创新科技有限公司A kind of official document generation method and system based on Web
CN111783414A (en)*2020-07-202020-10-16上海乾臻信息科技有限公司Label printing template generation method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105302507A (en)*2015-11-112016-02-03中国建设银行股份有限公司Certificate printing control method and certificate template setting method and system
CN107562706A (en)*2017-08-232018-01-09深圳赛盒科技有限公司Self-defined ticket templates method and system
CN108681530A (en)*2018-05-042018-10-19北京天元创新科技有限公司A kind of official document generation method and system based on Web
CN111783414A (en)*2020-07-202020-10-16上海乾臻信息科技有限公司Label printing template generation method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113961272A (en)*2021-12-202022-01-21广州半城云信息科技有限公司Personalized page display method and system
CN113961272B (en)*2021-12-202022-04-01咚咚来客(广州)信息技术有限公司Personalized page display method and system

Similar Documents

PublicationPublication DateTitle
CN107832045B (en)Method and apparatus for cross programming language interface conversion
CN113031946B (en)Method and device for rendering page component
CN112486482B (en)Page display method and device
MX2010011403A (en)Techniques to modify a document using a latent transfer surface.
CN113382083A (en)Webpage screenshot method and device
CN108628812A (en)Method, apparatus, electronic equipment and the readable storage medium storing program for executing of self-defined face single mode plate
CN113778404A (en) A method and device for generating a page
CN111294395A (en)Terminal page transmission method, device, medium and electronic equipment
CN113282852B (en) Method and device for editing web page
CN113220381A (en)Click data display method and device
CN113656041A (en) Data processing method, apparatus, equipment and storage medium
CN113111632A (en)Visual configuration method, device, equipment and medium for electronic manuscript paper
CN110941401B (en) Printing method and device
CN112486437A (en)Method for printing in Web application by cross-platform and cross-browser
CN118194837A (en)Report file generation method and device
CN113760279B (en) A method and device for generating a page
CN112926294A (en)Template file generation method and device
KR102013620B1 (en)Web based document editing server for changing template of web based document and operating method thereof
US8448183B2 (en)Presentation layer application integration
CN112988090A (en)Method and device for data printing management
US10416855B2 (en)Integrating remote assets from content management service with content developed by content creation applications
CN112101239B (en)Method, device and system for searching missing characters in PDF (portable document format) file
CN113032696A (en)Display method and display device of page picture
CN112130855B (en) A method and device for generating a page
CN115328324A (en)Method and device for inputting characters at mobile terminal

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp