CN101872340A - Typesetting method and device based on format layout template - Google Patents

Typesetting method and device based on format layout template Download PDF

Info

Publication number
CN101872340A
CN101872340A CN200910082645A CN200910082645A CN101872340A CN 101872340 A CN101872340 A CN 101872340A CN 200910082645 A CN200910082645 A CN 200910082645A CN 200910082645 A CN200910082645 A CN 200910082645A CN 101872340 A CN101872340 A CN 101872340A
Authority
CN
China
Prior art keywords
style
information
file
descriptor
document
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
CN200910082645A
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.)
BEIJING FOUNDER E-GOVERNMENT INFORMATION TECHNOLOGY Co Ltd
Peking University
Peking University Founder Group Co Ltd
Original Assignee
BEIJING FOUNDER E-GOVERNMENT INFORMATION TECHNOLOGY Co Ltd
Peking University
Peking University Founder Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING FOUNDER E-GOVERNMENT INFORMATION TECHNOLOGY Co Ltd, Peking University, Peking University Founder Group Co Ltd filed Critical BEIJING FOUNDER E-GOVERNMENT INFORMATION TECHNOLOGY Co Ltd
Priority to CN200910082645A priority Critical patent/CN101872340A/en
Publication of CN101872340A publication Critical patent/CN101872340A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a typesetting method and a device based on a format layout template, solving the problem of low typesetting efficiency in the prior art. The method comprises the following steps: analyzing an official document style template file to obtain each piece of corresponding description information in the official document style template file, analyzing a file to be typeset to obtain metadata information, and inputting corresponding metadata according to a preset style in a style sub-file of the official document style template file cited in each piece of description information in an official document element style sub-file of the official document style template file, thereby obtaining a typeset file. With multiple preset templates, the embodiment of the invention ensures the template uniformity. Since each piece of description information in the templates adopts the preset style, the invention can effectively improve the typesetting efficiency. Moreover, the data and styles are processed separately, thereby avoiding mutual influence and constraints and improving the typesetting accuracy.

Description

A kind of composition method and device based on format layout template
Technical field
The present invention relates to the digital processing technology field, relate in particular to a kind of composition method and device based on format layout template.
Background technology
Page format is meant the set form that its space of a whole page of class style is had, it has different page formats for different types of style, for example for official document class style on it style of writing be a kind of page format, it is another kind of page format for the declaration form class style of insurance company.
At present, can adopt different templates based on different page formats, for example the style for the official document class can adopt a kind of style of writing template that goes up, declaration form for insurance company can adopt a kind of declaration form template, promptly all be based on different page formats and generate different templates, basically the fundamental in each page format is not extracted, do not set up corresponding model yet according to the fundamental that extracts.
And, in the prior art, when needs are set type at a kind of page format, can only carry out setting type again after concrete being provided with generates corresponding template according to this page format, when setting type at another page format, need at this page format corresponding template to be set again and set type again, therefore on template establishment, need to waste very big energy, and the template of creating does not have unitarity.And in same page format, have a plurality of different pieces in have identical call format, when when specifically carrying out being provided with of template, need corresponding form be set respectively at these a plurality of different parts, need pay the work of a lot of repeatability, thereby influence the efficient of setting type.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of composition method and device based on format layout template, in order to solve the inefficient problem of process of typeset in the prior art.
A kind of composition method based on format layout template that the embodiment of the invention provides comprises:
Obtain document to be set type, resolve each metadata information in the described document, and according to the official document pattern template file of selecting, resolve described official document pattern template file, obtain each descriptor of described official document pattern template file correspondence, wherein said official document pattern template file comprises: style son file and official document element style son file;
Each descriptor in described each metadata information and the described official document element style son file is mated;
When coupling is unsuccessful, the Template Error that the prompting user selects;
Otherwise, according to the style that sets in advance in the described style son file of quoting in described each descriptor described metadata information is poured into, generate the document after setting type.
A kind of composing device based on format layout template that the embodiment of the invention provides comprises:
Obtain parsing module, be used to obtain document to be set type, resolve each metadata information in the described document, and according to the official document pattern template file of selecting, resolve described official document pattern template file, obtain each descriptor of described official document pattern template file correspondence, wherein said official document pattern template file comprises: style son file and official document element style son file;
Matching module is used for each descriptor of described each metadata information and described official document element style son file is mated;
The composing reminding module, be used for when determining that coupling is unsuccessful, the Template Error that the prompting user selects is when determining that the match is successful, according to the style that sets in advance in the described style son file of quoting in described each descriptor described metadata information is poured into, generate the document after setting type.
The embodiment of the invention provides a kind of composition method and device based on format layout template, this method is by resolving official document pattern template file, obtain each descriptor parsing document to be set type corresponding in the official document pattern template file and obtain metadata information, when the match is successful, according to the style that sets in advance in the official document pattern template file Chinese style appearance file of quoting in each descriptor in the official document element style son file in the official document pattern template file metadata corresponding is poured into, generate the document after setting type, in embodiments of the present invention, owing to set in advance a plurality of templates, guaranteed the unitarity that each template is provided with, and each descriptor is quoted predefined pattern in the template, thereby can effectively improve the efficient of composing, simultaneously when setting type, data and pattern are handled respectively and have been avoided influence and restriction each other, have improved the accuracy of setting type.
Description of drawings
The structural representation of the composing system that Fig. 1 provides for the embodiment of the invention;
The concrete composing operation that the composing system structural drawing that provides according to this Fig. 1 that Fig. 2 provides for the embodiment of the invention carries out;
The page style synoptic diagram that Fig. 3 provides for the embodiment of the invention;
The font statement synoptic diagram that Fig. 4 provides for the embodiment of the invention;
The sentence style synoptic diagram that Fig. 5 provides for the embodiment of the invention;
Fig. 6 describes synoptic diagram for the paragraph style that the embodiment of the invention provides;
The literal table style synoptic diagram that Fig. 7 provides for the embodiment of the invention;
The cell style synoptic diagram that Fig. 8 provides for the embodiment of the invention;
The image object style synoptic diagram that Fig. 9 provides for the embodiment of the invention;
The Drawing Object style synoptic diagram that Figure 10 provides for the embodiment of the invention;
Paragragh descriptor synoptic diagram in the Drawing Object that Figure 11 provides for the embodiment of the invention;
The official document element style descriptor synoptic diagram that Figure 12 provides for the embodiment of the invention;
Page-describing information synoptic diagram in the official document element style that Figure 13 provides for the embodiment of the invention;
Page or leaf descriptor synoptic diagram in the official document element style that Figure 14 provides for the embodiment of the invention;
The descriptor synoptic diagram of the page or leaf descriptor mesophryon head that Figure 15 provides for the embodiment of the invention;
The process that document is set type that Figure 16 provides for the embodiment of the invention;
The synoptic diagram of every descriptor in the official document element style that Figure 17 provides for the embodiment of the invention in the eyebrow head of document, main body and the version note;
The composing device structural representation that Figure 18 provides for the embodiment of the invention based on format layout template.
Embodiment
The embodiment of the invention is in order to improve the efficient of setting type effectively, a kind of composition method based on format layout template is provided, this method comprises: obtain document data to be set type, resolve each metadata information in the described document data, and the official document pattern template file of parsing selection, obtain each descriptor of described official document pattern template file correspondence, wherein said official document pattern template file comprises: style son file and official document element style son file; Each corresponding in described each metadata information and described official document element style son file descriptor is mated; When coupling is unsuccessful, the Template Error that the prompting user selects; Otherwise, pour into according to the described metadata information of the style that sets in advance in the described style son file of quoting in described each descriptor correspondence, generate the document after setting type.In embodiments of the present invention, owing to set in advance a plurality of templates, guaranteed the unitarity that each template is provided with, and each style information is quoted predefined pattern in the template, thereby can effectively improve the efficient of composing, when setting type, data and pattern are handled respectively and have been avoided influence and restriction each other simultaneously, have improved the accuracy of setting type.
Below in conjunction with Figure of description, the embodiment of the invention is described in detail.
The structural representation of the composing system that Fig. 1 provides for the embodiment of the invention, wherein, typesetting engine can realize the composing to document, and pattern module management unit is used for according to various style format definition, and the various pattern design tools of preserving generate various pattern template files.Comprise in this pattern template file: style collected works file and official document element style son file etc., the pattern template file of generation can be extend markup language (Extensible Markup Language, XML) file of form.The data template administrative unit is used for according to the official document meta data definition, and the design data instrument of preserving parsing data file generation data template file to be set type, and the data template file of this generation can be the file of XML form.The rule template administrative unit is used for according to official document rule definition create-rule template file, and the rule template file of this generation can be the file of XML form.
Pattern template, data template and rule template manage respectively in embodiments of the present invention, thereby it is relatively independent each other, and the file after the composing that generates can be regarded as the combination of three class templates, promptly to the result who edits respectively and reuse of three class templates.
The concrete composing operation that Fig. 2 carries out for the composing system structural drawing that provides according to this Fig. 1, the process of this composing specifically comprises:
S201: read the official document pattern template file that the user selects in the pattern Template Manager unit, this official document pattern template file is the file of XML form, resolve this official document pattern template file and extract each descriptor in this official document pattern template file, generation pattern tree, wherein this pattern tree manifests with the XML form, and the pattern tree of this XML form is sent to for example typesetting engine of composing device.
Promptly this official document pattern template file is corresponding with this pattern tree, comprises in this pattern tree: style collected works tree, official document element style subtree etc.And, can also comprise the regular subtree of setting type in the pattern tree in embodiments of the present invention.
S202: the data template administrative unit reads the data file of user's input, resolve this data file and obtain each metadata information in the data file, the generator data tree, wherein this metadata tree manifests with the XML form, and the metadata tree of this XML form is sent to typesetting engine.
S203: typesetting engine is carried out the coupling of corresponding information according to metadata tree that receives and pattern tree.
S204: when the match is successful, typesetting engine was carried out the logic composing and is generated the mixing tree according to metadata tree that obtains and pattern tree.
S205: the mixing tree that typesetting engine is generated carries out the physics composing, and then generates bearing-age tree.
S206: the rule template administrative unit reads rule template file, typesetting engine is carried out automatic typesetting based on this rule template file that reads, when the composing of carrying out when the rule template file that reads based on this meets the demands, then generate the file after setting type, otherwise carry out S204 again, promptly mix the generation of tree.
Because each element all has different styles in the page format of different types of file, for example, form corresponding tables form sample, the corresponding paragraph style of literal section, figure corresponding diagram form sample, image correspondence image style or the like.Therefore in embodiments of the present invention, can in pattern Template Manager unit, preserve the style collection, style is concentrated can comprise multiple style again, wherein, this multiple style can be that the composing according to various documents requires to be provided with, and can give every kind of style a unique sign, and also all there is a unique sign each description unit and descriptor unit in every kind of style.For example in the invention process, comprise the style collection in the pattern Template Manager unit, this style is concentrated and is comprised page style, font statement, sentence style, paragraph style, literal table style, cell style, image object style and Drawing Object style etc., every kind of style all has a unique sign, and also all there is a unique sign each description unit and descriptor unit in every kind of style.
Introduce each description unit and descriptor unit that every kind of style comprises below in detail.
For the page style in the embodiment of the invention, its can description template in the style of page setup of each page, the configuration information etc. of the empty information in limit, paper information and the page number of the page has been described in this page style.As shown in Figure 3, can comprise in the page style: the empty description unit in limit, the paper description unit, the paper orientation description unit and the page number are provided with description unit etc.In the empty description unit in limit, can comprise empty descriptor unit, limit again to the four direction of the page, it can comprise the paper mold of paper for the paper description unit, the width of paper and highly wait the descriptor unit, be provided with in the description unit at the page number and comprise: the attribute description subelement of the page number with and the paragraph style information subelement quoted etc., wherein the attribute description subelement of the page number comprises: whether the page number shows the descriptor unit in homepage, the Base Serial Number subelement, digital format descriptor unit, apart from type page descriptor unit, the location expression subelement, alignment descriptor unit, prefix descriptor unit and suffix descriptor unit etc.
Font under in the statement of the font of the embodiment of the invention, can describing bunch, as shown in Figure 4, wherein this font statement comprises the font statement of Chinese words, the font statement of western language word, wherein every kind of font is stated corresponding different codings, Chinese font for example, the corresponding coding of No. four fonts of the Song typeface, the corresponding coding of No. 10 fonts in western language Rome etc.
The sentence style can be described font information, font information and the intercharacter pitch information etc. in the document sentence.The sentence style synoptic diagram that Fig. 5 provides for the embodiment of the invention, in this style, can comprise the font description unit, font description unit and character pitch description unit, for the font description unit its can be to the font of each literal, font size and color are provided with, when selecting different fonts, can use the form that specifically is provided with in the above-mentioned font statement, for example this font unit comprises: the western language font is quoted subelement, it quotes the font statement of western language font, Chinese font is quoted subelement, it quotes the font statement of Chinese font, sytlized font is quoted subelement, and it quotes the font statement of sytlized font.For example in a sentence, not only comprise Chinese font but also comprise the western language font, when the font to this sentence is described, can use corresponding font setting in the font statement.And this font description unit also comprises: the color description subelement of X font size descriptor unit, Y font size descriptor unit and font.It descriptor unit that comprises comprises for the font description subelement: italic, overstriking, underscore etc.When specifically being provided with of template, can carry out the setting of sentence style according to each description unit and the subelement of sentence style.
A plurality of sentences can constitute paragraph, also need style to paragraph with regard to line description in embodiments of the present invention.Fig. 6 describes synoptic diagram for the paragraph style of the embodiment of the invention, and its descriptor can comprise: the alignment thereof information of paragraph, line-spacing and intersegmental apart from information etc.For example can comprise in the paragraph style: alignment description unit, indentation description unit, line-spacing description unit and intersegmental apart from description unit etc.It can comprise again for the alignment description unit: horizontal alignment descriptor unit and vertical alignment descriptor unit intersegmentally can comprise again apart from description unit: before the section apart from descriptor unit and section back apart from the descriptor unit.When specifically being provided with of template, can be according to each description unit in this paragraph style and descriptor unit, thus realize the form of paragraph in the process of typeset is carried out concrete setting.
Formatting for the ease of the literal table that exists in the various civilian classes, also provide a kind of literal table style in embodiments of the present invention as shown in Figure 7, the descriptor in this literal table style can comprise: the output attribute information of the attribute information of literal table, adjustment information and literal table etc.For example the descriptor in this literal table style can comprise: the positional information of literal table, col width collection information, alignment thereof information, frame information, auto scaling information, adjust font information and output attribute information etc. automatically.It can select to be provided with to the size of col width for col width collection information, and the scope that confession is provided with the col width of selection can be set to 1 to infinitely great.In alignment information, can comprise: lateral alignment information and vertically to its information etc.Frame information can comprise the information in the sideline of four direction up and down, is description to the attribute in sideline for each sideline information, for example the unit in the live width in the type in sideline, sideline, sideline, color etc.For positional information its specifically can the descriptive text table position attribution, for example it can comprise: one or several in the X-axis of the coordinate information of the basic point positional information of literal table, the transverse axis X-axis of literal table, longitudinal axis Y-axis, width information, elevation information and the literal table of literal table, the Y-axis coordinate type information etc.
For also comprising cell in the various civilian classes, the pattern of cell also can be set in template in embodiments of the present invention, specifically can be provided with by the cell style.Wherein, can comprise the attribute information of cell in embodiments of the present invention in the cell style, as shown in Figure 8.The attribute information of this cell comprises: the attribute information of the frame information of cell, the high information of row, col width information, the empty information in limit, alignment thereof information and output etc., wherein, each attribute information can exist as a description unit in the cell style.When comprising the empty information in limit, during as description unit in the cell style, the empty description unit in this limit can comprise: empty descriptor unit, the limit of upper and lower, left and right four direction with the empty information in this limit.
In process of typeset, also need image object and/or Drawing Object are set type.In the style of image object, can select to be provided with according to various descriptors.The style of image object comprises: the positional information of image, alignment thereof information and attributes of images information etc.As shown in Figure 9, for example in the image object style, can comprise: the positional information of image object, alignment information, figure information and output attribute information etc., and every kind of information correspondence becomes a description unit, and each description unit can also be made up of several descriptors unit.For example can also comprise the file attribute descriptor unit that figure information is quoted in figure information description unit, and the coded system descriptor unit of figure information, this file attribute of quoting comprises filename, file type of file etc.In this image object style, can select the descriptor of one or more description unit correspondences arbitrarily, thus the template of composing images object.
From the Drawing Object style, select one or more descriptors, can form the template of Drawing Object, wherein can comprise the attribute information etc. of positional information, alignment thereof information and the figure of figure in the Drawing Object style.As shown in figure 10, for example in Drawing Object style descriptor, comprise: the positional information of Drawing Object, alignment information, graphical information and output attribute information etc.And graphical information is described the base attribute of Drawing Object, wherein in this graphical information, can comprise: the line information of figure, the coordinate information of key point, frame information, paragragh information, in the automatic adjustment font information of the auto scaling information of figure and figure one or more, the key point coordinate information has mainly been described the path that key point constitutes, thereby constitute whole figure, as shown in figure 11, comprise the font statement of literal term in the paragragh descriptor, and the style pattern quoted of literal style item, the pattern of the style that this is quoted comprises a style, the segmentation sample, and the font statement of literal etc.Because Drawing Object can be to comprise general figure, and text box, different Drawing Objects can select different description units and descriptor unit to be described.
Foregoing is the basic style that constitutes the template of the embodiment of the invention, every kind of style can have unique encoding in the invention process, and each description unit of its correspondence, descriptor unit also all have unique encoding, when the description unit of the correspondence in selecting different styles, subelement formation template, a coded message that only needs to preserve this style, unit, subelement gets final product.
Because type-setting document need show in each page, and may need the form of content displayed and demonstration all different in the different pages, therefore in order to adapt to the requirement of different page typesetting formats, in embodiments of the present invention, can carry out the setting of page architecture, and in every page, may comprise one or more elements, also can carry out one by one setting every kind of element.
Adopt official document element style storehouse that the setting of the page and page or leaf is described in embodiments of the present invention, as shown in figure 12, the content of each page-describing can be set in the page-describing unit, and the style of every kind of description, as shown in figure 13, its corresponding description unit in each single page, pair of pages and all pages for example can be set, and every kind of its style of quoting of description unit, for example in single page, elements such as textbox, form, figure, image can be set, and every element can be quoted corresponding style.
As shown in figure 14, because the page or leaf in the document generally comprises information such as header, footer, eyebrow head, main body and version note, and in every page, can comprise a series of element or element sets such as header, footer.For example, in every page, can position and other attributes of header, footer be described, and can the attribute of the eyebrow head in being presented at every page, main body, version note be described.Wherein, the attribute of eyebrow head comprises: the information that comprises at eyebrow stem branch, as shown in figure 15, for example the information that comprises of this eyebrow stem branch comprises: urgency level, textbox, form, issued organ's sign, documment number and the signed by of the umber sequence number of eyebrow head, the confidential of document and security deadline, document, red anti-line and figure or the like information.
Method for expressing for element comprises: with the method that element tags is represented, indicate the type of this element in attribute, and with the method that element type is represented, indicate the label of this element in attribute.Set for element can be represented with name set, uses the nested of name set in template, and/or is embodied the structure of the document of template description comprising of tag element.Descriptor with eyebrow head is an example, for example the descriptor of eyebrow head is the set of the element of the set of element of a plurality of tape labels and a plurality of belt types, for example " umber sequence number " uses the element representation of tape label, the type of this element is " text box " in attribute, perhaps also can use " text box ", show that in attribute the label of this element is " umber sequence number ".These two kinds of methods can be used alternately, thereby make the description of template more complete and extendible.
In embodiments of the present invention, can be according to all styles of that provides from above-mentioned style collection, the style of composing rule and official document element is selected, because all there is different codings each style and style description unit, descriptor unit, because the content of this selection can constitute template, and this template can be described with the nested form of document architecture tree.
When style information, Rule Information in the template are described, and after giving coding of every kind of descriptor, when concrete the composing, treating the document of composing resolves, obtain each descriptor of the document of waiting in the official document element style to set type, with each descriptor of the document of waiting in the official document element style of obtaining to set type according to rule and every kind of style of quoting in the template, this each descriptor is poured into, according to this rule and every kind of corresponding style this document to be set type is set type, thus the document after generation is set type.
Be the process of in embodiments of the present invention document being set type as shown in figure 16, this process specifically comprises:
S1601: when one piece of document is set type, need read the official document pattern template file of selection, resolve this official document pattern template file, wherein comprise set type regular son file, style son file and official document element style son file in this official document pattern template file, obtain the descriptor of each son file correspondence in this official document pattern template file.
Rule, style collection and the official document element style of setting type in embodiments of the present invention can adopt the XML structrual description, therefore this official document pattern template file also can adopt the XML structrual description, therefore must this official document pattern template can set up official document and manifest tree according to what resolve, this official document presents tree and comprises: the regular subtree of setting type, style collected works tree official document element style subtree.
S1602: when one piece of document is set type, also need this piece document is resolved,, resolve the metadata information that obtains the document according to the architectural feature of the document.
Because general document comprises at least one descriptor in header, footer, eyebrow head, main body and the version note information, therefore, when parse documents is obtained the data message of document, can from above-mentioned several descriptors, obtain, as shown in figure 17, be the synoptic diagram of every descriptor in the eyebrow head that obtains document in this official document element style, main body and the version note.Resolve the document and obtain metadata tree.
S1603: according to the descriptor in the official document pattern template file that resolve to obtain, and document in metadata information, setting type generates document after setting type.
To manifest tree and mix, generate bearing-age tree, thereby finish composing the document with data tree.
When setting type document after generate setting type in embodiments of the present invention, this method comprises:
According to the descriptor of resolving in the official document pattern template file that obtains, and the metadata corresponding information in the document, carry out logic and set type, generate data file.
This data file is carried out physics set type, generate the document after setting type.
In the process of carrying out the logic composing, because this composing rule, style collection and official document element style can adopt the form sign of XML, so this process mainly comprises:
The title of each descriptor in the official document element style son file is mated with the corresponding element data message of resolving in the document that obtains;
In official document element style son file, determine the descriptor that the match is successful, the style information of searching this descriptor correspondence in the style son file according to being identified at of this descriptor, with this metadata that the match is successful according to this style information combination to official document element style son file should the style of descriptor correspondence that the match is successful in.
Wherein, comprise that the architectural feature according to official document element style subtree generates the mixing tree.
For example, description unit in the official document element style son file is " confidential and a security deadline ", descriptor in the data file that obtains with parsing is mated, the descriptor that for example the match is successful is " top secret ", then under the node of this description unit " confidential and security deadline ", generate content node, and the value of this content node is " top secret ".Thereby realized the descriptor that the match is successful is combined in each description unit of official document element style son file.
According to the description unit " confidential and security deadline " in this official document element style son file, its corresponding style is " confidential and security deadline object type=' textbox ' style is quoted=' ID040961 ' ", according to this style reference identifier " ID040961 ", searching the style of this setting concentrates, the style information of this identifier correspondence, the style information that for example finds is " Drawing Object style title=' confidential and security deadline ' identifier=' ID040961 ' ", style information with this identifier correspondence, under the node of this description unit " confidential and security deadline ", generate the style node, and the value of this style node correspondence is " a Drawing Object style ".Will be in each description unit of official document element style son file thereby realize to the style information combination of descriptor correspondence.
In embodiments of the present invention, this data file is carried out physics set type, the process that generates the document after setting type comprises:
Set up page or leaf according to the page style information in the style son file of quoting in the official document element style son file, with the page or leaf set up as ground floor child node in the structure tree of the generation of setting type;
Strategy traversal according to depth-first is mixed tree, data message that will be to be set type according to the streaming composition method positions in the page, when in one page, not arranging, then set up new page or leaf, the new page or leaf set up as second layer child node, is set type in this page or leaf then, and data message that successively will be to be set type positions in every page, thereby determine the page or leaf at each data message place to be set type, promptly carry out physics and be current page or leaf;
Realize successively according to the composing rule, generate the document after setting type.
As shown in figure 18, the embodiment of the invention provides a kind of composing device, and this device comprises:
Obtain parsing module 1801, be used to obtain document to be set type, resolve each metadata information in the described document, and according to the official document pattern template file of selecting, resolve described official document pattern template file, obtain each descriptor of described official document pattern template file correspondence, wherein said official document pattern template file comprises: the regular son file of setting type, style son file and official document element style son file;
Matching module 1802 is used for each descriptor of described each metadata information and described official document element style son file is mated;
Composing reminding module 1803, be used for when determining that coupling is unsuccessful, the Template Error that the prompting user selects is when determining that the match is successful, according to the style that sets in advance in the described style son file of quoting in described each descriptor described metadata information is poured into, generate the document after setting type.
Described composing reminding module 1803 comprises:
Logic composing unit 18030 is used for the descriptor with described official document pattern template file, and the corresponding element data message in the document, carries out logic and sets type, and generates data file;
Physics composing unit 18033 is used for that described data file is carried out physics and sets type, and generates the document after setting type.
Described logic composing unit 18030 comprises:
Coupling subelement 18031 is used for the title with each descriptor of described official document pattern template file, and the metadata corresponding information in the document that obtains with parsing is mated;
Search combination subelement 18032, be used for determining the descriptor that the match is successful in official document element style son file, the style information of searching this descriptor correspondence in the style son file according to being identified at of this descriptor, with this metadata that the match is successful according to described style information combination to official document element style son file should the style of descriptor correspondence that the match is successful in.
Described physics composing unit 18033 comprises:
Page or leaf is set up subelement 18034, and the page style information in the style son file that is used for quoting according to official document element style son file is set up page or leaf;
Judgment sub-unit 18035 is used to judge the metadata information that whether can arrange down composing in the page or leaf of foundation;
Locator unit 18036, the metadata information that is used for setting type in this page is in described page or leaf location.
Described device also comprises:
Memory module 1800 is used for preserving one or more of page style information, font claim information, sentence style information, paragraph style information, literal table style information, cell style information, image object style information and Drawing Object style information.
Described composing reminding module 1803 also is used for,
According to the rule in the rule composing son file that reads, document after described metadata information poured into carries out automatic typesetting, judge whether the document after the automatic typesetting satisfies the requirement of described rule, when determining to carry out again when not satisfying pouring into of corresponding element data message, when determining to satisfy, generate the document after setting type.
The embodiment of the invention provides a kind of composition method and device based on format layout template, this method is by resolving official document pattern template file, obtain each descriptor parsing document to be set type corresponding in the official document pattern template file and obtain metadata information, when the match is successful, according to the style that sets in advance in the official document pattern template file Chinese style appearance file of quoting in each descriptor in the official document element style son file in the official document pattern template file metadata corresponding is poured into, generate the document after setting type, in embodiments of the present invention, owing to set in advance a plurality of templates, guaranteed the unitarity that each template is provided with, and each descriptor is quoted predefined pattern in the template, thereby can effectively improve the efficient of composing, simultaneously when setting type, data and pattern are handled respectively and have been avoided influence and restriction each other, have improved the accuracy of setting type.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (13)

1. the composition method based on format layout template is characterized in that, comprising:
Obtain document to be set type, resolve each metadata information in the described document, and the official document pattern template file of parsing selection, obtain each descriptor of described official document pattern template file correspondence, wherein said official document pattern template file comprises: style son file and official document element style son file;
Each corresponding in described each metadata information and described official document element style son file descriptor is mated;
When coupling is unsuccessful, the Template Error that the prompting user selects;
Otherwise, according to the style that sets in advance in the described style son file of quoting in described each descriptor, the described metadata information of correspondence is poured into, generate the document after setting type.
2. the method for claim 1 is characterized in that, described described metadata information with correspondence pours into, and the document that generates after setting type comprises:
With the descriptor in the described official document pattern template file, and the corresponding element data message in the document, carry out logic and set type, generate data file;
Described data file is carried out physics set type, generate the document after setting type.
3. method as claimed in claim 2 is characterized in that, the described logic of carrying out is set type and to be comprised:
With the title of each descriptor in the described official document pattern template file, the metadata corresponding information in the document that obtains with parsing is mated;
In official document element style son file, determine the descriptor that the match is successful, the style information of searching this descriptor correspondence in the style son file according to being identified at of this descriptor, with this metadata that the match is successful according to described style information combination to official document element style son file should the style of descriptor correspondence that the match is successful in.
4. method as claimed in claim 2 is characterized in that, the described physics that carries out is set type and to be comprised:
Set up page or leaf according to the page style information in the style son file of quoting in the official document element style son file, with metadata information location in described page or leaf of setting type;
When in one page, not arranging, set up second page, in described second page, the metadata information of setting type is located in described second page;
Successively each metadata information is positioned in every page.
5. the method for claim 1 is characterized in that, described style son file comprises:
In page style information, font claim information, sentence style information, paragraph style information, literal table style information, cell style information, image object style information and the Drawing Object style information one or more.
6. the method for claim 1 is characterized in that, described official document pattern template file also comprises: the rule composing son file.
7. method as claimed in claim 6 is characterized in that, described metadata information is poured into the described method in back further comprise:
Read the rule in the described rule composing son file, carry out automatic typesetting, judge whether the document after the automatic typesetting satisfies the requirement of described rule, carries out pouring into of corresponding element data message when not satisfying again, when satisfying, carries out subsequent step.
8. the composing device based on format layout template is characterized in that, this device comprises:
Obtain parsing module, be used to obtain document to be set type, resolve each metadata information in the described document, and according to the official document pattern template file of selecting, resolve described official document pattern template file, obtain each descriptor of described official document pattern template file correspondence, wherein said official document pattern template file comprises: the regular son file of setting type, style son file and official document element style son file;
Matching module is used for each descriptor of described each metadata information and described official document element style son file is mated;
The composing reminding module, be used for when determining that coupling is unsuccessful, the Template Error that the prompting user selects is when determining that the match is successful, according to the style that sets in advance in the described style son file of quoting in described each descriptor described metadata information is poured into, generate the document after setting type.
9. device as claimed in claim 8 is characterized in that, described composing reminding module comprises:
Logic composing unit is used for the descriptor with described official document pattern template file, and the corresponding element data message in the document, carries out logic and sets type, and generates data file;
Physics composing unit is used for that described data file is carried out physics and sets type, and generates the document after setting type.
10. device as claimed in claim 9 is characterized in that, described logic composing unit comprises:
The coupling subelement is used for the title with each descriptor of described official document pattern template file, and the metadata corresponding information in the document that obtains with parsing is mated;
Search the combination subelement, be used for determining the descriptor that the match is successful in official document element style son file, the style information of searching this descriptor correspondence in the style son file according to being identified at of this descriptor, with this metadata that the match is successful according to described style information combination to official document element style son file should the style of descriptor correspondence that the match is successful in.
11. device as claimed in claim 9 is characterized in that, described physics composing unit comprises:
Page or leaf is set up subelement, and the page style information in the style son file that is used for quoting according to official document element style son file is set up page or leaf;
Judgment sub-unit is used to judge the metadata information that whether can arrange down composing in the page or leaf of foundation;
The locator unit, the metadata information that is used for setting type in this page is in described page or leaf location.
12. device as claimed in claim 8 is characterized in that, described device also comprises:
Memory module is used for preserving one or more of page style information, font claim information, sentence style information, paragraph style information, literal table style information, cell style information, image object style information and Drawing Object style information.
13. device as claimed in claim 8 is characterized in that, described composing reminding module also is used for,
According to the rule in the rule composing son file that reads, document after described metadata information poured into carries out automatic typesetting, judge whether the document after the automatic typesetting satisfies the requirement of described rule, when determining to carry out again when not satisfying pouring into of corresponding element data message, when determining to satisfy, generate the document after setting type.
CN200910082645A 2009-04-23 2009-04-23 Typesetting method and device based on format layout template Pending CN101872340A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910082645A CN101872340A (en) 2009-04-23 2009-04-23 Typesetting method and device based on format layout template

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910082645A CN101872340A (en) 2009-04-23 2009-04-23 Typesetting method and device based on format layout template

Publications (1)

Publication Number Publication Date
CN101872340A true CN101872340A (en) 2010-10-27

Family

ID=42997206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910082645A Pending CN101872340A (en) 2009-04-23 2009-04-23 Typesetting method and device based on format layout template

Country Status (1)

Country Link
CN (1) CN101872340A (en)

Cited By (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663125A (en) * 2012-04-20 2012-09-12 李朋涛 Method and system for collecting microblog contents to make electronic document
CN102841888A (en) * 2012-09-14 2012-12-26 《中国学术期刊(光盘版)》电子杂志社 Rapid typesetting system and method
CN102841887A (en) * 2011-06-21 2012-12-26 北大方正集团有限公司 Method and device for typesetting variable data
CN103034624A (en) * 2011-09-29 2013-04-10 北京大学 Method and system for accurately positioning page object
CN103440231A (en) * 2013-09-02 2013-12-11 北京网秦天下科技有限公司 Equipment and method for comparing texts
CN103678268A (en) * 2012-09-19 2014-03-26 北京大学 Automatic typesetting method and device for official documents
CN104346319A (en) * 2013-08-05 2015-02-11 北大方正集团有限公司 Method and system for inspecting document style
CN104462045A (en) * 2014-12-15 2015-03-25 北京信息科技大学 Method and device for processing documents
CN104765721A (en) * 2014-01-06 2015-07-08 北大方正集团有限公司 Makeup handling method and device
CN105183706A (en) * 2014-05-27 2015-12-23 腾讯科技(北京)有限公司 Method and device for processing rich text
CN105279144A (en) * 2015-10-10 2016-01-27 中国空气动力研究与发展中心高速空气动力研究所 Method and device for typesetting wind tunnel test data text files
CN105701073A (en) * 2015-12-31 2016-06-22 北京中科江南信息技术股份有限公司 Layout file generation method and device
CN106250359A (en) * 2015-06-15 2016-12-21 中国石油化工股份有限公司 A kind of system and method for layout oil and gas reserves dependent vector figure
CN106408266A (en) * 2016-09-29 2017-02-15 广州鹤互联网科技有限公司 Automatic generating method and apparatus for documents to be reviewed and signed
CN108241642A (en) * 2016-12-23 2018-07-03 北京国双科技有限公司 Document analysis method and apparatus
CN108319579A (en) * 2017-01-18 2018-07-24 北大方正集团有限公司 The composition method and composing device of XML structure data
CN108984498A (en) * 2017-06-05 2018-12-11 北大方正集团有限公司 The typesetting processing method and device of document
CN110096684A (en) * 2019-04-10 2019-08-06 沈阳哲航信息科技有限公司 A kind of document specification intelligence inspection system and method based on template
CN110109838A (en) * 2019-05-08 2019-08-09 北京信息科技大学 A kind of test method and device of office documents typesetting style
CN110362805A (en) * 2018-04-09 2019-10-22 成都野望数码科技有限公司 A kind of method, apparatus and terminal device of content typesetting recommendation
CN110413954A (en) * 2019-07-29 2019-11-05 北京北大软件工程股份有限公司 Standard file printout method for previewing, device, equipment and storage medium
CN110738035A (en) * 2019-09-18 2020-01-31 平安科技(深圳)有限公司 document template generation method and device
CN110852052A (en) * 2019-10-17 2020-02-28 北京奇艺世纪科技有限公司 Book typesetting method and device
CN110969004A (en) * 2019-12-16 2020-04-07 方正株式(武汉)科技开发有限公司 Automatic typesetting method and system for image and text, server and medium
CN111368523A (en) * 2018-12-26 2020-07-03 嘉太科技(北京)有限公司 Method and device for converting layout format of movie and television script
CN112417834A (en) * 2019-08-23 2021-02-26 珠海金山办公软件有限公司 Document processing method and device and electronic equipment
CN112668299A (en) * 2021-01-26 2021-04-16 广西安怡臣信息技术有限公司 Automatic typesetting method and system for referee document
CN113221506A (en) * 2021-05-14 2021-08-06 北京有竹居网络技术有限公司 Lecture typesetting method and device, electronic equipment and storage medium
CN113378524A (en) * 2021-06-07 2021-09-10 北京百度网讯科技有限公司 Method, device, equipment and storage medium for updating storage information of document
CN113569530A (en) * 2021-07-29 2021-10-29 北京法意科技有限公司 Intelligent document typesetting method and system

Cited By (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102841887A (en) * 2011-06-21 2012-12-26 北大方正集团有限公司 Method and device for typesetting variable data
CN103034624A (en) * 2011-09-29 2013-04-10 北京大学 Method and system for accurately positioning page object
CN103034624B (en) * 2011-09-29 2015-12-16 北京大学 A kind of accurate positioning method of page object and system
CN102663125A (en) * 2012-04-20 2012-09-12 李朋涛 Method and system for collecting microblog contents to make electronic document
CN102663125B (en) * 2012-04-20 2014-09-17 李朋涛 Method and system for collecting microblog contents to make electronic document
CN102841888B (en) * 2012-09-14 2015-10-14 《中国学术期刊(光盘版)》电子杂志社有限公司 A kind of composing system and method fast
CN102841888A (en) * 2012-09-14 2012-12-26 《中国学术期刊(光盘版)》电子杂志社 Rapid typesetting system and method
CN103678268A (en) * 2012-09-19 2014-03-26 北京大学 Automatic typesetting method and device for official documents
CN103678268B (en) * 2012-09-19 2016-08-31 北京大学 Official document automatic composing method and device
CN104346319A (en) * 2013-08-05 2015-02-11 北大方正集团有限公司 Method and system for inspecting document style
CN104346319B (en) * 2013-08-05 2017-04-26 北大方正集团有限公司 Method and system for inspecting document style
CN103440231A (en) * 2013-09-02 2013-12-11 北京网秦天下科技有限公司 Equipment and method for comparing texts
CN104765721A (en) * 2014-01-06 2015-07-08 北大方正集团有限公司 Makeup handling method and device
CN105183706A (en) * 2014-05-27 2015-12-23 腾讯科技(北京)有限公司 Method and device for processing rich text
CN104462045B (en) * 2014-12-15 2017-11-03 北京信息科技大学 A kind of document processing method and device
CN104462045A (en) * 2014-12-15 2015-03-25 北京信息科技大学 Method and device for processing documents
CN106250359A (en) * 2015-06-15 2016-12-21 中国石油化工股份有限公司 A kind of system and method for layout oil and gas reserves dependent vector figure
CN105279144B (en) * 2015-10-10 2018-08-28 中国空气动力研究与发展中心高速空气动力研究所 A kind of composition method and device of wind tunnel test data text file
CN105279144A (en) * 2015-10-10 2016-01-27 中国空气动力研究与发展中心高速空气动力研究所 Method and device for typesetting wind tunnel test data text files
CN105701073A (en) * 2015-12-31 2016-06-22 北京中科江南信息技术股份有限公司 Layout file generation method and device
CN106408266A (en) * 2016-09-29 2017-02-15 广州鹤互联网科技有限公司 Automatic generating method and apparatus for documents to be reviewed and signed
CN108241642A (en) * 2016-12-23 2018-07-03 北京国双科技有限公司 Document analysis method and apparatus
CN108241642B (en) * 2016-12-23 2021-03-30 北京国双科技有限公司 File analysis method and device
CN108319579B (en) * 2017-01-18 2020-12-04 北大方正集团有限公司 Typesetting method and typesetting device for XML (extensive markup language) structured data
CN108319579A (en) * 2017-01-18 2018-07-24 北大方正集团有限公司 The composition method and composing device of XML structure data
CN108984498A (en) * 2017-06-05 2018-12-11 北大方正集团有限公司 The typesetting processing method and device of document
CN110362805A (en) * 2018-04-09 2019-10-22 成都野望数码科技有限公司 A kind of method, apparatus and terminal device of content typesetting recommendation
CN110362805B (en) * 2018-04-09 2023-10-27 成都野望数码科技有限公司 Content typesetting recommendation method and device and terminal equipment
CN111368523A (en) * 2018-12-26 2020-07-03 嘉太科技(北京)有限公司 Method and device for converting layout format of movie and television script
CN110096684A (en) * 2019-04-10 2019-08-06 沈阳哲航信息科技有限公司 A kind of document specification intelligence inspection system and method based on template
CN110109838A (en) * 2019-05-08 2019-08-09 北京信息科技大学 A kind of test method and device of office documents typesetting style
CN110109838B (en) * 2019-05-08 2023-03-21 北京信息科技大学 Method and device for testing office document typesetting style
CN110413954A (en) * 2019-07-29 2019-11-05 北京北大软件工程股份有限公司 Standard file printout method for previewing, device, equipment and storage medium
CN110413954B (en) * 2019-07-29 2023-08-04 北京北大软件工程股份有限公司 Method, device, equipment and storage medium for previewing standard file printing
CN112417834A (en) * 2019-08-23 2021-02-26 珠海金山办公软件有限公司 Document processing method and device and electronic equipment
CN110738035A (en) * 2019-09-18 2020-01-31 平安科技(深圳)有限公司 document template generation method and device
CN110852052A (en) * 2019-10-17 2020-02-28 北京奇艺世纪科技有限公司 Book typesetting method and device
CN110969004A (en) * 2019-12-16 2020-04-07 方正株式(武汉)科技开发有限公司 Automatic typesetting method and system for image and text, server and medium
CN110969004B (en) * 2019-12-16 2023-06-13 方正株式(武汉)科技开发有限公司 Automatic typesetting method and system for graphics context, server and medium
CN112668299A (en) * 2021-01-26 2021-04-16 广西安怡臣信息技术有限公司 Automatic typesetting method and system for referee document
CN113221506A (en) * 2021-05-14 2021-08-06 北京有竹居网络技术有限公司 Lecture typesetting method and device, electronic equipment and storage medium
CN113378524A (en) * 2021-06-07 2021-09-10 北京百度网讯科技有限公司 Method, device, equipment and storage medium for updating storage information of document
CN113569530A (en) * 2021-07-29 2021-10-29 北京法意科技有限公司 Intelligent document typesetting method and system

Similar Documents

Publication Publication Date Title
CN101872340A (en) Typesetting method and device based on format layout template
US7984076B2 (en) Document processing apparatus, document processing method, document processing program and recording medium
CN104346319B (en) Method and system for inspecting document style
CN101989256B (en) Typesetting method of document file and device
JP4343213B2 (en) Document processing apparatus and document processing method
CN105159877B (en) A kind of across media automatic typesetting systems and its method
CN102779118B (en) Paper typesetting method and system
CN111507073A (en) Thesis editing and intelligent typesetting method and platform based on web rich text
CN102043762B (en) Method and device for comparing layouts
US8386943B2 (en) Method for query based on layout information
CN110704570A (en) Continuous page layout document structured information extraction method
CN103268340A (en) Format reflowable file establishing and drawing method based on hierarchical index
US20070150494A1 (en) Method for transformation of an extensible markup language vocabulary to a generic document structure format
CN102103574B (en) Method and system for formatting output of book sample file content
CN110688825A (en) Method for extracting information of table containing lines in layout document
US9286272B2 (en) Method for transformation of an extensible markup language vocabulary to a generic document structure format
CN107704440A (en) A kind of method for extracting XML file needed for the generation of database data automatic batch
CN105468577A (en) Document splitting method and system
CN105740355A (en) Aggregated text density based webpage body text extraction method and apparatus
CN101996190B (en) Method and device for extracting information from webpage
CN107301180A (en) The analysis method and device of a kind of file structure
CN111126007B (en) HTM L-based medical record document paging algorithm
CN111079385A (en) Method and device for converting scientific formula format
CN107967243A (en) A kind of processing method for supporting that user independently makes pauses in reading unpunctuated ancient writings
US11842141B2 (en) Device dependent rendering of PDF content

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20101027