CN103530407B - Method and device for generating rich text document - Google Patents
Method and device for generating rich text document Download PDFInfo
- Publication number
- CN103530407B CN103530407B CN201310512295.6A CN201310512295A CN103530407B CN 103530407 B CN103530407 B CN 103530407B CN 201310512295 A CN201310512295 A CN 201310512295A CN 103530407 B CN103530407 B CN 103530407B
- Authority
- CN
- China
- Prior art keywords
- plaintext
- key element
- document
- sound code
- code file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
- G06F40/18—Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
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 invention discloses a method and device for generating a rich text document. The method includes the steps that a rule base is set up in advance and a plaintext sound code file corresponding to a document which is edited at the current moment by a user is acquired, wherein the plaintext sound code file carries the identification of an element to be inserted; if the identification of the element carried in the plaintext sound code file exists in the rule base, the content corresponding to the identification of the element is read from a database; according to the type of the element, a coding rule, corresponding to the type, defined in the rule base is utilized to code the read content to obtain a plaintext sound code corresponding to the read content; the coded plaintext sound code is inserted into the plaintext sound code file, and the coded plaintext sound code is combined into the plaintext sound code file to obtain the plaintext sound code file corresponding to the targeted rich text document. According to the technical scheme, accuracy, comprehensiveness and timeliness of acquired data can be guaranteed, and unification of the whole style of the document is kept to a certain degree.
Description
Technical field
The present invention relates to data base, document coding technical field, more particularly to a kind of generation method of rich text document
With device.
Background technology
In today of information-based high speed development, data has had become as the basis of industry-by-industry, how effectively to analyze number
According to, had become as enterprise or personal successfully key factor using data.For growing management class system, such as
The data collecting effectively is analyzed and is integrated by what, and carries out personalized displaying according to user's feature, ultimately forms
Abundant in content rich text document, it has also become enterprise and personal urgent regulatory requirement.
So-called rich text refers to the document containing contents such as font, paragraph format, picture, forms, such as word document,
Wps document etc..For giving an example, the report being such as widely used in enterprise is it is simply that one kind of rich text document is typical
Application, report is to reflect division management situations at different levels, discloses principal risk point, proposes the major way of managerial integration, is to obtain
The main channel of management data, is also that management level are managed decision-making, regulator is supervised, the master that investor is estimated
Will foundation.Therefore, all kinds of management reports become the basis of management layer-management, by the most attention of each enterprise.Nowadays, with letter
The foundation of breathization system and integration, the acquisition channel of data is more and more perfect, how preferably to the data come in system acquisition
Applied and analyzed, also become the emphasis of now management level concern, but at this stage, more report generations rely primarily on respectively
Level department is collected using manual, system queries, and the mode such as report form statistics is extracted, and then carries out integrating in write document and compiles
Write, then report the mode of authorities at different levels and carry out, due to using artificial collect and be artificially input in document by the way of, lead
Cause the data in report it is difficult to ensure that its accuracy, the style of the report ultimately forming it is difficult to ensure that unified, meanwhile, report complete
Face property, promptness also can be had a greatly reduced quality.
Content of the invention
For solving above-mentioned technical problem, the embodiment of the present invention provides a kind of generation method of rich text document and device, with
When solving to form rich text document in prior art, such as report, artificially collection information, write the document style leading to and do not unite
One, the technical problem that document information is comprehensive, verity, promptness cannot ensure.The present invention provides technical scheme as follows:
A kind of generation method of rich text document, comprising:
Pre-build rule base, defined in described rule base all be inserted in rich text document to be generated will
The mark of element and the coding rule for dissimilar key element;
Obtain the document corresponding plaintext sound code file of user current time editor, described plaintext sound code file carries to be inserted
Enter the mark of key element;
Judge that the mark of the key element carrying in described plaintext sound code file whether there is in described rule base, if existing,
The corresponding content of this element identification is read from data base;
According to the type of this key element, using coding rule corresponding with the type defined in rule base to described in reading
Research content, to obtain reading of content corresponding plaintext source code;
The plaintext source code that obtains of coding is inserted into obtain target rich text document in described plaintext sound code file corresponding
Plaintext sound code file, in order to form target rich text document by deriving this document.
The present invention also provides a kind of generating means of rich text document, comprising:
Rule sets up module, sets up rule base, all defined in described rule base is inserted into rich text to be generated
The mark of the key element in document and the coding rule for dissimilar key element;
Acquisition module, obtains the document corresponding plaintext sound code file of user current time editor, described plaintext source code literary composition
Part carries the mark being inserted into key element;
Judge module, for judge the mark of the key element carrying in described plaintext sound code file in described rule base whether
Exist;
Read module, for the mark of key element that carries in described plaintext sound code file in described rule base in the presence of,
The corresponding content of this element identification is read from data base;
Coding module, for the type according to this key element, using coding rule corresponding with the type defined in rule base
Then to the described research content reading, to obtain reading of content corresponding plaintext source code;
Composite module, the plaintext source code for obtaining coding is inserted in described plaintext sound code file and obtains the rich literary composition of target
This document corresponding plaintext sound code file, in order to form target rich text document by deriving this document.
The technical scheme being provided from technical scheme provided in an embodiment of the present invention above, the present invention and prior art phase
Than at least there is following advantage:
When needing to generate rich text document, if having, in document to be generated corresponding plaintext sound code file, the key element being inserted into
Mark, and this mark exists in the rule base of definition, then directly read the corresponding content of this element identification from data base,
Because required data is not that artificial collection is integrated, but directly read from background data base, due to background data base one
As can retain historical data, and real-time update, so directly read data from background data base to can ensure that the data getting
Accuracy, comprehensive and promptness.The coding rule for described element type after obtaining data, according to defined in rule base
Then the research content obtaining is plaintext source code, and the plaintext source code that obtains of coding is combined to the plaintext source code of document to be generated
In file, now generate is rich text document corresponding plaintext source code, and what user was seen immediately by documents editing software
It is to insert the document being inserted into key element corresponding content.Formed by systematic unity coding due to being inserted into content, without user certainly
Oneself is manually entered, and can keep the unification of document whole style to a certain extent.
Brief description
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
Have technology description in required use accompanying drawing be briefly described it should be apparent that, drawings in the following description be only this
Some embodiments described in invention, for those of ordinary skill in the art, can also obtain other according to these accompanying drawings
Accompanying drawing.
A kind of flow chart of the generation method embodiment 1 of rich text document that Fig. 1 provides for the present invention;
A kind of structural representation of the generating means embodiment 1 of rich text document that Fig. 2 provides for the present invention;
A kind of a kind of realization under practical application scene for the generating means of rich text document that Fig. 3 provides for the present invention;
Fig. 4 is the simplified schematic diagram of corresponding rule base when realizing under the application scenarios shown in Fig. 3.
Specific embodiment
In order that those skilled in the art more fully understand the technical scheme in the present invention, real below in conjunction with the present invention
Apply the accompanying drawing in example, the enforcement it is clear that described is clearly and completely described to the technical scheme in the embodiment of the present invention
Example is only a part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, this area is common
The every other embodiment that technical staff is obtained, all should belong to the scope of protection of the invention.
The present invention provides a kind of generation method of rich text document and device, can be used to generate rich text document, such as
Report, its core concept is, when inserting content in the document that user's current time is being edited, only need to will be inserted into content
The form being encoded to plaintext source code is inserted in plaintext sound code file, and by deriving plaintext sound code file, user can be seen that life
The rich text document becoming.Generation method to a kind of rich text document that the present invention provides, describes in detail below.
As shown in figure 1, a kind of flow chart of the generation method embodiment 1 of the rich text document providing for the present invention, this reality
Apply example specifically to may include steps of:
S101: set up rule base.
Described rule base specifically can define user when generating rich text document, and the key element that can insert wherein corresponds to
Mark, described key element refers to a specific text, form or picture, this mark can for the spcial character of definition or
The shortcut of person's definition.Such as, it is current season achievement table for key element, then the mark being directed to this key element can be: { } is (special
Character) or@+#(shortcut), as long as it is to be appreciated that the mark of the key element arranging here can ensure that this mark is uniquely i.e.
Can, can be not construed as limiting here according to specifically specifically being arranged using scene in actual applications.
In addition, also defining for the different types of coding rule being inserted into key element in rule base, factor kind here
Type refers to text, form or picture, because different types of key element corresponding coded format in the rich text document being formed
Different;Rich text document be user open in documents editing software go forward side by side edlin formed, for dissimilar (such as
Word or wps), the documents editing software of version (such as 2003 or 2007 version), different element type corresponding coding lattice
Formula is also different.After setting up rule base, as long as carrying out encoding according to its corresponding coded system for the content being inserted into
The documents editing software identification of the rich text document to be generated that is opened is opened.
S102: obtain the document corresponding plaintext sound code file of user current time editor.
In the prior art, user using documents editing software editing and generates one and has the contents such as form, picture more
During abundant document, universal mode is after user edits form or picture in third party software (such as visio), inserts
Enter in the document of user, but this mode remains the mode that user is manually entered, easily malfunction, and user is edited
Information carry out that real-time update is complex, need repeatedly to be manually entered new information.
Document corresponding plaintext sound code file therefore can be analyzed, this document may be considered the corresponding code of document
File, according to this document it is known that corresponding code format when the key element such as text data, form and picture shows in a document,
And create the coding rule for different element type (text data, form and picture) according to this code format, simultaneously in order to
Obtaining text data, list data and image data needs storage to be inserted into the corresponding mark of key element, and user uses different literary compositions
Shelves software for editing, it is different that it obtains the mode of the plaintext sound code file in current time for the rich text document to be generated.If using
The documents editing software that family uses provides the user online editing for word or wps it is preferred that then ntko control can be adopted
Interface, this control can call the copy editor's software installed in subscription client, support for user to work as pre-editing simultaneously
File be converted to plaintext sound code file and be submitted to backstage, the such as file of mht form, carry in this document and be inserted into key element
Mark, equally this mark is presented in plaintext source code.
It is to be appreciated that the document that described user in the present invention is editing not only refers to the blank not having any content
Document, can also be the document with certain content, and wherein, the content that the document has had can be user input
Word, the form of insertion or picture, on this basis, user continues to generate rich text document by the scheme that the present invention provides.
S103: judge that the mark of the key element carrying in described plaintext sound code file whether there is in described rule base, if
Exist, enter step s104.
When user edits document, according to the example in step s101, if the user while have input@in the document of editor
{ }, then get rich text document to be generated after the plaintext sound code file of current time, can search in rule base should
Mark, if there being@{ } in rule base, reads the corresponding content of this mark from background data base.
S104: read the corresponding content of this element identification from data base.
S105: according to the type of this key element, using coding rule corresponding with the type defined in rule base to reading
Described research content.
After obtaining data in step s104, this data content can not directly display in a document, needs to this content
Form enter edlin so that this content can for user currently used documents editing software identification, specifically, according to acquisition
Plaintext sound code file can determine type and the version of rich text document to be generated corresponding documents editing software, according to mark
Can determine that be inserted into is text, form or picture, then corresponding with version according to the documents editing software type determining
Element type coding rule, to obtain data encoded (form conversion).In order to make it easy to understand, with ms word being
Example introduces the coding that key element is form and picture for type, and when being inserted into data for list data, corresponding plaintext source code is such as
Under:
< table class=3dmsotable, grid border=3d1cellspacing=3d0cellpadding=3d0
style=3d'border-collapse:collapse;border:none;mso-border-alt:solid
windowtext.5pt;
mso-yfti-tbllook:480;mso-padding-alt:0cm5.4pt0cm
5.4pt;mso-border-insideh:
.5pt solid windowtext;mso-border-insidev:.5pt solid windowtext'>
<tr style=3d'mso-yfti-irow:0;mso-yfti-firstrow:yes'>
<td width=3d114valign=3dtop style=3d'width:85.2pt;border:solid
windowtext1.0pt;
mso-border-alt:solid windowtext.5pt;padding:0cm5.4pt0cm5.4pt'>
<p class=3dmsonormal><span lang=3den-us><o:p> </o:p></span></p>
</td>
</tr>... multiple lines and multiple rows are slightly
</table>
It should be noted that class=3dmsotablegrid is word generates the type attribute defining during mht file, with
When style attribute makes form open in a document jointly, the style consistent with document itself can be preserved.And in wps document
There is not 3dmsotablegrid object in middle source code, and the value of style definition also difference, so for two class source files
Need to process transformation respectively, and improved file, jointly can be opened by two kinds of softwares, interface difference is also limited only to two
Plant the difference of softwarecompatible effect.
Pictorial information, in mht file, has certain presence form, and through analysis, in file source code, one has seven parts
Being related to the content of picture, if there is picture in this file, only needing to add latter three related to picture itself
Part, if there is not picture in file, need by this seven partly supplement complete.Concrete seven part transformations are described as follows:
1) insert content-type attribute after mime-version:1.0
2) replace the entitled actual file name of contentlocation file below
3) replace: office:office
For: vml " xmlns:o=3d " urn:schemas-microsoft-com:office:office "
4)<... filelist.xml ">link rel added behind and style attribute information
5) under " body " label, add<p class=3dmsonormal>the information such as class and graphic attribute
6)</html>image content added behind, pictorial information is with the storage of base64 code, can according to picture to be inserted
To obtain its base64 code.
7) add file list information o:file href=3d " " after image content
S106: the plaintext source code that coding is obtained is inserted in the plaintext sound code file of described document to be generated.
After being inserted into the corresponding data of content and being encoded into plaintext source code, the source code of the formation after coding is inserted into
In the plaintext sound code file of the document, specifically, the source code that can obtain coding replaces key element in former plaintext sound code file
Mark, or be inserted at element identification (when user opens, in documents editing software, the rich text document ultimately generating, should
Mark can be hidden and not show), now, after the corresponding sound code file of document is renewal, include the content being inserted into
Source code, this plaintext sound code file is exported to user foreground and is opened the rich text document as generation by documents editing software.
User it is seen that the corresponding content of new sound code file in documents editing software, if insertion is form, then may be used by user
To see the form of insertion in documents editing software, that is, rich text document has generated.If the rich text literary composition now generating
Shelves are also not up to the final requirement of user, then can continue into content according to the method that the present embodiment provides.
The technical scheme that the present embodiment provides, when needing to generate rich text document, if the corresponding plaintext of document to be generated
There is the element identification being inserted in sound code file, and this mark exists in the rule base of definition, then directly from data base
Read the corresponding content of this element identification, because required data is not that artificial collection is integrated, but straight from background data base
Connect reading, because background data base typically can retain historical data, and real-time update, so directly reading from background data base
Data can ensure that the accuracy of the data getting, comprehensive and promptness;
After obtaining data, the content obtaining is compiled by the coding rule for described element type according to defined in rule base
Code is plaintext source code, and the plaintext source code that coding is obtained is combined in the plaintext sound code file of document to be generated, now generates
Be rich text document corresponding plaintext source code, and user passes through documents editing software immediately it is seen that inserting that be inserted into will
The document of plain corresponding content.Formed by systematic unity coding due to being inserted into content, be manually entered without user oneself, Ke Yi
Keep the unification of document whole style to a certain extent.
In embodiment 1, described it is inserted into being designated of content: the spcial character of definition or the shortcut of definition.And
The key element that user may insert is varied, and such as, being inserted into form has season achievement table, annual achievement table etc., if
By the way of user input (editor), user needs that memory is a lot of to be identified, especially using spcial character or shortcut as
During mark, memory capacitance is very big it has not been convenient to user uses for a user.For this reason, on the basis of embodiment 1, can
, in the form of menu, specifically, arranging menu on the software interface of editor's rich text document, to arrange not in this menu
With the title of key element, when user needs to insert content, this menu can be opened, drop-down list selects corresponding title.
This kind of mode, remembers mark without user, user-friendly.It should be noted that the content that described menu includes also may be used
To be element name and corresponding mark, specifically how to show the content in menu, do not limit here, at least include in menu
Different types of key element, for the ease of user operation, can also be corresponded to a menu by element name respectively, or one
The different types of key element of multi-section display in individual menu, specifically specifically can be arranged according to the practical application scene of user,
Here it is not specifically limited.
Corresponding to above method embodiment, the present invention also provides a kind of generating means of rich text document, with reference to Fig. 2 institute
Show, be the structural representation of described device embodiment 1, described device includes:
Rule sets up module 21, be used for setting up rule base, defined in described rule base all be inserted into be generated
The mark of the key element in rich text document and the coding rule for dissimilar key element;
Acquisition module 22, for obtaining the document corresponding plaintext sound code file of user current time editor, described plaintext
Sound code file carries the mark being inserted into key element;
Judge module 23, the mark for judging the key element carrying in described plaintext sound code file is in described rule base
No presence;
Read module 24, the mark of the key element for carrying in described plaintext sound code file exists in described rule base
When, read the corresponding content of this element identification from data base;
Coding module 25, for the type according to this key element, using coding corresponding with the type defined in rule base
The described research content to reading for the rule, with the plaintext sound code file form identical plaintext source code obtaining with receive;
Composite module 26, the plaintext source code for obtaining coding is inserted in described plaintext sound code file and obtains target richness
Text document corresponding plaintext sound code file, in order to form target rich text document by deriving this document.
Preferably, the generation method being inserted into element identification carrying in described plaintext sound code file can be: in user
Need to insert the position of key element, the mark being inserted into key element of display user input in the document of current time editor.
Or, the generation method being inserted into element identification carrying in described plaintext sound code file can be: works as in user
Newly-built menu on the application interface that the document of front moment editor is located, described menu at least includes energy in rich text document to be generated
Enough insert the title of key element;Select to be inserted into the corresponding title of key element from newly-built menu;The corresponding title of key element that will select
It is mapped as the corresponding mark of key element, and be shown in the position being inserted into key element.
Preferably, described composite module is replaced in described plaintext sound code file specifically for the plaintext source code obtaining coding
It is inserted into the mark of key element.
Or, described composite module is specifically for being inserted into the mark of key element described in being inserted into the plaintext source code that obtains of coding
Know the position in plaintext sound code file, the described mark being inserted into key element hides display.
For convenience of description, it is divided into various units to be respectively described with function when describing apparatus above.Certainly, implementing this
The function of each unit can be realized in same or multiple softwares and/or hardware during invention.
For the ease of the understanding to technical solution of the present invention, below with a kind of this programme possible application scenarios in practice
As a example illustrate, with reference to shown in Fig. 3, a kind of generation method of the rich text document providing for the present invention is in practical application scene
Under a kind of realization, the popularization using with computer, windows system is widely used so that most of user get used to
Carry out the generation write with document of document using word, therefore, in order to keep this custom, can adopt in actual applications
Ntko plug-in unit, provides the user online word editting function, if user uses word to generate a text, user only need to write
The basic framework of text, is needing to insert the place of form or picture, is inputting element identification, insert manually without user
Enter.And system server is deployed in the system of linux, unix server, the support to ms office document is very limited, in order to
User using linux, unix server system normally analyzes document, and dynamic insertion content is it is preferred that use mht
A kind of (mht is the abbreviation of mime html, is form for preserving html file) file as plaintext sound code file because
Mht file has following features:
First, this file format can be by a kind of control of ntko(office office software) support well, including
Preserve and open.Second, mht file type to be opened in the form of doc by document tool such as word, wps and can be edited.The
Three, mht file is the file of the plaintext of xml form, file can be processed as a very long character string, by dividing
The organizational form of plaintext source code, crucial tag format etc. in the file of analysis mht form, using source code as character string form, profit
The operation such as can position, replace, splitting, connecting with character string algorithm, according to the demand of the dynamic editor of edited document, to source code
Analysis and transformation, and ensure that the form of mht file is not damaged by, generate the document containing abundant content that can be opened by user.
For the analysis transformation of mht file, can be divided into and marker bit be identified replace, picture carried out with dynamic insertion, form is entered
The functions such as Mobile state generation, process complexity and substantially reduce.
As shown in figure 3, being corresponding document structure tree method under practical application scene, wherein, rule base is (with reference to shown in Fig. 4
Rule base simplified schematic diagram, be stored in system background, as each stage with reference to compare when inquiry use, be whole document generation machine
The java standard library of system, and can constantly enrich renewal.) it is divided into variable rule and document coding rule.Wherein, by variable rule identification
Variable (key element in the corresponding the above) content needing to replace or insert of user setup, from the corresponding industry of background query
Business data;By document coding rule analysis customer documentation itself, the version of positional editing document is msword, wps etc., provides
Produce form, the coding section of picture is quoted.Wherein variable rule base is different because of different practical business scenes, using front basis
Business and back-end data feature are safeguarded into storehouse, according to rulename(name variable or element identification) coupling user's typing change
Amount, according to contet(variable corresponding content) carry out the extraction of corresponding service data.Coding rule storehouse be by substantial amounts of word,
After the mht sample document analysis that wps preserves, the code source of unified warehouse-in accumulation, mainly as coupling Doctype, generate mht
The form of coding, picture use.Laterally divide according to category of software, longitudinally divide according to software version, such as word2007,
Word2010, wps2009, wps2012 etc..
Using ntko online document edit control, this control is supported word and wps software, can be called in user computer and pacify
The word processor of dress, supports custom menu simultaneously, the variable in variable rule base is supplied to user as menu, uses
Rules variables can be injected in suitable local click of typing text in family.Ntko supports, by the file of user's typing, to change simultaneously
For mht form, upload to system background.The mht file oss message that background analysis are collected, is carried out by coding rule storehouse
Join, be word or wps document when determining and generating mht formatted file, (the mht file that two class software tools generate, coded system
Different).The variable simultaneously comprising in discriminatory analysiss source file, obtains the demand of Insert service key element, form, picture etc..
According to the variable rule of analysis mht file acquisition, dynamically from system background query-relevant data, it is broadly divided into herein
Three class data, the first kind is the single argument such as text variable or statistic, after getting result, can be by referring to coding rule storehouse
Directly replace to dependent variable after coding.Equations of The Second Kind is list data, that is, key element to be replaced is bivariate table, at this moment first from system
Inquiry data list, then by compareing coding rule storehouse, generate the mht that mates with source document and encode, this coding with<table><
Tr><td>is form, row, cell are frame factor, in addition corresponding Style Attributes field.<table>label is integrally replaced
Change the position of source file form variable.3rd class is picture file, after being encoded by base64 after obtaining picture file, from rule
Call file header, tail coded samples in storehouse, be inserted into the position of document picture variable.The data inquiring is processed into by this module
Meet the form of mht coding style, after image data is inserted in source file, generating new file is derived.
The direct technology effect of the present embodiment is to provide a user with a kind of online editing, the document generation machine of flexible customization
System, user disposably edits, and system can generate timely document with dynamic queries up-to-date information.Specifically, maintain one first
Set rule base, variable reference when specification user edits, can constantly accumulate the resource of mht document process simultaneously, constantly compatible
Word, wps word processor of redaction.Next provides a kind of mode supporting the collection of user's online input system, Yong Huke
To carry out documents editing using familiar mode, the document after editor is consistent with the document format derived.System is to document
Analyzing and processing, be not limited to the affiliated platform of server, support the operating system such as windows, linux, unix, pure because of it
Text mode analysis, transformation mht file are it is not necessary to call the instruments such as com, dll.Finally, system derives is entirely word, wps literary composition
The document containing picture, form of shelves pattern, supports concurrent (can support that multiple users generate the scene of document simultaneously) simultaneously,
Dynamic generation.
Each embodiment in this specification is all described by the way of going forward one by one, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.Real especially for system
For applying example, because it is substantially similar to embodiment of the method, so describing fairly simple, referring to embodiment of the method in place of correlation
Part illustrate.The above is only the specific embodiment of the present invention, for those skilled in the art
For, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should regard
For protection scope of the present invention.
Claims (9)
1. a kind of generation method of rich text document is it is characterised in that pre-build rule base, institute defined in described rule base
There are mark and the coding rule for dissimilar key element of the key element being inserted in rich text document to be generated;
Methods described includes:
Obtain the document corresponding plaintext sound code file of user current time editor, described plaintext sound code file carries to be inserted into and wants
The mark of element;
Judge that the mark of the key element carrying in described plaintext sound code file whether there is in described rule base, if existing, from number
According to reading the corresponding content of this element identification in storehouse;
According to the type of this key element, using coding rule corresponding with the type defined in rule base to the described content reading
Coding, to obtain reading of content corresponding plaintext source code;
The plaintext source code that coding is obtained is inserted in described plaintext sound code file and obtains the corresponding plaintext of target rich text document
Sound code file, in order to form target rich text document by deriving this document;
Wherein, the generation method being inserted into element identification carrying in described plaintext sound code file includes:
Newly-built menu on the application interface that the document of user current time editor is located, described menu at least includes richness to be generated
It is inserted into the title of key element in text document;
Select to be inserted into the corresponding title of key element from newly-built menu;
Corresponding for the key element of selection title is mapped as the corresponding mark of key element, and is shown in the position being inserted into key element.
2. method according to claim 1 is it is characterised in that carry in described plaintext sound code file is inserted into key element mark
The generation method known includes:
Need to insert the position of key element, the mark being inserted into key element of display user input in the document of user current time editor
Know.
3. the method according to any one of claim 1-2 is it is characterised in that described be inserted into being designated of key element: definition
Spcial character or definition shortcut.
4. the method according to any one of claim 1-2 is it is characterised in that the plaintext source code obtaining coding is inserted into institute
State clearly in civilian sound code file and be:
The plaintext source code that coding is obtained replaces the mark being inserted into key element in described plaintext sound code file.
5. the method according to any one of claim 1-2 is it is characterised in that the plaintext source code obtaining coding is inserted into
In described plaintext sound code file it is:
By the plaintext source code that obtains of coding be inserted into described in be inserted into the mark of the key element position in plaintext sound code file.
6. a kind of generating means of rich text document are it is characterised in that described device includes:
Rule sets up module, sets up rule base, all defined in described rule base is inserted into rich text document to be generated
In the mark of key element and for dissimilar key element coding rule;
Acquisition module, obtains the document corresponding plaintext sound code file of user current time editor, and described plaintext sound code file is taken
Band is inserted into the mark of key element;
Judge module, whether the mark for judging the key element carrying in described plaintext sound code file deposits in described rule base
?;
Read module, for the mark of key element that carries in described plaintext sound code file in described rule base in the presence of, from number
According to reading the corresponding content of this element identification in storehouse;
Coding module, for the type according to this key element, using coding rule pair corresponding with the type defined in rule base
The described research content reading, to obtain reading of content corresponding plaintext source code;
Composite module, the plaintext source code for obtaining coding is inserted in described plaintext sound code file and obtains target rich text literary composition
The corresponding plaintext sound code file of shelves, in order to form target rich text document by deriving this document;
Wherein, the generation method being inserted into element identification carrying in described plaintext sound code file includes:
Newly-built menu on the application interface that the document of user current time editor is located, described menu at least includes richness to be generated
It is inserted into the title of key element in text document;
Select to be inserted into the corresponding title of key element from newly-built menu;
Corresponding for the key element of selection title is mapped as the corresponding mark of key element, and is shown in the position being inserted into key element.
7. device according to claim 6 is it is characterised in that carry in described plaintext sound code file is inserted into key element mark
The generation method known includes:
Need to insert the position of key element, the mark being inserted into key element of display user input in the document of user current time editor
Know.
8. the device according to any one of claim 6-7 is it is characterised in that described composite module is specifically for encoding
To plaintext source code replace and in described plaintext sound code file, be inserted into the mark of key element.
9. the device according to any one of claim 6-7 is it is characterised in that described composite module is specifically for encoding
To plaintext source code be inserted into described in be inserted into the position in plaintext sound code file for the mark of key element.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310512295.6A CN103530407B (en) | 2013-10-25 | 2013-10-25 | Method and device for generating rich text document |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310512295.6A CN103530407B (en) | 2013-10-25 | 2013-10-25 | Method and device for generating rich text document |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103530407A CN103530407A (en) | 2014-01-22 |
CN103530407B true CN103530407B (en) | 2017-01-25 |
Family
ID=49932416
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310512295.6A Active CN103530407B (en) | 2013-10-25 | 2013-10-25 | Method and device for generating rich text document |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103530407B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786471B (en) * | 2014-12-24 | 2019-04-26 | 珠海金山办公软件有限公司 | The processing method and system of object are inserted into document |
CN105468571B (en) * | 2015-11-19 | 2019-04-23 | 中国地质大学(武汉) | It is a kind of for automatically generating the method and device of report |
CN105446945B (en) * | 2015-12-01 | 2017-12-01 | 广东电网有限责任公司电网规划研究中心 | Word marks report-generating method |
CN107229626A (en) * | 2016-03-23 | 2017-10-03 | 阿里巴巴集团控股有限公司 | A kind of method and system for inserting and checking dynamic content |
CN106776510A (en) * | 2016-11-17 | 2017-05-31 | 金蝶软件(中国)有限公司 | Word embeds form generation method and device |
CN108874379B (en) * | 2017-05-10 | 2022-01-25 | 北京国双科技有限公司 | Page processing method and device |
CN109284492B (en) * | 2017-07-19 | 2023-08-25 | 北京国双科技有限公司 | Method and device for generating notification document |
CN110188326B (en) * | 2018-02-22 | 2023-08-11 | 深圳市萌蛋互动网络有限公司 | Rich text generating method, rich text generating device, computer equipment and storage medium |
CN113553812A (en) * | 2021-06-22 | 2021-10-26 | 北京来也网络科技有限公司 | News processing method and device combining RPA and AI |
CN114970487B (en) * | 2022-07-27 | 2023-01-06 | 中建电子商务有限责任公司 | Method for generating OFD electronic contract based on rich text |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7873668B2 (en) * | 2003-08-15 | 2011-01-18 | Laszlo Systems, Inc. | Application data binding |
CN1845099A (en) * | 2006-04-27 | 2006-10-11 | 掌富科技(南京)有限公司 | Method and structure for conversion and storage of multimedia electronic file in intelligent mobile terminal |
CN102799592B (en) * | 2011-05-26 | 2017-03-29 | 腾讯科技(深圳)有限公司 | The parsing method and system of rich text document |
CN102662928A (en) * | 2012-03-28 | 2012-09-12 | 福建榕基软件股份有限公司 | Rich text editing method for importing documents and device thereof |
-
2013
- 2013-10-25 CN CN201310512295.6A patent/CN103530407B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN103530407A (en) | 2014-01-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103530407B (en) | Method and device for generating rich text document | |
CN110333856B (en) | System and method for generating service programmable online template | |
CN102915237B (en) | The method and system of rewrite data quality rule is required according to user application | |
CN101937427B (en) | Browser-based system and method for content edition and issue | |
CN110543303B (en) | Visual service platform | |
CN101526942A (en) | Component implementation technology for automatically generating dynamic web page on line in real time | |
GB2373085A (en) | Method, computer program and system for style sheet generation. | |
CN102163223A (en) | Self-service query method and device thereof for background data | |
CN105701183A (en) | User personalized template implementation method and apparatus | |
US20070234201A1 (en) | Information Management Device | |
CN106339363A (en) | PPT report making method and device | |
JP2008234370A (en) | Document processor and document processing method | |
CN111309313A (en) | Method for quickly generating HTML (hypertext markup language) and storing form data | |
US20100169333A1 (en) | Document processor | |
CN104298705A (en) | Converting method of relational data and unstructured data | |
CN102521008A (en) | Program compiling device and method for compiling program | |
JPWO2005098660A1 (en) | Document processing apparatus and document processing method | |
JPWO2005098658A1 (en) | Document processing apparatus and document processing method | |
CN113538626A (en) | Workflow generation method and device | |
US8082496B1 (en) | Producing a set of operations from an output description | |
CN102411498A (en) | Method for realizing data model and graphical designer | |
JPWO2007052680A1 (en) | Document processing apparatus and document processing method | |
CN1973284A (en) | Document processing method and device | |
CN115906775A (en) | Digital standard compiling system | |
US7730105B2 (en) | Time sharing managing apparatus, document creating apparatus, document reading apparatus, time sharing managing method, document creating method, and document reading method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |