Summary of the invention
For the defective that exists in prior art, the object of the present invention is to provide a kind of method and device thereof based on complicated format template automatic typesetting that improves typesetting efficient.
The invention provides a kind of automatic composing method, comprise the following steps:
According to the label information that each layout areas of wanting in layout template is set, determine adjustment of the printing plate tally set corresponding to described template;
Select the filtration style set corresponding with described adjustment of the printing plate tally set, described filtration style set is for according to the style set of the label information that comprises in described adjustment of the printing plate tally set with the corresponding described adjustment of the printing plate tally set that obtains of mapping relations of setting pattern;
To want the typesetting document and be divided into the fragment document of every kind of pattern in corresponding described filtration style set, and according to described mapping relations, record the corresponding relation of each layout areas and each fragment document that marks off in described wish layout template;
Described each fragment document is entered in layout areas corresponding to described wish layout template automatically.
The present invention also provides a kind of device of automatic typesetting, comprising:
Determining unit is used for the label information according to each layout areas setting of wanting layout template, determines adjustment of the printing plate tally set corresponding to described template;
Selected cell be used for to be selected the filtration style set corresponding with described adjustment of the printing plate tally set, the style set of the corresponding described adjustment of the printing plate tally set that described filtration style set obtains for the mapping relations according to the label information that comprises in described adjustment of the printing plate tally set and setting pattern;
Record cell is used for wanting the fragment document that the typesetting document is divided into every kind of pattern of corresponding described filtration style set, and is used for according to described mapping relations, records each layout areas in described wish layout template and the corresponding relation of each fragment document of marking off;
The automatic typesetting unit is used for described each fragment document is entered layout areas corresponding to described wish layout template automatically.
The present invention's advantage compared to existing technology:
The invention provides a kind of method and device thereof of automatic typesetting, more complicated for some publication layouts, but each issue relatively-stationary characteristic of format, at first method provided by the invention goes out one group of information filtering information according to formwork calculation, according to this filtering information, document is processed again, form several fragment documents, then each fragment document is entered automatically in each layout character block in the format template.The present invention has strengthened the automaticity of complicated format typesetting, has accelerated the publication process velocity of publication, thereby has improved the work efficiency of whole publication process.
Embodiment
The object of the present invention is to provide a kind of method and device thereof based on complicated format template automatic typesetting that improves typesetting efficient.
The invention provides a kind of automatic composing method, comprise the following steps:
According to the label information that each layout areas of wanting in layout template is set, determine adjustment of the printing plate tally set corresponding to described template;
Select the filtration style set corresponding with described adjustment of the printing plate tally set, described filtration style set is for according to the style set of the label information that comprises in described adjustment of the printing plate tally set with the corresponding described adjustment of the printing plate tally set that obtains of mapping relations of setting pattern;
To want the typesetting document and be divided into the fragment document of every kind of pattern in corresponding described filtration style set, and according to described mapping relations, record the corresponding relation of each layout areas and each fragment document that marks off in described wish layout template;
Described each fragment document is entered in layout areas corresponding to described wish layout template automatically.
The described label information of setting according to each layout areas of wanting in layout template is determined adjustment of the printing plate tally set corresponding to described template, specifically comprises:
Collect the label information that in described wish layout template, each layout areas is set, determine the one group of adjustment of the printing plate label that mates with each described label information, the label information coupling that described every group of adjustment of the printing plate label and each layout areas are set, and generate the adjustment of the printing plate tally set.
Described adjustment of the printing plate tally set corresponding to described template of determining specifically comprises:
Select the node tree corresponding with each layout areas of setting in described wish layout template, the label information that in described node tree, in the corresponding described template of each node, each layout areas is set;
Find out the leaf node in described node tree;
The label information that described leaf node is corresponding adds in described adjustment of the printing plate tally set.
Describedly select the node tree corresponding with each layout areas of setting in described wish layout template, specifically comprise:
According to the label information that each layout areas in described wish layout template is set, select the node tree corresponding with described wish layout template in Schema.
The described leaf node that finds out in described node tree specifically comprises:
Find out the node corresponding with described label information, if when root node is judged as leaf node, the label information that described root node is corresponding adds in described adjustment of the printing plate tally set;
Judge when described root node is not leaf node, continue all descendants's nodes of the described root node of traversal, judge when described descendants's node is leaf node, label information corresponding to described descendants's node added in described adjustment of the printing plate tally set.
Label information and described node that in described wish layout template, each layout areas is set have mapping relations of the same name.
The filtration style set that described selection is corresponding with described adjustment of the printing plate tally set, described filtration style set specifically comprise for according to the style set of the label information that comprises in described adjustment of the printing plate tally set with the corresponding described adjustment of the printing plate tally set that obtains of mapping relations of setting pattern:
Select the bookmark name in each described adjustment of the printing plate tally set, according to the described bookmark name that obtains, travel through the pattern title mapping relations of bookmark name and the described setting pattern of the described label information of sign of storing in described pre-typesetting template, find out each pattern title corresponding with all described bookmark names, and generate the filtration style set.
The mapping relations of described bookmark name and described pattern title are the mapping between character string.
Describedly will want the fragment document that the typesetting document is divided into every kind of pattern in corresponding described filtration style set, specifically comprise:
Described wish typesetting document decompress(ion) is condensed to packet, travels through each section in the xml document, obtain the pattern title of described each section correspondence, whether judge described pattern title is present in described filtration style set, if, keep described paragraph, otherwise with described paragraph deletion.
The present invention also provides a kind of device of automatic typesetting, comprising:
Determining unit is used for the label information according to each layout areas setting of wanting layout template, determines adjustment of the printing plate tally set corresponding to described template;
Selected cell be used for to be selected the filtration style set corresponding with described adjustment of the printing plate tally set, the style set of the corresponding described adjustment of the printing plate tally set that described filtration style set obtains for the mapping relations according to the label information that comprises in described adjustment of the printing plate tally set and setting pattern;
Record cell is used for wanting the fragment document that the typesetting document is divided into every kind of pattern of corresponding described filtration style set, and is used for according to described mapping relations, records each layout areas in described wish layout template and the corresponding relation of each fragment document of marking off;
The automatic typesetting unit is used for described each fragment document is entered layout areas corresponding to described wish layout template automatically.
Below in conjunction with drawings and the embodiments, the present invention further is described, the invention provides a kind of method and device thereof based on complicated format template automatic typesetting, calculate one group of information filtering information according to wanting layout template, according to this filtering information, document is processed again, form several fragment documents, then each fragment document is entered automatically in each layout character block in the format template, the present invention is applied to the typesetting of various complex panel faces, comprises the various formats such as word, figure.
As shown in Figure 1, be the process flow diagram of the inventive method:
S1: according to the label information that each layout areas of wanting in layout template is set, determine adjustment of the printing plate tally set corresponding to described template;
S2: select the filtration style set corresponding with described adjustment of the printing plate tally set, described filtration style set is for according to the style set of the label information that comprises in described adjustment of the printing plate tally set with the corresponding described adjustment of the printing plate tally set that obtains of mapping relations of setting pattern;
S3: will want the fragment document that the typesetting document is divided into every kind of pattern in corresponding described filtration style set, and according to described mapping relations, and record the corresponding relation of each layout areas and each fragment document that marks off in described wish layout template;
S4: described each fragment document is entered in layout areas corresponding to described wish layout template automatically.
As shown in Figure 2, be the structured flowchart of apparatus of the present invention, this automatic typesetting device 11 comprises:
Computing unit 111: be used for calculating the one group adjustment of the printing plate tally set corresponding with the character block of wanting layout template;
Selected cell 112: be used for to select the filtration style set corresponding with described adjustment of the printing plate tally set, described filtration style set is the style set of the corresponding described adjustment of the printing plate tally set that obtains according to label and the mapping relations table of pattern;
Decompose record cell 113: be used for former Word document is divided into several fragment documents of corresponding every group of described filtration style set, and record each character block in described wish layout template and the corresponding relation of described several fragment documents;
Automatic typesetting unit 114: be used for described fragment document is entered layout character block corresponding to described wish layout template automatically.
To shown in Figure 5, be the process schematic diagram of embodiment of the present invention specific implementation as Fig. 3, the present embodiment is exemplified as example with template example shown in Figure 3 and word document shown in Figure 4.Comprise three layout pieces in template, be respectively 1, chapter title piece, joint, save 2, save 3.Collect label in each character block from template, form one group of adjustment of the printing plate tally set, be: the chapter title; Save 1 title, joint 1 text; Save 2 titles, joint 2 texts; Save 3 titles, joint 3 texts.According to the mapping relations of the label in template and pattern, obtain one group of filtration pattern of the same name, be: the chapter title; Save 1 title, joint 1 text; Save 2 titles, joint 2 texts; Save 3 titles, joint 3 texts.According to first group of filtration pattern, namely the chapter title, filter original word document, obtains first fragment document, namely comprises the document of 1 square frame part in Fig. 4; According to second group of filtration pattern, namely save 1 title, joint 1 text, obtain second fragment document, namely comprise the document of 2 square frame partial contents in Fig. 4; According to the 3rd group of filtration pattern, namely save 2 titles, joint 2 texts, obtain the 3rd fragment document, namely comprise the document of 3 square frame partial contents in Fig. 4; According to the 4th group of filtration pattern, namely save 3 titles, joint 3 texts, obtain the 4th fragment document, namely comprise the document of 4 square frame partial contents in Fig. 4.Call the word introducting interface of page layout program, respectively above-mentioned 4 word fragment documents are directed in 4 layout character blocks of template, just obtained typesetting result as shown in Figure 5.
The invention provides a kind of method and device thereof based on complicated format template automatic typesetting, more complicated for some publication layouts, but each issue relatively-stationary characteristic of format, at first method provided by the invention goes out one group of information filtering information according to formwork calculation, according to this filtering information, document is processed again, form several fragment documents, then each fragment document is entered automatically in each layout character block in the format template.The present invention has strengthened the automaticity of complicated format typesetting, has accelerated the publication process velocity of publication, thereby has improved the work efficiency of whole publication process.
The present invention is that reference is described according to process flow diagram and/or the block scheme of method, equipment (system) and the computer program of the embodiment of the present invention.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or the combination of square frame.Can provide these computer program instructions to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, make the instruction of carrying out by the processor of computing machine or other programmable data processing device produce to be used for the device of realizing in the function of flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame appointments.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, make the instruction that is stored in this computer-readable memory produce the manufacture that comprises command device, this command device is realized the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame.
These computer program instructions also can be loaded on computing machine or other programmable data processing device, make on computing machine or other programmable devices and to carry out the sequence of operations step producing computer implemented processing, thereby be provided for realizing the step of the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame in the instruction of carrying out on computing machine or other programmable devices.
Although described the preferred embodiments of the present invention, in a single day those skilled in the art get the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to all changes and the modification that are interpreted as comprising preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification and not break away from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of claim of the present invention and equivalent technologies thereof, the present invention also is intended to comprise these changes and modification interior.