CN118569233A - Method and device for generating volume based on case elements - Google Patents
Method and device for generating volume based on case elements Download PDFInfo
- Publication number
- CN118569233A CN118569233A CN202410675908.6A CN202410675908A CN118569233A CN 118569233 A CN118569233 A CN 118569233A CN 202410675908 A CN202410675908 A CN 202410675908A CN 118569233 A CN118569233 A CN 118569233A
- Authority
- CN
- China
- Prior art keywords
- variable
- word
- string
- volume
- content
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 230000003068 static effect Effects 0.000 claims abstract description 11
- 230000008859 change Effects 0.000 claims description 5
- 230000007246 mechanism Effects 0.000 claims description 5
- 238000010200 validation analysis Methods 0.000 claims 2
- 238000006467 substitution reaction Methods 0.000 claims 1
- 230000004048 modification Effects 0.000 abstract description 3
- 238000012986 modification Methods 0.000 abstract description 3
- 238000012795 verification Methods 0.000 description 3
- 239000003086 colorant Substances 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Landscapes
- Document Processing Apparatus (AREA)
Abstract
The invention relates to the field of computer automation, in particular to a method and a device for generating an album based on case elements. The method comprises the following steps: configuring a word template, wherein the content in the template comprises a static part and a dynamic part; the dynamic part takes up space in the word template in the form of variable character strings; and receiving case information provided by a user, inquiring the corresponding value of each variable character string from the database by using the corresponding word template, and completing text replacement to obtain a word format volume, and converting the word format volume into a required format according to requirements. After the invention is used, the increasingly-increased personalized demands are met, only the corresponding word templates are needed to be manufactured, and a large number of modification codes are not needed, so that the configuration is flexible and convenient, and meanwhile, if the user needs to modify the content, the word templates to be converted can be directly submitted to the user, so that the user can realize online editing.
Description
Technical Field
The invention relates to the field of computer automation, in particular to a method and a device for generating an album based on case elements.
Background
In the process of archiving and managing the electronic files, the patterns of covers, catalogues, examination sheets, roll bottoms and the like archived in each domestic discipline th hospital are different, and the differences are mainly reflected in data requirements, fonts, font sizes, page margins, background colors, font colors and the like on the templates. Although the traditional implementation mode based on the JAVA AWT component library can achieve the effects, the flexibility is insufficient, the source codes need to be frequently and largely modified in face of increasingly-increasing personalized demands, and the generated picture files cannot be edited online in real time.
Disclosure of Invention
The invention discloses a method and a device for generating a volume based on case elements, which are used for solving the problems that the prior art does not support flexible configuration and does not support online editing.
A method of generating a volume based on case elements, comprising the steps of:
S1: configuring a word template, wherein the content in the word template comprises a static part and a dynamic part, the static part is the content which does not change along with the different cases, and particularly comprises one or more of a cover, a catalogue, a list for examination, fonts, a font size, a page margin and a background color, and the dynamic part is the content which changes along with the different cases; the method specifically comprises the contents of date, court name and the like; the dynamic part takes up space in the word template in the form of variable character strings;
S2: receiving case information provided by a user, traversing variable character strings in the word template by using a corresponding word template, inquiring values corresponding to the variable character strings from a database according to the case information, and completing text replacement to obtain a word format volume, and converting the word format volume into a required format according to requirements; if the user requests to modify the content, returning the volume in the word format to the user, and after the user finishes modifying the content, converting the volume in the word format into the required format again.
Further, the variable character string comprises a variable identification and a verification mechanism.
Further, the form rule of the variable string is TDH [ variable name length ] [ variable name ], wherein ' TDH ' is a variable identifier, ' [ variable name ] ' is the name of the variable string, and ' variable name length ] ' is the length of ' variable name ]; one string is a variable string if it meets the form rule of the variable string, otherwise it is a normal string.
Further, the specific method for executing text replacement on the variable character strings is performed by a replay method of the document Range object.
The invention also provides a device for generating the volume based on the case elements, which comprises the following modules:
And (3) a configuration module: the method comprises the steps that a word template is configured, wherein the content in the word template comprises a static part and a dynamic part, the static part is the content which does not change along with the different cases, and particularly comprises one or more of a cover, a catalogue, a list for examination, fonts, a font size, a page margin and a background color, and the dynamic part is the content which changes along with the different cases; the method specifically comprises the contents of date, court name and the like; the dynamic part takes up space in the word template in the form of variable character strings;
The generation module is used for: the method comprises the steps of receiving case information provided by a user, traversing variable character strings in a word template by using a corresponding word template, inquiring values corresponding to the variable character strings from a database according to the case information, completing text replacement, obtaining a word format volume, and converting the word format volume into a required format according to requirements; if the user requests to modify the content, returning the volume in the word format to the user, and after the user finishes modifying the content, converting the volume in the word format into the required format again.
Further, the variable character string comprises a variable identification and a verification mechanism.
Further, the form rule of the variable string is TDH [ variable name length ] [ variable name ], wherein ' TDH ' is a variable identifier, ' [ variable name ] ' is the name of the variable string, and ' variable name length ] ' is the length of ' variable name ]; one string is a variable string if it meets the form rule of the variable string, otherwise it is a normal string.
Further, the specific method for executing text replacement on the variable character strings is performed by a replay method of the document Range object.
The beneficial effects are that: after the invention is used, the increasingly-increased personalized demands are met, only the corresponding word templates are needed to be manufactured, and a large number of modification codes are not needed, so that the configuration is flexible and convenient, and meanwhile, if the user needs to modify the content, the word templates to be converted can be directly submitted to the user, so that the user can realize online editing.
Drawings
FIG. 1 is a diagram of a word template in the present invention;
FIG. 2 is a schematic diagram of a volume generation process according to the present invention;
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is apparent that the embodiments described below are only some embodiments of the present invention, not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1-2, a method for generating a volume based on case elements includes the steps of:
S1: configuring a word template, wherein the content in the word template comprises a static part and a dynamic part, the static part is the content which does not change along with the different cases, and particularly comprises one or more of a cover, a catalogue, a list for examination, fonts, a font size, a page margin and a background color, and the dynamic part is the content which changes along with the different cases; the method specifically comprises the contents of date, court name and the like; the dynamic part takes up space in the word template in the form of variable character strings;
Specifically, the variable character string comprises a variable identifier and a verification mechanism; in this embodiment, the form rule of the variable string is TDH [ variable name length ] [ variable name ], where "TDH" is a variable identifier, "[ variable name ]" is the name of the variable string, "[ variable name length ]" represents the length of "[ variable name ]", and one string is a variable string if it meets the form rule of the variable string, and otherwise is a normal string. For example, TDH03SPZ, beginning with TDH, the number 03 following is just the number of the following string "SPZ", so TDH03SPZ is a variable string; if the word template is TDH04SPZ, the word template is not understood as a variable character string, but is understood as a common character string in the word template;
S2: receiving case information provided by a user, traversing variable character strings in the word template by using a corresponding word template, inquiring values corresponding to the variable character strings from a database according to the case information, and completing text replacement to obtain a word format volume, and converting the word format volume into a required format according to requirements, wherein the word format volume is converted into pdf format or picture format in the embodiment; if the user requests to modify the content, returning the volume in the word format to the user, and after the user finishes modifying the content, converting the volume in the word format into the required format again.
Specifically, the method for inquiring the values corresponding to the variable character strings in the database is to use SQL sentences for inquiring; for example, variable character strings of TDH04FYMC and TDH03SJY exist in a word template, and the following information is stored in the corresponding case in a database: in the word template, { "TDH04FYMC": "State personnel court in certain city" }, { "TDH03SJY": "Zhang Sanu" }, the "TDH04FYMC" and "TDH03SJY" in the word template are replaced by "State personnel court in certain city", "Zhang Sanu", respectively.
Specifically, the specific method for executing text replacement on the variable character string is performed by a replay method of the document Range object. Range objects represent a contiguous region in a document, defined by a start character position and an end character position.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.
Claims (8)
1. A method for generating a volume based on case elements, comprising the steps of:
S1: configuring a word template, wherein the content in the word template comprises a static part and a dynamic part, the static part is the content which does not change along with the different cases, and the dynamic part is the content which changes along with the different cases; the dynamic part takes up space in the word template in the form of variable character strings;
S2: receiving case information provided by a user, traversing variable character strings in the word template by using a corresponding word template, inquiring values corresponding to the variable character strings from a database according to the case information, and completing text replacement to obtain a word format volume, and converting the word format volume into a required format according to requirements; if the user requests to modify the content, returning the volume in the word format to the user, and after the user finishes modifying the content, converting the volume in the word format into the required format again.
2. The method for generating a volume based on a case element of claim 1 wherein the variable string includes a variable identification and a validation mechanism.
3. The method for generating a volume based on case elements according to claim 1, wherein the formal rule of the variable string is TDH [ variable name length ] [ variable name ], wherein "TDH" is a variable identifier, "[ variable name ]" is the name of the variable string, "[ variable name length ]" represents the length of "[ variable name ]"; one string is a variable string if it meets the form rule of the variable string, otherwise it is a normal string.
4. The method for generating a volume based on case elements according to claim 1, wherein the specific method for performing text substitution on the variable string is performed by a replay method of a document Range object.
5. An apparatus for generating a volume based on case elements, comprising the following modules:
And (3) a configuration module: the method comprises the steps that a word template is configured, wherein the content in the word template comprises a static part and a dynamic part, the static part is the content which does not change along with different cases, and the dynamic part is the content which changes along with different cases; the dynamic part takes up space in the word template in the form of variable character strings;
The generation module is used for: the method comprises the steps of receiving case information provided by a user, traversing variable character strings in a word template by using a corresponding word template, inquiring values corresponding to the variable character strings from a database according to the case information, completing text replacement, obtaining a word format volume, and converting the word format volume into a required format according to requirements; if the user requests to modify the content, returning the volume in the word format to the user, and after the user finishes modifying the content, converting the volume in the word format into the required format again.
6. The apparatus for generating a volume based on a case element of claim 5 wherein the variable string comprises a variable identification and a validation mechanism.
7. The apparatus for generating a volume based on a case element according to claim 5, wherein the formal rule of the variable string is TDH [ variable name length ] [ variable name ], wherein "TDH" is a variable identifier, "[ variable name ]" is a name of the variable string, "[ variable name length ]" represents a length of "[ variable name ]"; one string is a variable string if it meets the form rule of the variable string, otherwise it is a normal string.
8. The apparatus for generating an album based on the case elements according to claim 5, wherein the specific method for performing text replacement on the variable string is a replay method through the document Range object.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410675908.6A CN118569233A (en) | 2024-05-29 | 2024-05-29 | Method and device for generating volume based on case elements |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410675908.6A CN118569233A (en) | 2024-05-29 | 2024-05-29 | Method and device for generating volume based on case elements |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118569233A true CN118569233A (en) | 2024-08-30 |
Family
ID=92464749
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410675908.6A Pending CN118569233A (en) | 2024-05-29 | 2024-05-29 | Method and device for generating volume based on case elements |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118569233A (en) |
-
2024
- 2024-05-29 CN CN202410675908.6A patent/CN118569233A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101183416B1 (en) | Method, system, and computer-readable medium for creating, inserting, and reusing document parts in an electronic document | |
Reid | Scribe: A document specification language and its compiler | |
US8332745B2 (en) | Electronic filing system and electronic filing method | |
JP2004086883A (en) | Word processing document stored in single xml file operated with application which understands xml | |
US20070067336A1 (en) | Electronic publishing system and method for managing publishing requirements in a neutral format | |
US20170364981A1 (en) | Brand-Based Product Management | |
Goldberg | XML: Visual quickstart guide | |
Klahold et al. | Computer aided writing | |
KR102296939B1 (en) | Managing apparatus and method of electronic documents like pdf files for multi-modes | |
CN118569233A (en) | Method and device for generating volume based on case elements | |
CN116050370A (en) | Template data processing method, system and related equipment | |
JP4934181B2 (en) | Additional image processing system, image forming apparatus, and additional image adding method | |
CN110457659B (en) | Clause document generation method and terminal equipment | |
Arnold | Multilingual research projects: Non-Latin script challenges for making use of standards, authority files, and character recognition | |
Arnold | Multilingual research projects: Challenges for making use of standards, authority files, and character recognition | |
KR100366657B1 (en) | Method of reverse-transforming print output image data to text data file and apparatus therefor | |
Eito-Brun | XML-based Content Management: Integration, Methodologies and Tools | |
Eaves et al. | Prototyping an Electronic Edition of William Blake’s Manuscript of Vala, or the Four Zoas: A Progress Report | |
JP2015022454A (en) | Method for producing electronic book | |
McGlone | Preserving and publishing digital content using XML workflows | |
Duda | XML models for legal documents: current polish practices and international standards | |
JP4111552B2 (en) | Automatic document marking apparatus and method | |
Thoden | Modeling scholarly publications for sustainable workflows | |
Wheeler et al. | TypeSense: Making sense of type on the computer | |
Frees et al. | Generating braille from Openoffice. org |
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 |