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

Typesetting method of document file and device Download PDF

Info

Publication number
CN101989256B
CN101989256B CN2009100901952A CN200910090195A CN101989256B CN 101989256 B CN101989256 B CN 101989256B CN 2009100901952 A CN2009100901952 A CN 2009100901952A CN 200910090195 A CN200910090195 A CN 200910090195A CN 101989256 B CN101989256 B CN 101989256B
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.)
Expired - Fee Related
Application number
CN2009100901952A
Other languages
Chinese (zh)
Other versions
CN101989256A (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, and the inherent meaning that it pays attention to letter character does 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 in social activities, the written material that forms for certain purpose and use with specific format, it has stronger standardization; Pay attention to the form of expression of literal; Need carry out editing and composing to character, paragraph and page formatting, and can have elements such as figure, 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 one type 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, in order to the row's method and the requirement of 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 through the computer screen sense.Adopt this batch processing software for composing composing efficient high, precision is high, but this software for composing is difficult for study, and personnel have higher requirement to composing, is not suitable for format complicated document, books and publication etc.
Another kind of is interactive typesetting software; Can directly on computer screen, show the document file; The composing personnel are through handling keyboard and mouse; Can directly on screen, revise contents such as literal, figure, image and form, can also intuitively the form of expression of content be adjusted, every operation can be seen corresponding result on screen.Interactive typesetting software needs more manual work 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; The mode that also 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 of the document file that obtains based on different softwares for composing is different, make that the document file can not be directly general each other 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, need more manual work participate in the low and difficult problem of operating of software for composing of efficient in order to solve in the prior art process of typeset.
The composition method of a kind of document file that the embodiment of the invention provides comprises:
Composing device is resolved and is obtained this document template file corresponding document rule son file, document style son file and document key element style son file 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 matees 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 and the rule in the document rule son file in the document style son file that object adopts 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 to obtain this document template file corresponding document rule son file, document style son file and document key element style son file;
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 and the rule in the document rule son file in the document style son file that object adopts 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 and is obtained instrument template file corresponding document rule son file, document style son file and document key element style son file; According to the text that the user imports, resolve each factor content that is comprised in the acquisition text file; Composing device matees 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 through 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 mated; The factor content that will be complementary pass to the key element attribute of coupling corresponding manifest object; Manifest style and the rule in the document rule son file in the document style son file that object uses 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 through the instrument template file, realize from Database Systems, extracting data message, 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 confirmed 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, with replacement or increase the content that manifests object, successively the object that manifests in the document is formatd, in the page, adjust then, discharge; When format manifests object, use its style information, in adjustment, 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 and is obtained this document template file corresponding document rule son file, document style son file and document key element style son file 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, and 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 through explanatory note, and composing device has been realized the framework of rule invocation, and the concrete realization module of rule needs exploitation separately, adds composing device to through 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 through concrete regular card module.In concrete process of typeset when adopting that wherein certain is regular; Can directly adopt should the rule corresponding identifier; Composing device finds corresponding rule according to regular corresponding identifier; Find the corresponding regular plug-in unit expansion module of this rule again, employing should manifest object adjustment to being correlated with by rule plug-in unit expansion module.
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 appearance 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 through 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 (like 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 possibly 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 confirmed by the document format demand of tissue, mechanism.Document key element style son file mainly is to needing the form of content to describe in the document file; Style and rule through using realize; 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 appearance, 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 like text, figure, image and form etc.); This key element is to manifest the corresponding document key element of object; 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, resolve and obtain each key element and the factor content that are comprised in the text, wherein according to the content structure of text file; 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 of text file is first, main body and version note, because the eyebrow of text is first, main body and version note all can comprise certain content, for example eyebrow stem branch possibly comprise the information such as security classification, urgency level, Origin, Originator of text file; Thereby can be according to the content structure of text; Document key element and the corresponding content of document key element that text file comprises obtained in parsing, " urgency level " key element comprising of this eyebrow stem branch for example, and 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 mated; The corresponding factor content of the key element that will be complementary pass to the key element attribute of coupling corresponding manifest object; Manifest style and the rule in the document rule son file in the document style son file that object uses according to this, the factor content that manifests in the object is set type.
Wherein, this factor content pass to the key element attribute of coupling corresponding manifest object the time, comprise this factor content replacement, insert or append the content that this manifests object.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, obtaining the first corresponding content of " urgency level " key element of text file eyebrow is " promptly ", this composing device is with the key element of text file; The key element attribute that manifests object that comprises with document matees; The key element attribute that this key element and this document manifest object is the key element attributes match success of " urgency level ", and composing device should mate factors of success corresponding content " promptly ", sends that the key element attribute is the object that manifests of " urgency level " in this document to; 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 manifest style and the rule that object adopts and set type, for example according to this; When the sign of quoting style and certain style in the document style son file identify when identical; If it is that the Song typeface, word size are No. five that style is claimed as font, this composing device should be set type according to the Song typeface, No. five words by " promptly " two words, 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 through the XML technology.
In the process that composing device is set type in embodiments of the present invention; 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 confirm 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 that manifests 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; Promptly following one page of this current page when not finding, produces 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 possibly be split into a plurality of continuous textbox objects, is emitted on the different pages, and 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: confirm 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 the preceding distance of the section of the current paragragh that will set type; But confirm the one layout region of the current paragragh that will set type; Be specially, but, deduct the zone that text box has been set type before deserving the one layout region of deserving preceding text box; 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: the literal according to 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 tear row open; 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; According to the taboo of literal row, the attribute of on-disconnectable branch is confirmed 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, confirm 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.
Confirm 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, the row alignment of advancing in this paragragh is adjusted wherein, the 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, confirm 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 is placed on the back of this current paragragh of will setting type to it.
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, if any not arranging paragragh, then to produce a follow-up text frame of current text frame before deserving; Do not arrange paragragh and all be moved in this follow-up text frame, and be placed on the back of deserving preceding text box to this follow-up text frame.
Also comprise in embodiments of the present invention tabular matter; To tabular matter the time, at first need set type to each table row; 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, can this form be come in two pages, concrete process comprises: but calculate one layout region in the current page; But according to the space of 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; Mode so that template is revised is opened the instrument template file; 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 of document key element use; Content and form that amended document key element style is corresponding 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 to serve as the newly-built document file in basis, on this basis with the instrument template file; 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 employing different rules, or carry out resetting of style or resetting of rule.And can comprise modification to the content that manifests object.
S403: the information of the editor of the content that this user of composing device record carries out and/or the setting of 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 of rule of style and employing that will manifest content, the employing of object 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 to obtain this document template file corresponding document rule son file, document style son file and document key element style son file;
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 and the rule in the document rule son file in the document style son file that object adopts according to this, this factor content that manifests in the object is set type.
Said 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 in confirming this current page, can discharging the factor content of setting type before deserving, but set type to this factor content in this current one layout region in also in composing unit 533; In the time of in confirming this current page, can not discharging the factor content of setting type before deserving; Confirm adjacent with this current page to be positioned at this current page afterwards; Following one page of this current page, the factor content of before deserving, setting type is set type at following one page of this current page and this current page.
Said composing unit 533 comprises:
Judgment sub-unit 5331 is used for when the row of setting type is set type, judging whether the character of setting type is the literal of on-disconnectable branch;
Composing subelement 5332, be used for according to this character take quiet and deserted, and the last space of row of should setting type determines whether at this this character of composings row composing.
Said 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 information that is provided with 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 and is obtained instrument template file corresponding document rule son file, document style son file and document key element style son file; According to the text that the user imports, resolve each factor content that is comprised in the acquisition text file; Composing device matees 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 through the instrument template file, realize from database, extracting text data and carry out automatic typesetting, thereby improve 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, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.

Claims (12)

1. the composition method of a document file is characterized in that, comprising:
Composing device is resolved and is obtained this document template file corresponding document rule son file, document style son file and document key element style son file 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 matees the key element attribute in each key element and the document key element style son file; The corresponding factor content of the factors of success that will be complementary is passed to the object that manifests of key element attribute correspondence; Manifest style and the rule in the document rule son file in the document style son file that object adopts according to this, this factor content is set type.
2. the method for claim 1 is characterized in that, said instrument template file is the expandable mark language XML file.
3. the method for claim 1 is characterized in that, the content of said 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 said 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 said 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, said 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 with in the one layout region in this current page this factor content being set type,
Otherwise, confirm 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 said composing comprises:
Carry out the compression of character and the stretching of row.
8. the method for claim 1 is characterized in that, said method also comprises:
The editor of the content that the composing device recording user carries out the instrument template file and/or the information that is provided with 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 manifest style that object adopts and the modification of rule is written back in the corresponding element in the document key element style son file.
9. 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 to obtain this document template file corresponding document rule son file, document style son file and document key element style son file;
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 and the rule in the document rule son file in the document style son file that object adopts according to this, this factor content that manifests in the object is set type.
10. device as claimed in claim 9 is characterized in that, said 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 in confirming this current page, can discharging the factor content of setting type before deserving, but set type to this factor content in the one layout region in this current page in the composing unit; In the time of in confirming this current page, can not discharging the factor content of setting type before deserving; Confirm adjacent with this current page to be positioned at this current page afterwards; Following one page of this current page is set type the factor content of setting type before deserving at following one page of this current page and this current page.
11. device as claimed in claim 10 is characterized in that, said composing unit comprises:
Judgment sub-unit is used for when the row of setting type is set type, judging whether the character of setting type is the literal of on-disconnectable branch;
The composing subelement is used for the occupation space according to this character, reaches the last space of row of should setting type, and determines whether at this this character of composing row composing.
12. device as claimed in claim 9 is characterized in that, said 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 information that is provided with 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 CN101989256A (en) 2011-03-23
CN101989256B true 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)

Families Citing this family (30)

* 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
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
CN103678268B (en) * 2012-09-19 2016-08-31 北京大学 Official document automatic composing method and device
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
CN103838709B (en) * 2014-03-05 2016-09-28 天闻数媒科技(北京)有限公司 Composition method and typesetting engine
CN105095243B (en) * 2014-05-04 2018-09-18 北大方正集团有限公司 Page presentation device and page display method
CN105512095B (en) * 2014-09-25 2018-07-13 北大方正集团有限公司 The generation method of EPUB e-book
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
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
CN106815181B (en) * 2016-12-19 2020-07-28 广东小天才科技有限公司 Method and device for converting Indesign typesetted ind files into Office files
CN107066440A (en) * 2016-12-19 2017-08-18 广州视源电子科技股份有限公司 Input control method and system for vertical text
CN108241642B (en) * 2016-12-23 2021-03-30 北京国双科技有限公司 File analysis method and device
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
CN107133198A (en) * 2017-06-05 2017-09-05 广东电网有限责任公司东莞供电局 Method for typesetting and format conversion of document
CN107451113A (en) * 2017-07-06 2017-12-08 广东小天才科技有限公司 Automatic typesetting method and system for presentation document
CN108052488A (en) * 2017-12-06 2018-05-18 广东技术师范学院天河学院 Paper automatic generation method based on template
CN108763173A (en) * 2018-05-23 2018-11-06 广东电网有限责任公司 Document checking method and device for file format
CN110489728A (en) * 2019-08-20 2019-11-22 北京市律典通科技有限公司 Legal documents automatic composing method and device
CN111079373B (en) * 2019-12-06 2021-12-03 北大方正集团有限公司 Method and device for setting custom font of customized file and readable storage medium
CN117113962A (en) * 2020-04-01 2023-11-24 支付宝(杭州)信息技术有限公司 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
CN113569530A (en) * 2021-07-29 2021-10-29 北京法意科技有限公司 Intelligent document typesetting method and system
CN116702702B (en) * 2023-04-14 2024-02-13 北京雅昌艺术印刷有限公司 Automatic typesetting method and system based on XML

Citations (2)

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

Patent Citations (2)

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

Also Published As

Publication number Publication date
CN101989256A (en) 2011-03-23

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
CN101706821B (en) Tag-based mobile internet page design system and method
CN102779118B (en) Paper typesetting method and system
CN104317563B (en) A kind of online courseware collaborative development system
CN110543303B (en) Visual service platform
CN100543725C (en) A kind of method for the E-seal location
CN104239284A (en) Method and device for automatic image-text composition
CN101443790A (en) Efficient processing of non-reflow content in a digital image
CN101025738A (en) Template-free dynamic website generating method
CN103279454A (en) Document automatic generation method, device and system
CN101470698B (en) Layout method and corresponding system for symbol of sending organizations
CN109977088A (en) A kind of method that preset format file is converted to OFD format
CN106339363A (en) PPT report making method and device
US8386943B2 (en) Method for query based on layout information
CN107133198A (en) Method for typesetting and format conversion of document
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
CN108228688B (en) Template generation method, system and server based on XBRL
CN103034990A (en) Method and device for checking publications
CN101944081A (en) Computer generation, edition method of Guqin abbreviated character notation and system thereof
CN105045774B (en) A kind of operating user interface handbook of What You See Is What You Get is write and generation method
EP1744271A1 (en) Document processing device
CN108563616A (en) A kind of ship electronic base map management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
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