CN101989256A - Typesetting method of document file and device - Google Patents

Typesetting method of document file and device Download PDF

Info

Publication number
CN101989256A
CN101989256A CN2009100901952A CN200910090195A CN101989256A CN 101989256 A CN101989256 A CN 101989256A CN 2009100901952 A CN2009100901952 A CN 2009100901952A CN 200910090195 A CN200910090195 A CN 200910090195A CN 101989256 A CN101989256 A CN 101989256A
Authority
CN
China
Prior art keywords
document
style
file
content
key element
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.)
Granted
Application number
CN2009100901952A
Other languages
Chinese (zh)
Other versions
CN101989256B (en
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 Electronics Chief Information Technology Co ltd
New Founder Holdings Development Co ltd
Peking University
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 CN2009100901952A priority Critical patent/CN101989256B/en
Publication of CN101989256A publication Critical patent/CN101989256A/en
Application granted granted Critical
Publication of CN101989256B publication Critical patent/CN101989256B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a typesetting method of a document file and a device for solving the problems that the typesetting process in the prior art needs many labors, the efficiency is low and the typesetting software is difficult to operate. The method comprises the following steps of: analyzing and obtaining corresponding document regulated sub-files, document type sub-files and document factor type sub-files by a typesetting device according to a document template file input by users; analyzing and obtaining each factor content in the document file according to the document file induced by the users; matching each factor content with factor attributes in the document factor type sub-files, transmitting the successful matched factor contents to displaying objects corresponding to the factor attributes; and typesetting the factor contents in the displaying objects according to the types in the document type sub-files and the rules in the document regulated sub-files, wherein the types and the rules are utilized by the displaying objects. The technical scheme typesets the factor contents in the displaying objects according to the rules and the types utilized by the displaying objects, thereby improving the typesetting efficiency.

Description

A kind of composition method of document file and device
Technical field
The present invention relates to the digital processing technology field, relate in particular to a kind of composition method and device of document file.
Background technology
Process of typeset is the process that text is converted into the document file, text is meant text data, it pays attention to the inherent meaning of letter character, do not pass through editing and composing, and the document file refers to the text of tape format, be generally government offices, enterprises and institutions, organization and individual is in social activities, the written material that forms and use for certain purpose with specific format, it has stronger standardization, pay attention to the form of expression of literal, need be to character, paragraph and page formatting are carried out editing and composing, and can there be figure, element such as form and image, for example report, letter, notice, meeting summary and telegram etc. all belong to the document file.
The software for composing that often adopts in the prior art comprises two types, and a class is the batch processing software for composing, and another kind of is interactive typesetting software.Wherein, the batch processing software for composing is also referred to as " note formula " software for composing, when adopting this software for composing, need in text data, add special-purpose order, row's method and requirement in order to the explanation space of a whole page, the order of this special use comprises: the position of the font of literal, the size of font size, title and type page size etc., the text that this centre adds specific command is also referred to as the sample file.When moving this batch processing software for composing, need be to the syntax check of sample file, and generate the destination file that is used to export or be called the full-page proof file, can see the composing result of simulation by the computer screen sense.Adopt this batch processing software for composing composing efficient height, the precision height, but this software for composing is difficult for study, and personnel have higher requirement to composing, are not suitable for document, books and the publication etc. of format complexity.
Another kind of is interactive typesetting software, can directly on computer screen, show the document file, the composing personnel are by handling keyboard and mouse, can directly on screen, revise contents such as literal, figure, image and form, can also adjust the form of expression of content intuitively, every operation can be seen corresponding result on screen.Interactive typesetting software needs more artificial adjustment in process of typeset, efficient is lower, and degree of accuracy is lower.
In the process of setting type, can directly adopt software for composing to set type, also the mode that can adopt software for composing to combine with base management system is set type, but, cause also existing in the process of typeset more corresponding problems because there are some problems in software for composing itself.Owing to the form difference of the document file that obtains based on different softwares for composing, make that the document file can not be directly general mutually between different softwares for composing simultaneously.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of composition method and device of document file, needs more artificial participation in order to solve in the prior art process of typeset, the low and difficult problem of operating of software for composing of efficient.
The composition method of a kind of document file that the embodiment of the invention provides comprises:
Composing device is resolved the document rule son file, document style son file and the document key element style son file that obtain this document template file correspondence according to the instrument template file of user's input;
The text that composing device imports according to the user is resolved each factor content that is comprised in the acquisition text file;
Composing device mates the key element attribute in each factor content and the document key element style son file, the factors of success that will be complementary content is passed to the object that manifests of key element attribute correspondence, manifest style in the document style son file that object adopts and the rule in the document rule son file according to this, this factor content that manifests in the object is set type.
The composing device of a kind of document file that the embodiment of the invention provides comprises:
First parsing module is used for the instrument template file according to user's input, resolves the document rule son file, document style son file and the document key element style son file that obtain this document template file correspondence;
Second parsing module is used for the text according to user's importing, resolves each factor content that is comprised in the acquisition text file;
Send type-setting module, be used for the key element attribute of each factor content and document key element style son file is mated, the factors of success that will be complementary content is passed to the object that manifests of key element attribute correspondence, manifest style in the document style son file that object adopts and the rule in the document rule son file according to this, this factor content that manifests in the object is set type.
The embodiment of the invention provides a kind of composition method and device of document file, and this method comprises: composing device is resolved document rule son file, document style son file and the document key element style son file that obtains instrument template file correspondence; According to the text that the user imports, resolve each factor content that is comprised in the acquisition text file; Composing device mates the key element attribute in each factor content and the document key element style son file, the factors of success that will be complementary content is passed to the object that manifests of key element attribute correspondence, manifest rule and the style that object adopts according to this, this factor content that manifests in the object is set type, combine with database by the instrument template file, realization is extracted text data and is carried out automatic typesetting from database, thereby improves the efficient of setting type; Can also be written back in the database seamless connection of fulfillment database and composing device to key element in the document file and factor content derivation in addition.
Description of drawings
The composition method implementation process of the document file that Fig. 1 provides for the embodiment of the invention;
The carrying out that Fig. 2 provides for the embodiment of the invention page by page, the process of successively display object being set type;
The process that the document file is carried out redjustment and modification that Fig. 3 provides for the embodiment of the invention;
The implementation process that text box is set type that Fig. 4 provides for the embodiment of the invention;
The composing device structural representation of the document file that Fig. 5 provides for the embodiment of the invention.
Embodiment
The embodiment of the invention is in order to improve the composing efficient of document file effectively, a kind of composition method of high-quality document file simple to operate is provided, this method comprises: composing device is according to the instrument template file of user's input, resolve the instrument template file, obtain document rule son file, document style son file and document key element style son file; The text that composing device imports according to the user according to content structure information, is resolved each key element and the factor content that are comprised in the acquisition text; Composing device will be resolved the key element attribute that each factor content of obtaining and document manifest object and be mated, the factor content that will be complementary pass to coupling key element attribute correspondence manifest object, manifest style in the document style son file that object uses and the rule in the document rule son file according to this, the factor content that manifests in the object is set type.In the embodiment of the invention, combine with the database organic phase by the instrument template file, data message is extracted in realization from Database Systems, be transferred to the composing transposition, can carry out batch, automatic typesetting, and can be by composing transposition derived data information, Database Systems are given in passback, carry out the write-back and the renewal of data.
In embodiments of the present invention, template file has been determined the form of whole document; By the key element style in the template, what make up document manifests object and page object, manifests object and comprises objects such as text, figure, image and form; Manifest the information such as composing style, composing rule and document key element that object also comprises use, promptly manifest object and have semantic information; Page object can contain the page number, is the page info of document.The content of text file is structurized.
The key element content sent to manifest object,, successively the object that manifests in the document is formatd, in the page, adjust then, discharge to replace or to increase the content that manifests object; When format manifests object, use its style information, adjusting, when discharging manifests object, use its rule and style information.
In the embodiment of the invention, the instrument template file is extend markup language (Extensible MarkupLanguage, XML, XML) file, and, resolve document rule son file, document style son file and the document key element style son file that obtains by this document template file.
Below in conjunction with Figure of description, the embodiment of the invention is elaborated.
The composition method of a kind of document file that Fig. 1 provides for the embodiment of the invention, this method specifically may further comprise the steps:
S101: composing device is resolved the document rule son file, document style son file and the document key element style son file that obtain this document template file correspondence according to the instrument template file of user's input.
Wherein, this document template file is extend markup language (Extensible Markup Language, XML, XML) file, and, comprise by this document template file: document rule son file, document style son file and document key element style son file, and document rule son file, document style son file and document key element style son file all are the XML file.
Specifically comprise: resolve document rule son file, document style son file and document key element style son file respectively, that sets up the composing rule objects that defines in the instrument template, style object, document manifests object and page object.The object that manifests of document comprises visual elements such as literal object, Drawing Object, image object and table objects, and they represent the content and the form of document.Page object is the page structure of document, can comprise information such as the page number, header and footer in the page structure, and to after manifesting object and carry out the pageization, what also comprise this page in the page object and discharged manifests object.
In the embodiment of the invention, the content of this document rule son file comprises: the element that the document format rule constitutes, this document format rule can have, can not have yet, the document format code requirement that depends on tissue or mechanism, this document format rule comprises: key element page displayed rule, the rule of binding between key element, key element is printed rule etc., and for example: the dispatch sign is made regulation rule, official seal and other key element same page by oneself and tied up rule etc.Each regular function can be described by explanatory note, and composing device has been realized the framework of rule invocation, and the specific implementation module of rule needs exploitation separately, adds composing device to by the mode of expansion plugin.In embodiments of the present invention in this document rule son file, the corresponding identifier of each rule, be used to be different from other rule, and each rule comprises this regular function text description and parameter of regularity, the function of coming implementation rule by concrete regular card module.In concrete process of typeset when adopting that wherein certain is regular, can directly adopt this rule corresponding identifier, composing device finds corresponding rule according to regular corresponding identifier, find the regular plug-in unit expansion module of this rule correspondence again, adopt this rule plug-in unit expansion module to manifest object adjustment being correlated with.
Document style son file is the style collection of the various form objects that occur in the document file, and wherein the content of this document style son file comprises: the page, font statement, literal, paragraph, text box, figure, image and styles such as cell and form.Each style all has a unique identifier, can identify a style with an identifier.And, in embodiments of the present invention, adopt the mode that certain style should contain attribute to define this kind style, be that each style comprises definite attribute of a configuration, for example: the text box style is described the regional text formatting of document, and text frame sample comprises: the attributes of a configuration such as literal, paragraph, position, size, alignment thereof, line style and color.The XML label that the different attribute of a configuration that each style comprises is also corresponding different respectively promptly identifies the attribute of a configuration that comprises in the style by the XML label.Resolve document style son file, make up the style of definition.In the process of setting type, can directly quote the style corresponding identifier, same style corresponding identifier can repeatedly be cited, and composing device finds the definition of this style according to the style corresponding identifier, is formatd by the definition of this style attribute of a configuration to relevant factor.
Content in the document key element style son file comprise the document file page info, manifest object type (as literal, figure, image etc.), manifest object and use style and manifest information such as object service regeulations, also can comprise the content information that specifically manifests object.The document file generally is divided into three parts such as eyebrow head, main body and version note, and every part comprises some document key elements again, and for example: eyebrow stem branch may comprise: key elements such as confidential and security deadline, issued organ, signed by or the like.The key element that document comprises is extendible, can be determined by the document format demand of tissue, mechanism.Document key element style son file mainly is to needing the form of content to be described in the document file, realize by style and the rule of using, for example, " confidential and security deadline " that the eyebrow stem is divided will use a certain text box style, therefore, " confidential and the security deadline " that this eyebrow stem is divided just quoted the unique identifier of text frame sample, and the mode that rule is used is identical with the mode that style is used.When resolving document key element style son file, the content object types structure that manifests by each key element style manifests object (manifesting object as text, figure, image and form etc.), this key element is the document key element that manifests the object correspondence, the style identifier that the key element style is quoted is exactly to manifest the style corresponding identifier that object adopts, and the rule identifier that the key element style is quoted is exactly to manifest the regular corresponding identifier that object adopts.
S102: composing device is according to the text of user's guiding structureization, the content structure of identification text file, and according to the content structure of text file, resolve each key element and the factor content that are comprised in the acquisition text, wherein, the structured message of text can be self-defined, and can expand.
Specifically comprise: the content structure of composing device identification text file, wherein, the content structure of text file mainly comprises: the eyebrow head of text file, main body and version note, because the eyebrow head of text, main body and version note all can comprise certain content, for example eyebrow stem branch may comprise the security classification of text file, urgency level, information such as Origin, Originator, thereby can be according to the content structure of text, the document key element that text file comprises and the content of document key element correspondence are obtained in parsing, " urgency level " key element comprising of this eyebrow stem branch for example, its corresponding content is " promptly ".
S103: composing device will be resolved the key element attribute that each key element of obtaining and document manifest object and be mated, the factor content of the key element that will be complementary correspondence pass to coupling key element attribute correspondence manifest object, manifest style in the document style son file that object uses and the rule in the document rule son file according to this, the factor content that manifests in the object is set type.
Wherein, this factor content pass to coupling key element attribute correspondence manifest object the time, comprise the content that this manifests object is replaced, inserted or append to this factor content.Set type and comprise manifesting factor content in the object: the format of factor content, the pageization.
For example, the text that this composing device imports according to the user, the content that obtains " urgency level " key element correspondence of text file eyebrow head is " promptly ", this composing device is with the key element of text file, the key element attribute that manifests object that comprises with document mates, this key element and this document manifest the key element attributes match success of the key element attribute of object for " urgency level ", composing device will be somebody's turn to do the key element corresponding content " promptly " that the match is successful, send the object that manifests of key element attribute in this document to for " urgency level ", style in the document style son file of quoting according to this document key element style son file " urgency level " key element, and the rule in the document rule son file, promptly manifesting style and the rule that object adopts according to this sets type, for example, when the sign of quoting style and certain style in the document style son file identify when identical, if it is the Song typeface that style is claimed as font, the word size is No. five, this composing device should " promptly " two words according to the Song typeface, No. five word is set type, and according to the rule that this key element is quoted the factor content that manifests in the object is adjusted.
The text that the user imports should be structurized text, and this composing device identifies the structure and the content of text by the XML technology.
In embodiments of the present invention in the process that composing device is set type, according to the word content of setting type, split at each section transformation character place, thereby can produce one by one independently paragragh, section transformation character is a carriage return character, newline or carriage return character newline and then.In the process that the embodiment of the invention is set type, the mode that adopts page by page, successively the factor content that manifests in the object is set type, as shown in Figure 2, be the process of carrying out page by page in the embodiment of the invention, successively the factor content that manifests in the object being set type, this process may further comprise the steps:
S201: composing device is at the current page of setting type, but one layout region in the calculating current page.
One layout region comprises in the current page but calculate: according to the zone of having set type in this current page, and the overall area of this current page, but determine one layout region in this current page.
S202: according to the position that manifests the factor content in the object and the size of setting type before deserving, judge but whether one layout region in the current page can discharge the factor content in the object of manifesting of setting type before deserving, when judged result when being, carry out S203, otherwise, carry out S204.
S203: but in the one layout region of this current page, the factor content that manifests in the object of setting type before deserving is set type, to the adjustment of aliging of the factor content after this composing, carry out S205 afterwards.
S204: search adjacent with this current page page that is positioned at after this current page, i.e. following one page of this current page, when not finding, produce the new page, the page that this is new is as following one page of this current page, the current factor content that manifests in the object of setting type is set type at following one page of this current page, come down the front that manifests object that one page comprises, to the adjustment of aliging of the factor content after this composing.
S205: judge current set type manifest whether service regeulations of object, when judged result when being, S206, otherwise, carry out S201.
S206: the composing device service regeulations are adjusted the relevant factor content that manifests in the object of this rule, carry out S201 afterwards.
That sets type before deserving in the above-described embodiments manifests object and can be text box, form, image and figure etc.
In embodiments of the present invention, the composing of text box is to be the format that unit carries out literal with the paragragh, and the literal that calculates one by one in the paragragh takes up space, and forms literal line one by one.Text box comprises in embodiments of the present invention: the fixed-size text box in space, reach the text box that the space size can change with the variation of word content and form, and be called for short the textbox that adapts to literal.The height that adapts to the textbox of literal is commonly defined as the height of delegation's literal, its shared height is set after the composing, in process of typeset, such textbox object may be split into a plurality of continuous textbox objects, be emitted on the different pages, word content is forward and backward mobile between the page possibly during composing.
The embodiment of the invention is carried out in the process of text box composing, adopt the mode of the paragragh that the text box of setting type piecemeal, successively comprises, as shown in Figure 3, be the process that the paragragh that in the embodiment of the invention text box is comprised carries out piecemeal, sets type successively, this process may further comprise the steps:
S301: composing device deserves preceding text box one layout region according to the current text frame of setting type but calculate.
Should preceding text box one layout region comprise but calculate: determine the type of current text frame, when being the fixed-size text box in space, the length in the zone that the style that use for text box in the arranged zone of text frame defines and wide; When being when adapting to the text box of literal, regional length and wide can be arranged for current page in the arranged zone of text frame.
S302: whether have the current paragragh that will set type in the text box before judge deserving, when judged result when being, carry out S303, otherwise, carry out S315.
S303: but the one layout region of the current paragragh that will set type of calculating.
But the one layout region of calculating the current paragragh that will set type comprises: but according to the one layout region of deserving preceding text box, the zone that text box has been set type before deserving, and distance before the section of the current paragragh that will set type, but determine the one layout region of the current paragragh that will set type, be specially, but will deserve the one layout region of preceding text box, deduct the zone that text box has been set type before deserving, and deduct distance before the section of the current paragragh that will set type, thereby but obtain the one layout region of this current paragragh that will set type.
S304: judge in this current paragragh that will set type whether have the current literal that will set type, when judged result when being, carry out S305, otherwise, carry out S310.
S305: determine whether to exist current line, when not having current line, then produce a new literal line as current line, the shared height and width of new literal line Chinese words all are 0.
S306: according to the style of the literal use of setting type before deserving, calculate the wide and high of the current literal that will set type, the current literal that will set type is joined in the current line, add the wide of this current line Chinese words of current adding this current line shared wide of literal of having set type, be shared wide of this current line literal.
S307: according to the literal of setting type before deserving, determine whether to tear open row, but when the shared one layout region that is wider than current paragragh of current line literal wide, then need to tear open row, carry out S308, otherwise, with literal in back of this current literal that will set type, to carry out S304 as the current literal that will set type.
S308: but according to this current line of wide fractionation of the one layout region of this current paragragh, when carrying out the fractionation of current line, taboo row according to literal, the attribute of non-disconnectable branch, determine the fractionation point of current line, the literal that literal before this fractionation point comprises for this current line splits some literal afterwards and is literal to be arranged.
S309: the literal in the current line is compressed or stretch processing, make that the shared width of literal in this current line is the width of this current line.
S310: judge that whether current line is empty, when judged result when being, carry out S311, otherwise, carry out S312.
S311: the height in arranged zone that will this current paragragh that will set type reduces the section back distance of the paragragh that will set type before deserving, carries out S313 then,
S312: calculate the shared height of literal in the current line, be about to word height the highest in the current line, determine in the current paragragh that will set type, to add this current line as the shared height of the literal in this current line, when increasing successfully, the current behavior sky is set, carry out S304, unsuccessful, then carry out S313.
Determine that in this current paragragh that will set type adding this current line comprises: when the spatial altitude in the arranged zone of this current paragragh that will set type is not less than shared high of literal in this current line, this current line of discharging in this current paragragh that will set type, recomputate the height in the arranged zone of this current paragragh that will set type, when the spatial altitude in the arranged zone of this current paragragh that will set type during, do not discharge this current line at this current paragragh that will set type less than shared high of the literal in this current line.
The height that recomputates the arranged zone of this current paragragh that will set type comprises: the height in arranged zone that will this current paragragh that will set type, deduct the shared height of literal in this current line, deduct the line-spacing of this current paragragh that will set type again, with the height of gained result as new the arranged zone of this current paragragh that will set type.
S313: finish the composing of the current paragragh that will set type, to advancing the row alignment adjustment wherein in this paragragh, alignment adjustment comprises operations such as a left side, residence, the residence is right, placed in the middle and fully support, calculate the one layout region of text box before deserving, judge whether current line is empty, when this current line is not sky, carry out S314, otherwise the paragragh of a back paragragh of this current paragragh that will set type for setting type carries out S302.
Calculating the zone that text box has been set type before deserving comprises: but according to the one layout region of deserving preceding text box, but deduct the one layout region of deserving previous paragraphs, determine the zone that the current text frame has been set type.
S314: split this current paragragh that will set type, produce a follow-up paragragh of this current paragragh of will setting type, the literal of also not setting type in first word in this current line, the literal of this first word back, this current paragragh of will setting type all is moved in the follow-up paragragh, and it is placed on the back of this current paragragh of will setting type.
S315: the composing of text box before finishing to deserve, the shared zone of text box is exactly the zone that text box has been set type before deserving before deserving, text box is when adapting to the text box of literal before deserving, if any not arranging paragragh, then produce a follow-up text frame of current text frame, do not arrange paragragh and all be moved in this follow-up text frame, and this follow-up text frame is placed on the back of deserving preceding text box.
Also comprise in embodiments of the present invention tabular matter, to tabular matter the time, at first need each table row is set type, then the cell in each table row is set type, when the content in the cell was set type, its process was with similar to the process of typeset of text box.When a form can't be set type in one page, this form can be come in two pages, concrete process comprises: but calculate one layout region in the current page, but space according to one layout region in this current page, and the used space of this tabular matter, judge, when but the space of one layout region in this current page is not less than this tabular matter and takes up space, but this form of setting type in the one layout region in this is current, otherwise, but this form of in the one layout region of this current page, setting type, and in the zone that following one page of this current page begins to set type, the residue content of this form of setting type.
During in embodiments of the present invention to the composing of image and figure, can discharge, also need then the adjustment of aliging of this image or figure according to the space size in image and the shared zone of figure.
Also comprise direct modification instrument template file in embodiments of the present invention, open the instrument template file in the mode that template is revised, can revise style, the rule of document key element use and the content of document key element correspondence that the document key element is used, revise the style that the document key element is used, revise the rule that the document key element is used, the content and the form of amended document key element style correspondence are written back in this document template file, realize the instrument template file modifying.
In embodiments of the present invention by instrument template file editor document file, be with the instrument template file serve as the basis a newly-built document file, on this basis, can import text again, the content information of document key element in this document template file is set, also can directly carry out the content input of document key element, edit the content information of this document key element, also can be provided with and revise the format information of document key element, in this process, when meaningful need the composing, this composing device is set type automatically in real time, the content of document file and the redjustment and modification of form all are written back in this article written matter, the process of Fig. 4 for carrying out redjustment and modification in this embodiment of the invention, and this process specifically may further comprise the steps:
S401: the document file after composing device will be set type is shown to the user.
S402: the user carries out the editor of content and/or the setting of form according to this document template file.
Wherein, content edited is kept at corresponding manifesting in the object, and the setting of form comprises: the corresponding object that manifests is set, makes it adopt different styles or adopt different rules, or carry out resetting of style or resetting of rule.And can comprise modification to the content that manifests object.
S403: composing device writes down the information of the setting of the editor of the content that this user carries out and/or form, the modification of rule is written back in the regular son file, the modification of style is written back in the style son file, and the modification that will manifest the rule of the style of content, employing of object and employing is written back in the corresponding element in the document key element style son file.
The composing device of a kind of document file that Fig. 5 provides for the embodiment of the invention, this device comprises:
First parsing module 51 is used for the instrument template file according to user's input, resolves the document rule son file, document style son file and the document key element style son file that obtain this document template file correspondence;
Second parsing module 52 is used for the text according to user's importing, resolves each factor content that is comprised in the acquisition text file;
Send type-setting module 53, be used for the key element attribute of each factor content and document key element style son file is mated, the factors of success that will be complementary content is passed to the object that manifests of key element attribute correspondence, manifest style in the document style son file that object adopts and the rule in the document rule son file according to this, this factor content that manifests in the object is set type.
Described transmission type-setting module 53 comprises:
Computing unit 531 is used at the current page of setting type, but calculates one layout region in this current page;
Judging unit 532 is used for position and size according to the factor content of setting type before deserving, but judges whether one layout region in this current page can discharge the factor content of setting type before deserving;
When being used for can discharging the factor content of setting type before deserving in determining this current page, but set type to this factor content in this current one layout region in also in composing unit 533; In the time of in determining this current page, can not discharging the factor content of setting type before deserving, determine adjacent with this current page to be positioned at this current page afterwards, following one page of this current page, the factor content of setting type before deserving is set type at following one page of this current page and this current page.
Described composing unit 533 comprises:
Judgment sub-unit 5331 is used for judging whether the character of setting type is the literal of non-disconnectable branch when the row of setting type is set type;
Composing subelement 5332, be used for according to this character take quiet and deserted, and this last space of row of setting type determines whether at this this character of composings row composing.
Described device also comprises:
Record write-back module 54, be used for the editor of the content that recording user carries out the instrument template file and/or the configuration information of form, and according to this information, the modification of rule is written back in the regular son file, the modification of style is written back in the style son file, will manifest object content, and this modification that manifests the rule of style that object adopts and employing be written back in the corresponding element in the document key element style son file.
The embodiment of the invention provides a kind of composition method and device of document file, and this method comprises: composing device is resolved document rule son file, document style son file and the document key element style son file that obtains instrument template file correspondence; According to the text that the user imports, resolve each factor content that is comprised in the acquisition text file; Composing device mates the key element attribute in each factor content and the document key element style son file, the factors of success that will be complementary content is passed to the object that manifests of key element attribute correspondence, this factor content that manifests in the object is set type, combine with database by the instrument template file, realization is extracted text data and is carried out automatic typesetting from database, thereby improves the efficient of setting type; Can also be written back in the database seamless connection of fulfillment database and composing device to key element in the document file and factor content derivation in addition.
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 of a document file is characterized in that, comprising:
Composing device is resolved the document rule son file, document style son file and the document key element style son file that obtain this document template file correspondence according to the instrument template file of user's input;
The text that composing device imports according to the user is resolved each key element and the factor content that are comprised in the acquisition text file;
Composing device mates the key element attribute in each key element and the document key element style son file, the factor content of the factors of success that will be complementary correspondence is passed to the object that manifests of key element attribute correspondence, manifest style in the document style son file that object adopts and the rule in the document rule son file according to this, this factor content is set type.
2. the method for claim 1 is characterized in that, described instrument template file is the expandable mark language XML file.
3. the method for claim 1 is characterized in that, the content of described document rule son file comprises:
Rule of binding between key element page displayed rule, key element and key element are printed one or more in the rule.
4. the method for claim 1 is characterized in that, the content of described document style son file comprises:
In page style, font statement, literal style, paragraph style, text box style, figure style, image style, cell style and the form style one or several.
5. the method for claim 1 is characterized in that, the content of described document key element style son file comprises:
Document file page surface information, manifest content object types, manifest content and use style information and manifest content service regeulations information.
6. the method for claim 1 is characterized in that, described this factor content is set type comprises:
At the current page of setting type, but calculate one layout region in this current page;
According to the position and the size of the factor content of setting type before deserving, but judge whether one layout region in this current page can discharge the factor content of setting type before deserving;
When judged result when being, but in this current one layout region in also, this factor content is set type,
Otherwise, determine adjacent with this current page being positioned at after this current page, following one page of this current page, should before the factor content of setting type set type at following one page of this current page and this current page.
7. method as claimed in claim 6 is characterized in that, the described composing comprises:
Handle literal and prohibit the stretching of the literal of arranging, handling the row that can not be split, the compression of carrying out character and row.
8. method as claimed in claim 7 is characterized in that, the literal of the non-disconnectable branch of described processing comprises:
At the row of setting type character is set type, according to this character occupation space of setting type, and this last space of row of setting type, determine whether at this this character of composings row composing.
9. method as claimed in claim 8 is characterized in that, described determining whether comprises at this this character of composing row composing:
According to this character occupation space of setting type, this last space of row of setting type, and the attribute of the detachable or non-disconnectable branch of the character of this composing determine whether at this this character of composing row composing.
10. the method for claim 1 is characterized in that, described method also comprises:
The editor of the content that the composing device recording user carries out the instrument template file and/or the configuration information of form;
According to this information, the modification of rule is written back in the regular son file, the modification of style is written back in the style son file, will manifests the content of object, and the modification that manifests style that object adopts and rule is written back in the corresponding element in the document key element style son file.
11. the composing device of a document file is characterized in that, this device comprises:
First parsing module is used for the instrument template file according to user's input, resolves the document rule son file, document style son file and the document key element style son file that obtain this document template file correspondence;
Second parsing module is used for the text according to user's importing, resolves each factor content that is comprised in the acquisition text file;
Send type-setting module, be used for the key element attribute of each factor content and document key element style son file is mated, the factors of success that will be complementary content is passed to the object that manifests of key element attribute correspondence, manifest style in the document style son file that object adopts and the rule in the document rule son file according to this, this factor content that manifests in the object is set type.
12. device as claimed in claim 11 is characterized in that, described transmission type-setting module comprises:
Computing unit is used at the current page of setting type, but calculates one layout region in this current page;
Judging unit is used for position and size according to the factor content of setting type before deserving, but judges whether one layout region in this current page can discharge the factor content of setting type before deserving;
When being used for can discharging the factor content of setting type before deserving in determining this current page, but set type to this factor content in this current one layout region in also in the composing unit; In the time of in determining this current page, can not discharging the factor content of setting type before deserving, determine adjacent with this current page to be positioned at this current page afterwards, following one page of this current page, the factor content of setting type before deserving is set type at following one page of this current page and this current page.
13. device as claimed in claim 13 is characterized in that, described composing unit comprises:
Judgment sub-unit is used for judging whether the character of setting type is the literal of non-disconnectable branch when the row of setting type is set type;
The composing subelement is used for the occupation space according to this character, and this last space of row of setting type, and determines whether at this this character of composing row composing.
14 devices as claimed in claim 11 is characterized in that, described device also comprises:
Record write-back module, be used for the editor of the content that recording user carries out the instrument template file and/or the configuration information of form, and according to this information, the modification of rule is written back in the regular son file, the modification of style is written back in the style son file, will manifest object content, and this modification that manifests the rule of style that object adopts and employing be written back in the corresponding element in the document key element style son file.
CN2009100901952A 2009-07-31 2009-07-31 Typesetting method of document file and device Expired - Fee Related CN101989256B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100901952A CN101989256B (en) 2009-07-31 2009-07-31 Typesetting method of document file and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100901952A CN101989256B (en) 2009-07-31 2009-07-31 Typesetting method of document file and device

Publications (2)

Publication Number Publication Date
CN101989256A true CN101989256A (en) 2011-03-23
CN101989256B CN101989256B (en) 2012-08-01

Family

ID=43745793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100901952A Expired - Fee Related CN101989256B (en) 2009-07-31 2009-07-31 Typesetting method of document file and device

Country Status (1)

Country Link
CN (1) CN101989256B (en)

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102147791A (en) * 2011-04-02 2011-08-10 数字时代出版设计有限公司 Automatic book typesetting method and system
CN102841888A (en) * 2012-09-14 2012-12-26 《中国学术期刊(光盘版)》电子杂志社 Rapid typesetting system and method
CN103034624A (en) * 2011-09-29 2013-04-10 北京大学 Method and system for accurately positioning page object
CN103678268A (en) * 2012-09-19 2014-03-26 北京大学 Automatic typesetting method and device for official documents
CN103838709A (en) * 2014-03-05 2014-06-04 天闻数媒科技(北京)有限公司 Layout method and layout engine
CN104346319A (en) * 2013-08-05 2015-02-11 北大方正集团有限公司 Method and system for inspecting document style
CN104424282A (en) * 2013-08-30 2015-03-18 北大方正集团有限公司 Method and device for inserting multimedia material into document file
CN104657342A (en) * 2013-11-19 2015-05-27 北大方正集团有限公司 Clean proof generating method and device
CN104699664A (en) * 2015-03-19 2015-06-10 徐州工业职业技术学院 Type setting system and method with independent templates
CN105095243A (en) * 2014-05-04 2015-11-25 北大方正集团有限公司 Page display device and page display method
CN105512095A (en) * 2014-09-25 2016-04-20 北大方正集团有限公司 Generation method for EPUB e-book
CN105589842A (en) * 2014-11-14 2016-05-18 北大方正集团有限公司 Typesetting method and device for digital publications
CN105701073A (en) * 2015-12-31 2016-06-22 北京中科江南信息技术股份有限公司 Layout file generation method and device
CN106407174A (en) * 2016-11-17 2017-02-15 北京小米移动软件有限公司 Method and device for setting e-mail content typesetting
CN106815181A (en) * 2016-12-19 2017-06-09 广东小天才科技有限公司 Conversion method and device of a kind of indd files of InDesign typesettings to Office files
CN106919547A (en) * 2017-03-03 2017-07-04 纪永辉 Method based on key element table and standard form Mass production form document
CN107066440A (en) * 2016-12-19 2017-08-18 广州视源电子科技股份有限公司 The input control method and system of vertical setting of types text
CN107133198A (en) * 2017-06-05 2017-09-05 广东电网有限责任公司东莞供电局 A kind of typesetting of document and format conversion method
CN107451113A (en) * 2017-07-06 2017-12-08 广东小天才科技有限公司 A kind of presentation file automatic composing method and system
CN108052488A (en) * 2017-12-06 2018-05-18 广东技术师范学院天河学院 Paper automatic generation method based on template
CN108241642A (en) * 2016-12-23 2018-07-03 北京国双科技有限公司 Document analysis method and apparatus
CN108763173A (en) * 2018-05-23 2018-11-06 广东电网有限责任公司 The method and device of checking papers of file format
CN108984498A (en) * 2017-06-05 2018-12-11 北大方正集团有限公司 The typesetting processing method and device of document
CN110489728A (en) * 2019-08-20 2019-11-22 北京市律典通科技有限公司 Legal documents automatic composing method and device
CN111079373A (en) * 2019-12-06 2020-04-28 北大方正集团有限公司 Method and device for setting custom font of customized file and readable storage medium
CN111460782A (en) * 2020-04-01 2020-07-28 支付宝(杭州)信息技术有限公司 Information processing method, device and equipment
CN111950247A (en) * 2020-07-08 2020-11-17 北京明略软件系统有限公司 Configuration-based Word document generation method
CN112668299A (en) * 2021-01-26 2021-04-16 广西安怡臣信息技术有限公司 Automatic typesetting method and system for referee document
CN116702702A (en) * 2023-04-14 2023-09-05 北京雅昌艺术印刷有限公司 Automatic typesetting method and system based on XML

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100392641C (en) * 2006-08-16 2008-06-04 北京北大方正电子有限公司 Method for implementing automatic typesetting based on cloning block
CN100501722C (en) * 2007-01-25 2009-06-17 北京方正国际软件系统有限公司 Template device of style set for quick formatting layout, and implement method

Cited By (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102147791B (en) * 2011-04-02 2013-01-09 数字时代出版设计有限公司 Automatic book typesetting method and system
CN102147791A (en) * 2011-04-02 2011-08-10 数字时代出版设计有限公司 Automatic book typesetting method and system
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
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
CN104424282A (en) * 2013-08-30 2015-03-18 北大方正集团有限公司 Method and device for inserting multimedia material into document file
CN104657342A (en) * 2013-11-19 2015-05-27 北大方正集团有限公司 Clean proof generating method and device
CN103838709A (en) * 2014-03-05 2014-06-04 天闻数媒科技(北京)有限公司 Layout method and layout engine
CN105095243A (en) * 2014-05-04 2015-11-25 北大方正集团有限公司 Page display device and page display method
CN105095243B (en) * 2014-05-04 2018-09-18 北大方正集团有限公司 Page presentation device and page display method
CN105512095A (en) * 2014-09-25 2016-04-20 北大方正集团有限公司 Generation method for EPUB e-book
CN105512095B (en) * 2014-09-25 2018-07-13 北大方正集团有限公司 The generation method of EPUB e-book
CN105589842A (en) * 2014-11-14 2016-05-18 北大方正集团有限公司 Typesetting method and device for digital publications
CN105589842B (en) * 2014-11-14 2018-09-14 北大方正集团有限公司 The composition method and device of digital publication
CN104699664B (en) * 2015-03-19 2017-07-28 徐州工业职业技术学院 The composing system and method for a kind of template independence
CN104699664A (en) * 2015-03-19 2015-06-10 徐州工业职业技术学院 Type setting system and method with independent templates
CN105701073A (en) * 2015-12-31 2016-06-22 北京中科江南信息技术股份有限公司 Layout file generation method and device
CN106407174A (en) * 2016-11-17 2017-02-15 北京小米移动软件有限公司 Method and device for setting e-mail content typesetting
CN106815181A (en) * 2016-12-19 2017-06-09 广东小天才科技有限公司 Conversion method and device of a kind of indd files of InDesign typesettings to Office files
CN107066440A (en) * 2016-12-19 2017-08-18 广州视源电子科技股份有限公司 The input control method and system of vertical setting of types text
CN106815181B (en) * 2016-12-19 2020-07-28 广东小天才科技有限公司 Method and device for converting Indesign typesetted ind files into Office files
CN108241642A (en) * 2016-12-23 2018-07-03 北京国双科技有限公司 Document analysis method and apparatus
CN106919547A (en) * 2017-03-03 2017-07-04 纪永辉 Method based on key element table and standard form Mass production form document
CN108984498B (en) * 2017-06-05 2021-04-30 北大方正集团有限公司 Document typesetting processing method and device
CN108984498A (en) * 2017-06-05 2018-12-11 北大方正集团有限公司 The typesetting processing method and device of document
CN107133198A (en) * 2017-06-05 2017-09-05 广东电网有限责任公司东莞供电局 A kind of typesetting of document and format conversion method
CN107451113A (en) * 2017-07-06 2017-12-08 广东小天才科技有限公司 A kind of presentation file automatic composing method and system
CN108052488A (en) * 2017-12-06 2018-05-18 广东技术师范学院天河学院 Paper automatic generation method based on template
CN108763173A (en) * 2018-05-23 2018-11-06 广东电网有限责任公司 The method and device of checking papers of file format
CN110489728A (en) * 2019-08-20 2019-11-22 北京市律典通科技有限公司 Legal documents automatic composing method and device
CN111079373A (en) * 2019-12-06 2020-04-28 北大方正集团有限公司 Method and device for setting custom font of customized file and readable storage medium
CN111079373B (en) * 2019-12-06 2021-12-03 北大方正集团有限公司 Method and device for setting custom font of customized file and readable storage medium
CN111460782A (en) * 2020-04-01 2020-07-28 支付宝(杭州)信息技术有限公司 Information processing method, device and equipment
CN111460782B (en) * 2020-04-01 2023-08-22 支付宝(杭州)信息技术有限公司 Information processing method, device and equipment
CN111950247A (en) * 2020-07-08 2020-11-17 北京明略软件系统有限公司 Configuration-based Word document generation method
CN112668299A (en) * 2021-01-26 2021-04-16 广西安怡臣信息技术有限公司 Automatic typesetting method and system for referee document
CN116702702A (en) * 2023-04-14 2023-09-05 北京雅昌艺术印刷有限公司 Automatic typesetting method and system based on XML
CN116702702B (en) * 2023-04-14 2024-02-13 北京雅昌艺术印刷有限公司 Automatic typesetting method and system based on XML

Also Published As

Publication number Publication date
CN101989256B (en) 2012-08-01

Similar Documents

Publication Publication Date Title
CN101989256B (en) Typesetting method of document file and device
CN106815184B (en) System and method for automatically generating document based on FOG data
CN102779118B (en) Paper typesetting method and system
CN101025738A (en) Template-free dynamic website generating method
CN110543303B (en) Visual service platform
CN104239284A (en) Method and device for automatic image-text composition
CN101443790A (en) Efficient processing of non-reflow content in a digital image
CN100543725C (en) A kind of method for the E-seal location
CN109977088A (en) A kind of method that preset format file is converted to OFD format
CN108681530A (en) A kind of official document generation method and system based on Web
CN106339363A (en) PPT report making method and device
US8386943B2 (en) Method for query based on layout information
CN107783949A (en) A kind for the treatment of method and apparatus of PPT documents
EP1744254A1 (en) Information management device
CN101470698B (en) Layout method and corresponding system for symbol of sending organizations
CN107193791A (en) Action report visual presentation method based on transient data interchange general format
CN104298705A (en) Converting method of relational data and unstructured data
CN102467496B (en) Method and device for converting stream mode typeset content into block mode typeset document
CN106528516A (en) Method for establishing analysis report
CN103034990A (en) Method and device for checking publications
CN101944081A (en) Computer generation, edition method of Guqin abbreviated character notation and system thereof
EP1744271A1 (en) Document processing device
CN105045774B (en) A kind of operating user interface handbook of What You See Is What You Get is write and generation method
CN108563616A (en) A kind of ship electronic base map management method
CN108228688B (en) Template generation method, system and server based on XBRL

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
TR01 Transfer of patent right

Effective date of registration: 20220914

Address after: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee after: Peking University

Patentee after: New founder holdings development Co.,Ltd.

Patentee after: BEIJING FOUNDER ELECTRONICS CHIEF INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee before: Peking University

Patentee before: PEKING UNIVERSITY FOUNDER GROUP Co.,Ltd.

Patentee before: BEIJING FOUNDER ELECTRONICS CHIEF INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120801

CF01 Termination of patent right due to non-payment of annual fee