CN115408989A - Variable graph description method and device and electronic equipment - Google Patents

Variable graph description method and device and electronic equipment Download PDF

Info

Publication number
CN115408989A
CN115408989A CN202211125688.7A CN202211125688A CN115408989A CN 115408989 A CN115408989 A CN 115408989A CN 202211125688 A CN202211125688 A CN 202211125688A CN 115408989 A CN115408989 A CN 115408989A
Authority
CN
China
Prior art keywords
variable
text
expression
determining
elements
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
CN202211125688.7A
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.)
Jiameng Ruipu Science & Technology Development Co ltd Beijing
Original Assignee
Jiameng Ruipu Science & Technology Development Co ltd Beijing
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 Jiameng Ruipu Science & Technology Development Co ltd Beijing filed Critical Jiameng Ruipu Science & Technology Development Co ltd Beijing
Priority to CN202211125688.7A priority Critical patent/CN115408989A/en
Publication of CN115408989A publication Critical patent/CN115408989A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application relates to a variable graphic description method, a variable graphic description device and electronic equipment, wherein a variable text is determined, and the variable text comprises variable expressions corresponding to variable elements; the variable expression is used for representing the incidence relation between the variable element and the replacement element; and calculating the variable expression in the variable text to enable the replacement element to replace the variable expression, and generating the text corresponding to the replacement element. The variable elements and the replacement elements in the text to be processed can be determined according to the requirements of the user, and the requirements of the user can be better met. The variable expression is determined based on the association relationship between the variable elements and the replacing elements, the variable elements can be quickly and automatically replaced by the replacing elements through the calculation of the variable expression, then the variable text determined based on the variable expression is calculated, texts corresponding to the replacing elements are quickly and massively generated, a large amount of time and storage space of equipment are saved, and the processing efficiency is improved.

Description

Variable graph description method and device and electronic equipment
Technical Field
The present application relates to the field of graphic description technologies, and in particular, to a method and an apparatus for describing a variable graphic, and an electronic device.
Background
Currently, the most common image description related art is the image description using Scalable Vector Graphics (SVG). SVG can use a static way to describe graphics (text, lines, images, etc.) based on Extensible Markup Language (XML). Because XML is easy to realize, the SVG based on XML is very simple, easy to directly edit and widely applied.
However, SVG can only use static mode to describe graphics, and cannot meet the increasing demand of people for implementing variable graphics description. For example, in many scenarios, there are graphics in the batch generated files that need to be changed according to different requirements. In order to implement such varying patterns, a variable pattern description is required. These scenarios include variable printing scenarios such as personalized printing and label printing. In the related art, the variable printing process is only to modify and fill the changed graphics to the corresponding positions in advance, generate the pages to be printed finally, and then print the pages. Therefore, the operation is complex, extra storage space is occupied, a large amount of processing time is consumed, and the processing efficiency is low.
Disclosure of Invention
The application provides a variable graph description method, a variable graph description device and electronic equipment, which can automatically realize variable graph description, save a large amount of time and storage space of the equipment and improve the processing efficiency.
In a first aspect, the present application provides a variable graph describing method, including:
determining a variable text, wherein the variable text comprises variable expressions corresponding to variable elements; the variable expression is used for representing the incidence relation between the variable element and the replacement element;
and calculating the variable expression in the variable text to enable the replacement element to replace the variable expression, and generating the text corresponding to the replacement element.
Optionally, the determining a variable text, where the variable text includes a variable expression corresponding to a variable element, includes:
determining a text to be processed;
determining variable elements in the text to be processed according to the element selection instruction;
and replacing the variable elements with variable expressions to generate variable texts.
Optionally, the variable text further includes: fixed texts corresponding to the fixed elements;
the determining of the variable text comprises:
determining a text to be processed;
determining variable elements and fixed elements in the text to be processed according to the element selection instruction;
replacing the variable element with a variable expression;
describing the fixed elements by using extensible markup language (xml) to generate a fixed text;
and generating a variable text according to the variable expression and the fixed text.
Optionally, calculating a variable expression in the variable text to enable the replacement element to replace the variable expression, and generating a text corresponding to the replacement element, includes:
traversing the variable text, searching the identification of the variable expression, and determining the position of the variable expression;
and executing a replacing instruction corresponding to the variable expression, replacing a replacing element corresponding to the variable expression to the position of the variable expression, and generating a text corresponding to the replacing element.
Optionally, replacing the variable element with a variable expression includes:
determining a type of the variable element;
determining a variable expression of a corresponding type according to the type of the variable element;
and replacing the variable elements with variable expressions of corresponding types.
Optionally, the variable text includes: various preset page templates;
the determining of the variable text comprises:
determining a corresponding page template according to a user instruction;
the calculating the variable expression in the variable text comprises:
calculating the variable expression in the corresponding page template;
the method further comprises the following steps:
determining an application text;
and overlapping the text corresponding to the replacing element with the application text according to an overlapping mode selected by a user to generate an intermediate format text.
Optionally, the method further includes:
generating a replacement instruction corresponding to the variable expression by using a standard variable and a standard function preset by a system;
the executing the replacement instruction corresponding to the variable expression includes:
executing the standard function including the standard variable.
Optionally, the method further includes:
determining a page description language supported by an output device;
converting the description language of the text corresponding to the replacement element into a page description language supported by the output device to generate a final text;
the final text is sent to an output device, which includes any type of printer.
In a second aspect, the present application provides a variable graphic description apparatus comprising:
the variable text determination module is used for determining a variable text, and the variable text comprises variable expressions corresponding to variable elements; the variable expression is used for representing the incidence relation between the variable element and the replacement element;
and the corresponding text generation module is used for calculating the variable expression in the variable text so as to enable the replacement element to replace the variable expression and generate the text corresponding to the replacement element.
Optionally, the variable text determining module is specifically configured to:
determining a text to be processed;
determining variable elements in the text to be processed according to the element selection instruction;
and replacing the variable elements with variable expressions to generate variable texts.
Optionally, the variable text further includes: fixed text corresponding to the fixed element;
the variable text determination module is specifically configured to:
determining a text to be processed;
determining variable elements and fixed elements in the text to be processed according to the element selection instruction;
replacing the variable element with a variable expression;
describing the fixed elements by using extensible markup language xml to generate a fixed text;
and generating a variable text according to the variable expression and the fixed text.
Optionally, the corresponding text generating module is specifically configured to:
traversing the variable text, searching the identification of the variable expression, and determining the position of the variable expression;
and executing a replacing instruction corresponding to the variable expression, replacing a replacing element corresponding to the variable expression to the position of the variable expression, and generating a text corresponding to the replacing element.
Optionally, when the variable element is replaced with a variable expression, the corresponding text generation module is specifically configured to:
determining a type of the variable element;
determining a variable expression of a corresponding type according to the type of the variable element;
and replacing the variable elements with variable expressions of corresponding types.
Optionally, the variable text includes: various preset page templates;
the variable text determination module is specifically configured to:
determining a corresponding page template according to a user instruction;
the corresponding text generation module is specifically configured to: calculating the variable expression in the corresponding page template;
the device further comprises: an intermediate format text generation module to:
determining an application text;
and overlapping the text corresponding to the replacing element with the application text according to an overlapping mode selected by a user to generate an intermediate format text.
Optionally, the apparatus further comprises: a variable expression execution module to:
generating a replacement instruction corresponding to the variable expression by using a standard variable and a standard function preset by a system;
the corresponding text generation module, when executing the replacement instruction corresponding to the variable expression, is specifically configured to:
executing the standard function including the standard variable.
Optionally, the apparatus further comprises: a language translation processing module for:
determining a page description language supported by an output device;
converting the description language of the text corresponding to the replacement element into a page description language supported by the output device to generate a final text;
the final text is sent to an output device, which includes any type of printer.
In a third aspect, the present application provides an electronic device, comprising: a memory having stored thereon a computer program which is loadable by the processor and adapted to perform the method of the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program capable of being loaded by a processor and performing the method of the first aspect.
The application provides a variable graphic description method, a variable graphic description device and electronic equipment, wherein a variable text is determined, and the variable text comprises variable expressions corresponding to variable elements; the variable expression is used for representing the incidence relation between the variable element and the replacement element; and calculating a variable expression in the variable text to enable the replacement element to replace the variable expression, and generating the text corresponding to the replacement element. The variable elements and the replacement elements in the text to be processed can be determined according to the requirements of the user, and the requirements of the user can be better met. The variable expression is determined based on the incidence relation between the variable elements and the replacing elements, the variable elements can be quickly and automatically replaced by the replacing elements through the calculation of the variable expression, then the variable text determined based on the variable expression is calculated, texts corresponding to the replacing elements are quickly and massively generated, a large amount of time and storage space of equipment are saved, and the processing efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 2 is a flow chart of a variable graph depiction method according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a text content change of a text conversion process according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a variable graphic description apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship, unless otherwise specified.
Related image description technologies often use the SVG language, and SVG is used to describe graphics (graphics may include text, lines, images, etc.), so that the graphics quality of the graphics can not be lost in the case of the change of the size, etc. SVG is based on xml, and xml is easy to implement, so SVG is very simple, can be directly edited easily, and can be applied to many scenes.
With the continuous improvement of science and technology, the implementation requirement of variable graphic description is increasing, but SVG can only use a static way to describe graphics and cannot use a dynamic way to describe graphics, for example, in many scenes, graphics which need to be changed according to different requirements exist in the text generated in batches. In order to implement such a varying pattern, a variable pattern description is required. These scenarios include variable printing scenarios such as personalized printing and label printing. Besides, the method also comprises office printing scenes such as official document marking, digital signature and the like. In the related art, the variable printing process is only to modify and fill the changed graphics to the corresponding positions in advance, generate the pages to be printed finally, and then print the pages. Therefore, the operation is complex, extra storage space is occupied, a large amount of processing time is consumed, and the processing efficiency is low.
Based on the variable graph description method and device, the variable graph description can be automatically realized, a large amount of time and storage space of equipment are saved, and the processing efficiency is improved.
The embodiments of the present application will be described in further detail with reference to the drawings.
In the application scenario diagram provided in fig. 1, regarding variable data printing, the variable graphic description method provided in the present application may be loaded in a server, and the variable element is replaced by a variable expression, and the variable expression is calculated to generate a variable text. And performing related language conversion processing on the variable text to generate a final text, and printing the final text. Common variable data printing is personalized printing, label printing, and the like. Common office printing is printed with official documents with numbers, digital signatures and the like. The data related to the final text of the server is transmitted (by wire/wireless) to an output device, and the final text is printed.
Variable graph description specific implementations may refer to the following embodiments.
Fig. 2 is a flowchart of a variable graph description method according to an embodiment of the present application, where the method of the present embodiment may be applied to a server in the above scenario, and may also be an output device (a computer, a printer, etc.) with computing capability. As shown in fig. 2, the method includes:
s201, determining a variable text, wherein the variable text comprises variable expressions corresponding to variable elements; the variable expression is used for representing the association relationship between the variable element and the replacement element.
For the embodiment of the application, variable graphic description is carried out according to the requirements of application scenes.
The variable elements may include graphic elements that need to be changed when applied, such as text, lines, shapes, and the like; the replacement element is an element in which a variable element is changed based on a demand. And determining a variable expression according to the variable element and the replacing element, wherein the variable expression replaces the variable element. The variable expression represents the incidence relation between the variable element and the replacement element, and is a logical relation of how the replacement element replaces the variable element.
In some scenarios, the variable element includes an attribute of the variable element, and the variable element attribute includes a content of the variable element and a variable element-related attribute, for example, when the variable element is a text element, the variable text element attribute includes a text content, a font of the text, a color of the text, a position of the text, and the like.
S202, calculating the variable expression in the variable text to enable the replacing element to replace the variable expression, and generating the text corresponding to the replacing element.
And calculating the variable expression, replacing the variable expression by the replacement element according to the calculation result, and generating a text corresponding to different replacement elements.
Specifically, in some scenarios, the page number of the text needs to be changed continuously, and a related variable page number expression is written out, where the variable page number expression may be characterized as a mode of adding a changed page number value, and the variable page number expression is calculated, and the calculation result is a plurality of generated texts with different page number values.
The embodiment can realize the following technical effects: the variable elements and the replacement elements in the text to be processed can be determined according to the requirements of the user, and the requirements of the user can be better met. The variable expression is determined based on the incidence relation between the variable elements and the replacing elements, the variable elements can be quickly and automatically replaced by the replacing elements through the calculation of the variable expression, then the variable text determined based on the variable expression is calculated, texts corresponding to the replacing elements are quickly and massively generated, a large amount of time and storage space of equipment are saved, and the processing efficiency is improved.
In some embodiments, the determining a variable text, where the variable text includes a variable expression corresponding to a variable element, includes: determining a text to be processed; determining variable elements in the text to be processed according to the element selection instruction; and replacing the variable elements with variable expressions to generate variable texts.
And determining the text to be processed according to the user requirement. The element selection instruction is an instruction for selecting variable elements or adding variable elements in the text to be processed according to the requirements of the user, and the elements needing to be changed in the text to be processed are selected as the variable elements. And the variable expression represents the incidence relation between the variable element and the replacing element, and replaces the variable element with the variable expression to generate a variable text.
In some application scenarios, multiple variable expressions may be preset based on the association relationship between the variable element and the replacement element according to common needs of users. And setting a corresponding selection button for a preset variable expression, and quickly clicking the corresponding selection button by a user according to the self requirement in the related system to generate a corresponding variable text. The user can set or modify the corresponding variable expression by himself according to the selection button, and flexibly generate the corresponding variable text according to the self requirement.
For example, in the embodiment of adding a page number, a text to which the page number needs to be added is determined according to a demand instruction of a user for adding the page number, and it is clear that a variable element whose corresponding position where a page number value needs to be changed is a text is added. And replacing variable elements by variable page number expressions, wherein the variable page number expressions represent adding page number values which are continuously changed at corresponding positions of the text to be processed, and generating the variable page number text.
In the embodiment, the text to be processed is determined according to the requirements of the user, and then the variable element is selected according to the element selection instruction, so that the requirements of the user are better met. And replacing the variable elements by the variable expressions to generate variable texts, and changing the texts to be processed into the variable texts, so that the dynamic conversion function of the texts can be realized.
Fig. 3 is a schematic diagram of text content change in a text conversion process according to an embodiment of the present application, and reference may be made to the description in the embodiment of the present application to a specific implementation process of text content change in the text conversion process.
In other embodiments, the variable text further comprises: fixed text corresponding to the fixed element; the determining of the variable text comprises: determining a text to be processed; determining variable elements and fixed elements in the text to be processed according to the element selection instruction;
replacing the variable element with a variable expression; describing the fixed elements by using extensible markup language xml to generate a fixed text; and generating a variable text according to the variable expression and the fixed text.
Determining a text to be processed according to user requirements, and selecting an element needing to be changed in the text to be processed as a variable element according to an instruction for selecting the variable element or adding the variable element; other elements in the text to be processed are fixed elements. The variable element is replaced with a variable expression. And performing static graphic description processing on the fixed elements by using extensible markup language xml to generate a fixed text.
The xml language is characterized by allowing custom tags that can either specify fixed element types in a brief way or interpret some method that uses static graphical descriptions. Specifically, the xml language may include a description similar to a text, and a text tag in a symbol "<" explains the type of the extracted fixed element in detail, so that a user can more clearly understand the method adopted by the data description, and the user can flexibly modify the xml language according to the self requirement. Specifically, the fixed text may include < text x = "100" y = "50" > hello </text >, and the position of the text segment "hello" on the text is statically described.
The static graphic description method can describe common fixed graphic elements, such as fixed texts, images, barcodes and the like. The static graphic description method further includes support for printing common color spaces such as RGB, CMYK, deviceN, etc., so that a user can accurately describe a desired color. The static graphic description method also comprises high-level graphic characteristics such as stamping, transparency and the like, is suitable for printing scenes, and can meet various requirements of users more easily.
In some embodiments, calculating the variable expression in the variable text to cause the replacement element to replace the variable expression, generating text corresponding to the replacement element, includes: traversing the variable text, searching the identification of the variable expression, and determining the position of the variable expression; and executing a replacing instruction corresponding to the variable expression, replacing a replacing element corresponding to the variable expression to the position of the variable expression, and generating a text corresponding to the replacing element.
The variable expression represents the incidence relation between the variable element and the replacement element, and corresponds to a section of program, and the section of corresponding program is a replacement instruction corresponding to the variable expression. There are special identifiers, such as "$" symbols, before and after the position of the variable expression, and before and after the position of the variable expression corresponding to the program. The variable expressions are located in the variable file, one or more variable expressions may be located in the variable file, the variable text may be traversed, the positions of the variable expressions in the variable text are determined by searching the identifications of the variable expressions, and the searched variable expressions are calculated. The calculation process is to execute a replacing instruction, replace the corresponding replacing element to the position of the variable expression, and generate the text corresponding to the replacing element.
Specifically, the above process of calculating the variable expression and replacing the variable expression with the replacement element can be illustrated as follows. And executing the replacement instruction corresponding to the variable expression, namely calculating the variable expression, and finding the storage position of the replacement element in the calculation process. The positions of the variable elements and the positions of the replacement elements are in one-to-one correspondence, so that the storage positions of the replacement elements can be traversed according to the positions of the variable expressions, the determined corresponding replacement elements can be found, the replacement elements are replaced to the positions of the variable expressions, and texts corresponding to the replacement elements are generated; in some specific scenarios, it is necessary to continuously execute a replacement instruction of a certain variable expression to obtain different execution results, determine different positions of corresponding replacement elements, and replace the values of the positions of the corresponding replacement elements with the positions of the variable expression, so as to generate a text corresponding to the replacement elements.
Specifically, the variable expression corresponds to a program, and can represent the association relationship between the variable element and the replacement element. For example, a program corresponding to the variable page number expression is written according to the requirements of the user.
And the variable page number expression added with the page number is PageNumber, and the expression is embedded into the text to be processed to form the variable page number text. The front and back positions of the expression comprise an identifier symbol "$", the identifier symbol is found when the variable page text is traversed, the variable page expression is calculated, a replacement instruction is executed, the position of $ PageNumber $ is replaced by the value of the page, and the text corresponding to the page value is generated.
Specifically, the replacement element corresponding to the variable expression is replaced to the position of the variable expression, for example, the variable expression represents a behavior of referring to an external name database, the external name database is a preset name table, the corresponding variable expression is { name }, and the corresponding partial variable text is < text > $ { name } $. The alternate instruction is executed to determine the storage location of the external name database, and "{ name }" represents the value of the different locations using the "name" table in the external database. The replacing method can perform traversal replacement from the name value of the starting position of the external database, and can also select the name value of a certain position range of the external database for replacement. The position of the variable expression is the position of "$ { name } $", and the name value corresponding to the position is confirmed to be replaced on the position of the variable expression, so that the "{ name }" is changed into "zhang three", "lie four", and the like. Finally, the expression is replaced by the corresponding name replacing element, and then the text of < text > three hello </text >, "< text > li four hello </text >" and the like are obtained, and the text corresponding to the replacing name element is generated.
The embodiment can search the variable expression by traversing the text to be processed, and special symbols exist before and after the position of the variable expression, so that the variable expression can be conveniently searched and identified, the situation that the variable expression is not identified is reduced, and the requirement of a user can be met. The position of the variable expression in the text is determined, the variable expression is calculated, the replacement element is automatically replaced to the position of the variable expression, accurate positioning and replacement of the replacement element are achieved, time is saved, and therefore the efficiency of relevant work can be improved.
In some embodiments, the replacing the variable element with a variable expression includes: determining a type of the variable element; determining a variable expression of a corresponding type according to the type of the variable element; and replacing the variable elements with variable expressions of corresponding types.
And determining the type of the variable element according to the requirement of the user, and determining the variable expression of the corresponding type. Common types of variable expressions include referencing standard environment variables, referencing external databases, and executing standard functions, which may be preset for the system. For example, if the variable expression contains a pure letter form of "Name", and the "Name" is a preset standard environment variable, the standard environment variable is searched; if the variable expression contains a symbolic form of 'Name }', searching an external database; if the variable expression includes a function form of "func ()", a call to the relevant standard function is made. After the variable expression is determined, the variable expression is replaced to the position of the variable element.
In some specific embodiments, the corresponding variable expression type is a reference standard environment variable, for example, a page number is added, the corresponding variable expression type is determined as the reference standard environment variable according to the type of the variable element, the variable page number expression of the corresponding type is PageNumber, which represents the standard environment variable to which the page number is added at the corresponding position of the text, and the PageNumber is a preset page number variable. And after the variable page number expression is determined, replacing the variable page number expression to the position of the variable element.
Specifically, the reference standard environment variable may further include, for example, a standard environment variable that determines, according to a user's requirement, that the variable page number expression of the corresponding type is JobName and DateTime, and represents that the job name and the print time are added at a corresponding position of the text. "JobName" and "DateTime" are standard environment variables that are automatically set by the system. After the variable expression is determined, the variable expression is replaced to the position of the variable element.
In other specific embodiments, the corresponding variable expression type refers to an external database, for example, different names are added to the text, so as to achieve personalized customization. And determining the type of the corresponding variable expression as a reference external database according to the type of the variable element, wherein the variable expression of the corresponding type is { name }, "{ }" is a symbol for referring to a preset external database, and "name" is a preset external name database. After the variable expression is determined, the variable expression is replaced to the position of the variable element.
In other specific embodiments, the corresponding variable expression type is a function executing standard, for example, in an office scenario, it is often necessary to edit the number of a formal document, which is generally called document number marking. The processing system of the computer can preset a standard function, and can replace the variable expression by the value corresponding to the standard function by executing the replacement instruction of the variable expression, wherein the corresponding variable expression is printf ("% 05 d", counter (1,1,0)), "counter" is the standard function for calculating the marking number, the number value is accumulated and calculated, and the formatted 5-bit zero padding value can be formed by the "printf" standard function. After the variable expression is determined, the variable expression is replaced to the position of the variable element.
In the embodiment, the types of the variable elements are determined, different types of variable expressions can be determined, redundant calculation of the variable expressions is reduced, and the efficiency of replacing the variable expressions by the replacing elements is realized more efficiently.
In other embodiments, the variable text comprises: various preset page templates; the determining of the variable text comprises: determining a corresponding page template according to a user instruction; the calculating the variable expression in the variable text comprises: calculating the variable expression in the corresponding page template; the method further comprises the following steps: determining an application text;
and superposing the text corresponding to the replacing element with the application text according to the superposition mode selected by the user to generate an intermediate format text.
The variable text can comprise a plurality of page templates, and the page template is a special variable text and only comprises a corresponding variable expression. And determining an application text according to the user requirement, wherein the application text is the text needing to be added with the variable elements. And selecting a corresponding superposition mode according to the user requirement, wherein the superposition mode can be a mode that the page template is superposed with the application text in sequence, or a mode that the page template selects superposition with the application text in different ranges. And calculating the variable expression in the corresponding page template to generate a text corresponding to the replacement element, and overlapping the text corresponding to the replacement element with the application text according to the overlapping mode selected by the user to generate an intermediate format text.
Specifically, for example, a page template is created. Firstly, a blank page template is made, variable page elements are added to corresponding positions of an application text, the corresponding variable page expression is PageNumber, and the page template is generated. And executing a replacement instruction of the variable expression in the page template, adding the changed page numerical value to the blank text template, and generating a text corresponding to the replaced page element. And determining an application text according to the user requirement, and overlapping the text corresponding to the replacing page code element with the application text to generate an intermediate format text. The corresponding position of each page on the intermediate format text is automatically added with a page number value.
By manufacturing different types of page templates, the variable graph description method can be conveniently and quickly applied to a plurality of scenes, and compared with a method for specifically performing variable graph description on an application page, the method for manufacturing the page template can save a great amount of time and energy in the application process. And the user can simply make or modify the page template according to the self requirement, so that the user can be met more flexibly.
In other embodiments, further comprising: generating a replacement instruction corresponding to the variable expression by using a standard variable and a standard function preset by a system; the executing the replacement instruction corresponding to the variable expression includes: executing the standard function including the standard variable.
Some standard variables and standard functions preset by the system, for example, those related to print settings. The replacement instruction of the variable expression related to the standard variable and the standard function can be determined according to the requirement of a user. And executing the replacement instruction corresponding to the variable expression, wherein the replacement instruction comprises executing a standard function preset by a system or referring to a standard variable contained in the standard function.
The above embodiments may be exemplified, for example, by making a perforation stamp, where the perforation stamp refers to a stamp stamped on an edge of a group of continuous pages, and the stamp portion of each page is different. According to the number of pages and the page spacing set by a user, a program generates a variable expression for controlling the displayable part of the original seal on each page, so that the seal part of each page is variable. The key variable here is the page number. Such as needing to cover a saddle stitch seal on pages 1 and 2, the program will generate two crop frames for pages 1 and 2, and a variable expression of page number to select the crop frame for the current page. And determining the replacement instructions of the corresponding variable expressions as eq (PageNumber, 1) and eq (PageNumber, 2) by using the relevant standard environment variable and the relevant standard function preset by the system, wherein the eq is the standard function representing whether the two numbers are equal or not, and the PageNumber represents the standard environment variable automatically set by the system. And executing a replacing instruction corresponding to the variable expression, wherein the replacing instruction comprises executing an eq standard function preset by the system and a relevant standard environment variable.
Specifically, the above embodiment may be exemplified, for example, when the position of the replacement element is determined during printing, the origin of the coordinate system for positioning is at the lower left corner of the page, so that x and y are positioned with respect to the left and lower edges of the page, and "x =" 100 "represents 100 left from the page, and" y = "50" represents 50 lower from the page. However, for the page template, the page size during actual printing is uncertain, and if positioning is required according to the right side and the upper side of the page, a replacement instruction of a corresponding variable expression needs to be determined by using a standard environment variable and a standard function. The variable expression is sub (PageWidth, 100), where "sub" is a standard function representing a subtraction operation, and "PageWidth" is a standard environment variable representing the current page width. The whole expression represents "PageWidth-100", that is, the meaning 100 from the right of the page. And executing the replacement instruction corresponding to the variable expression, wherein the execution of the sub standard function preset by the system is included.
In the above embodiment, the replacement instruction of the variable expression is executed, the standard function and the standard variable preset by the system can be executed, the range of the replacement element of the replacement instruction is increased, and the practicability of the method is effectively improved.
In an embodiment of the present application, further comprising: determining a page description language supported by an output device; converting the description language of the text corresponding to the replacement element into a page description language supported by the output device to generate a final text; the final text is sent to an output device, which includes any type of printer.
And (3) the page description languages supported by the output device are determined, and only the texts described by the supported page description languages can be correspondingly processed on the output device. The description language of the text corresponding to the replacement element may not be able to be processed on the output device, so that the text corresponding to the replacement element needs to be subjected to language description conversion processing, converted into a language format supported by the output device, and a final text is generated. The page description language of the final text is sent to the output device for better application. In daily life, a common output device is a printer, a final text generated by the variable graphic description method is suitable for being printed by any type of printer, the type of the printer is not limited, the application scenes of the variable graphic description method are wider, and the efficiency of related printing work is improved.
Specifically, the variable expression in the variable text may be calculated to generate the text corresponding to the replacement element. The text corresponding to the replacement element may be subjected to language description conversion to generate an intermediate format text, where the intermediate format text is similar to the PDF format and is a private page description language format in this embodiment. By knowing the page description language supported by the output equipment, the private format can be converted into the corresponding page description language, the intermediate format text is converted into the final text, and the method is more suitable for practical scenes such as variable printing, office printing and the like, and improves the efficiency of conversion processing of related languages.
Fig. 4 is a schematic structural diagram of a variable pattern description apparatus according to an embodiment of the present application, and as shown in fig. 4, the variable pattern description apparatus 400 of the present embodiment includes: the variable text determining means 401 corresponds to the text generating means 402.
Optionally, the variable text determining module is specifically configured to:
determining a text to be processed;
determining variable elements in the text to be processed according to the element selection instruction;
and replacing the variable elements with variable expressions to generate variable texts.
Optionally, the variable text further includes: fixed texts corresponding to the fixed elements;
the variable text determination module is specifically configured to:
determining a text to be processed;
determining variable elements and fixed elements in the text to be processed according to the element selection instruction;
replacing the variable element with a variable expression;
describing the fixed elements by using extensible markup language xml to generate a fixed text;
and generating a variable text according to the variable expression and the fixed text.
Optionally, the corresponding text generating module is specifically configured to:
traversing the variable text, searching the identification of the variable expression, and determining the position of the variable expression;
and executing a replacing instruction corresponding to the variable expression, replacing a replacing element corresponding to the variable expression to the position of the variable expression, and generating a text corresponding to the replacing element.
Optionally, when the corresponding text generation module replaces the variable element with a variable expression, the corresponding text generation module is specifically configured to:
determining a type of the variable element;
determining a variable expression of a corresponding type according to the type of the variable element;
and replacing the variable elements with variable expressions of corresponding types.
Optionally, the variable text includes: various preset page templates;
the variable text determination module is specifically configured to:
determining a corresponding page template according to a user instruction;
the corresponding text generation module is specifically configured to: calculating the variable expression in the corresponding page template;
the device further comprises: an intermediate format text generation module 403, configured to:
determining an application text;
and overlapping the text corresponding to the replacing element with the application text according to an overlapping mode selected by a user to generate an intermediate format text.
Optionally, the apparatus further comprises: a variable expression execution module 404 for:
generating a replacement instruction corresponding to the variable expression by using a standard variable and a standard function preset by a system;
the corresponding text generation module, when executing the replacement instruction corresponding to the variable expression, is specifically configured to:
executing the standard function including the standard variable.
Optionally, the apparatus further comprises: a language translation processing module 405 for:
determining a page description language supported by an output device;
converting the description language of the text corresponding to the replacement element into a page description language supported by the output device to generate a final text;
the final text is sent to an output device, which includes any type of printer.
The apparatus of this embodiment may be configured to perform the method of any of the above embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 5, an electronic device 500 according to the embodiment may include: a memory 501 and a processor 502.
The memory 501 has stored thereon a computer program that can be loaded by the processor 502 and executed to perform the method in the above-described embodiments.
Wherein the processor 502 is coupled to the memory 501, such as via a bus.
Optionally, the electronic device 500 may also include a transceiver. It should be noted that the transceiver in practical application is not limited to one, and the structure of the electronic device 500 is not limited to the embodiment of the present application.
The Processor 502 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 502 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
A bus may include a path that transfers information between the above components. The bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The Memory 501 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
The memory 501 is used for storing application program codes for executing the scheme of the application, and the processor 502 is used for controlling the execution. The processor 502 is configured to execute application program code stored in the memory 501 to implement the content shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. But also a server, etc. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
The electronic device of this embodiment may be configured to perform the method of any of the above embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
The present application also provides a computer readable storage medium storing a computer program that can be loaded by a processor and executed to perform the method as in the above embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.

Claims (10)

1. A variable graphic description method, comprising:
determining a variable text, wherein the variable text comprises variable expressions corresponding to variable elements; the variable expression is used for representing the incidence relation between the variable element and the replacement element;
and calculating the variable expression in the variable text to enable the replacement element to replace the variable expression, and generating the text corresponding to the replacement element.
2. The method according to claim 1, wherein the determining a variable text including a variable expression corresponding to a variable element comprises:
determining a text to be processed;
determining variable elements in the text to be processed according to the element selection instruction;
and replacing the variable elements with variable expressions to generate variable texts.
3. The method of claim 1 or 2, wherein the variable text further comprises: fixed texts corresponding to the fixed elements;
the determining of the variable text comprises:
determining a text to be processed;
determining variable elements and fixed elements in the text to be processed according to the element selection instruction;
replacing the variable element with a variable expression;
describing the fixed elements by using extensible markup language xml to generate a fixed text;
and generating a variable text according to the variable expression and the fixed text.
4. The method of claim 2, wherein computing the variable expression in the variable text to cause the replacement element to replace the variable expression to generate the text corresponding to the replacement element comprises:
traversing the variable text, searching the identification of the variable expression, and determining the position of the variable expression;
and executing a replacing instruction corresponding to the variable expression, replacing a replacing element corresponding to the variable expression to the position of the variable expression, and generating a text corresponding to the replacing element.
5. The method of claim 4, wherein replacing the variable element with a variable expression comprises:
determining a type of the variable element;
determining a variable expression of a corresponding type according to the type of the variable element;
and replacing the variable elements with variable expressions of corresponding types.
6. The method of claim 4, wherein the variable text comprises: various preset page templates;
the determining the variable text comprises:
determining a corresponding page template according to a user instruction;
the calculating the variable expression in the variable text comprises:
calculating the variable expression in the corresponding page template;
the method further comprises the following steps:
determining an application text;
and overlapping the text corresponding to the replacing element with the application text according to an overlapping mode selected by a user to generate an intermediate format text.
7. The method of any of claims 4-6, further comprising:
generating a replacement instruction corresponding to the variable expression by using a standard variable and a standard function preset by a system;
the executing the replacement instruction corresponding to the variable expression includes:
executing the standard function containing the standard variable.
8. The method of claim 1, further comprising:
determining a page description language supported by an output device;
converting the description language of the text corresponding to the replacement element into a page description language supported by the output device to generate a final text;
the final text is sent to an output device, which includes any type of printer.
9. A variable graphic description apparatus, comprising:
the variable text determining module is used for determining a variable text, and the variable text comprises variable expressions corresponding to variable elements; the variable expression is used for representing the incidence relation between the variable element and the replacement element;
and the corresponding text generation module is used for calculating the variable expression in the variable text so as to enable the replacement element to replace the variable expression and generate the text corresponding to the replacement element.
10. An electronic device, comprising: a memory and a processor;
the memory to store program instructions;
the processor, which is used to call and execute the program instructions in the memory, executes the method of any one of claims 1-8.
CN202211125688.7A 2022-09-16 2022-09-16 Variable graph description method and device and electronic equipment Pending CN115408989A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211125688.7A CN115408989A (en) 2022-09-16 2022-09-16 Variable graph description method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211125688.7A CN115408989A (en) 2022-09-16 2022-09-16 Variable graph description method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115408989A true CN115408989A (en) 2022-11-29

Family

ID=84165490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211125688.7A Pending CN115408989A (en) 2022-09-16 2022-09-16 Variable graph description method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115408989A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571977A (en) * 2014-12-05 2015-04-29 北京赛德高科铁道电气科技有限责任公司 Report printing method and system based on HTML (Hyper Text Markup Language) template
CN113869020A (en) * 2020-06-30 2021-12-31 北京真知科技有限公司 User variable domain processing method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571977A (en) * 2014-12-05 2015-04-29 北京赛德高科铁道电气科技有限责任公司 Report printing method and system based on HTML (Hyper Text Markup Language) template
CN113869020A (en) * 2020-06-30 2021-12-31 北京真知科技有限公司 User variable domain processing method

Similar Documents

Publication Publication Date Title
EP1538534A2 (en) Generation of a PPML template from a PDF document
US20130181995A1 (en) Handwritten character font library
CN113609820B (en) Method, device and equipment for generating word file based on extensible markup language file
US20130063769A1 (en) Information management apparatus and method, information management system, and non-transitory computer readable medium
US20150169508A1 (en) Obfuscating page-description language output to thwart conversion to an editable format
US20170154022A1 (en) Information processing apparatus, method for controlling the same, and storage medium
US8136120B2 (en) Methods and systems of reconciling sources of print job processing information in a print processing environment
CN115408989A (en) Variable graph description method and device and electronic equipment
CN116110065A (en) Method, device, computer equipment and storage medium for generating question card data
CN111475156B (en) Page code generation method and device, electronic equipment and storage medium
US10657427B2 (en) Information processing apparatus, information processing method and storage medium
US10755034B2 (en) Information processing apparatus
CN113934384B (en) Data rendering method, device, computer equipment and storage medium
JP2001260498A (en) Printer and its control method
US10606928B2 (en) Assistive technology for the impaired
JP2015212963A (en) Bar code instruction generation device
CN113703699B (en) Real-time output method and device for electronic file
CN114489895B (en) Batch poster generation method, device, equipment and medium
JP2018120637A (en) Bar code instruction creation device
JP3197724U (en) Insurance form creation device
CN116881399A (en) Data information processing method, device, electronic equipment and storage medium
CN115544980A (en) Method and device for generating document by Excel file based on Revit
US20140089784A1 (en) Page data generation apparatus, recording medium, and page data generation method
US8055083B2 (en) Portable bitmap rendering systems and methods
CN117094783A (en) Bill generation method, bill generation device, bill generation processor 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