The content of the invention
The embodiment of the present invention provides a kind of method of lattice file layout, this method solve layout side of the prior art
The small page page that method can only be directed to grating before processing carries out layout, is not suitable for the lattice file after rasterisation and carries out layout, makes
Actual printing process is not suitable for into ground, the technical issues of poor universality.
The embodiment of the present invention provides a kind of method of lattice file layout, including:
The layout parameter information that user is sent by terminal is received, each lattice file is carried in the layout parameter information
Color face layout essential information, the layout essential information of index information and full page file;
The color face layout essential information and index information of each lattice file are write in disk file, and mark is set to believe
Breath;
The layout of color face information update full page file in the color face layout essential information of each lattice file
The color face information of essential information;
The layout process instruction of each lattice file is generated, and stores to instruction and handles in queue;
Calculate the hop count for carrying out layout processing;
For each color face of full page file, Xun Huan performs following operation:It is read according to the identification information of each lattice file
Index information is taken, and lattice file and color face layout essential information are read according to index information, it is basic according to color face layout
Information performs corresponding lattice file the space of a whole page process instruction, and segmentation generates the full page file in corresponding color face.
The embodiment of the present invention provides a kind of device of lattice file layout, including:
Receiving module for receiving the layout parameter information that user is sent by terminal, is taken in the layout parameter information
The layout essential information of color face layout essential information, index information and full page file with each lattice file;
Writing module, for the color face layout essential information and index information of each lattice file to be write disk file
In, and identification information is set;
Update module, it is whole for the color face information update in the color face layout essential information according to each lattice file
The color face information of the layout essential information of version file;
Generation module for generating the layout process instruction of each lattice file, and is stored to instruction and handled in queue;
Computing module, for calculating the hop count for carrying out layout processing;
Execution module, for being directed to each color face of full page file, Xun Huan performs following operation:According to each lattice file
Identification information read index information, and lattice file and color face layout essential information are read according to index information, according to described
Layout essential information in color face performs corresponding lattice file the space of a whole page process instruction, and segmentation generates the full page text in corresponding color face
Part;
Output module, for exporting the full page file.
The embodiment of the present invention provides a kind of method and apparatus of lattice file layout, is sent by receiving user by terminal
Layout parameter information, the color face layout essential information of each lattice file, index information and whole are carried in layout parameter information
The layout essential information of version file;The color face layout essential information and index information of each lattice file are write into disk file
In, and identification information is set;Color face information update full page file in the color face layout essential information of each lattice file
Layout essential information color face information;The layout process instruction of each lattice file is generated, and is stored to instruction processing queue
In;Calculate the hop count for carrying out layout processing;For each color face of full page file, Xun Huan performs following operation:According to each point
The identification information of battle array file reads index information, and reads lattice file and color face layout essential information according to index information, presses
Space of a whole page process instruction is performed to corresponding lattice file according to color face layout essential information, segmentation generates the full page text in corresponding color face
Part exports full page file.The layout to lattice file is realized, actual printing process is more suitable for, improves versatility.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
All other embodiments obtained without making creative work belong to the scope of protection of the invention.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, represent
There may be three kinds of relations, for example, A and/or B, can represent:Individualism A, exists simultaneously A and B, individualism B these three
Situation.In addition, character "/" herein, it is a kind of relation of "or" to typically represent forward-backward correlation object.
Depending on linguistic context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determining " or " in response to detection ".Similarly, depending on linguistic context, phrase " if it is determined that " or " if detection
(condition or event of statement) " can be construed to " when definite " or " in response to determining " or " when the detection (condition of statement
Or event) when " or " in response to detecting (condition or event of statement) ".
Fig. 1 is the flow chart of the embodiment of the method one of lattice file layout of the present invention, as shown in Figure 1, the present embodiment is held
Row main body is the device of lattice file layout, which can integrate or install in the terminal, which can be computer, pen
Remember in this computer or server.Then the method for lattice file layout provided in this embodiment includes following steps.
Step 101, the layout parameter information that user is sent by terminal is received, each dot matrix is carried in layout parameter information
The layout essential information of the color face layout essential information of file, index information and full page file.
Wherein, terminal can be computer, laptop or server etc..
In the present embodiment, layout parameter information includes:The color face layout essential information of each lattice file.Each dot matrix text
The color face layout essential information of part includes:Width, height, locating depth, color face Shuo Jise faces title of lattice file etc..Full page file
Layout essential information include:Image quality level, height, width, locating depth, color face Shuo Jise faces title of full page file etc..
Index information includes:The index information of the color face layout essential information of each lattice file and the index letter of each lattice file
Breath.Wherein, the index information of each lattice file can be the handle information of each lattice file.
Step 102, the color face layout essential information and index information of each lattice file are write in disk file, and set
Put identification information.
It should be noted that also by the storage of each lattice file into disk file.
In the present embodiment, since the processing procedure of lattice file needs to consume substantial amounts of memory, so each dot matrix is literary
In color face layout essential information and index information the write-in disk file of part, in order to rapidly obtain each lattice file
Color face layout essential information and index information are that the color face layout essential information of each lattice file and index information set mark
Information each the color face layout essential information of lattice file and index information will be associated storage, with root with identification information
Index information is obtained according to identification information, color face layout essential information and lattice file are obtained according to index information.
Step 103, the color face information in the color face layout essential information of each lattice file updates full page file
The color face information of layout essential information.
Specifically, in the present embodiment, the color face information in the color face layout essential information of each lattice file includes:Color face
Number and color face name information.Color face Shuo Hese faces name information in the color face layout essential information of each lattice file is more
The color face information of layout essential information and color face name information of new full page file make layout essential information in full page file
Color face number is more than or equal to the color face number of each lattice file, and the color face title of each lattice file includes the color of all lattice files
Face title.
Step 104, the layout process instruction of each lattice file is generated, and stores to instruction and handles in queue.
Specifically, the layout process instruction of each lattice file of generation is arrived into instruction according to the rule storage of first in, first out
It handles in queue, is first carried out with the instruction when executing instruction process instruction, being first stored in, performed after the instruction being stored in afterwards.
Step 105, the hop count for carrying out layout processing is calculated.
Specifically, in the present embodiment, since the memory headroom that the processing of lattice file occupies is big, so needing to carry out by section
Layout is handled.Next section of layout of full page file is carried out after the last period layout of completion full page file again.
Step 106, for each color face of full page file, Xun Huan performs following operation:According to the mark of each lattice file
Know information and read index information, and lattice file and color face layout essential information are read according to index information, according to the layout of color face
Essential information performs corresponding lattice file space of a whole page process instruction, and segmentation generates the full page file in corresponding color face.
Step 107, full page file is exported.
It is illustrated with reference to step 106- steps 107.Specifically, it is each color according to full page file in the present embodiment
Complete layout processing in face.It is that segmentation completion layout is handled when carrying out layout processing in each color face.It is carried out in each color face
When layout is handled, corresponding index information is obtained according to the identification information of each lattice file first, is read according to index information
Lattice file and color face layout essential information, and space of a whole page processing is performed to corresponding lattice file according to color face layout essential information
Instruction, the process for performing space of a whole page process instruction is to generate the process of the data after lattice file layout is corresponded in every section, by institute
Data after the layout of each lattice file needed are deposited into output caching, and are exported, and complete the every of each color face
The layout of section.After the completion of the layout in previous color face, the layout processing in face of the same colour under execution, until the institute of full page file is coloured
Until layout processing is completed in face.After completing layout processing in the coloured face of institute, full page file is exported.
The method of lattice file layout provided in this embodiment, the layout parameter sent by receiving user by terminal are believed
Breath carries the layout of the color face layout essential information of each lattice file, index information and full page file in layout parameter information
Essential information;The color face layout essential information and index information of each lattice file are write in disk file, and mark is set
Information;The layout essential information of color face information update full page file in the color face layout essential information of each lattice file
Color face information;The layout process instruction of each lattice file is generated, and stores to instruction and handles in queue;It calculates and carries out layout
The hop count of processing;For each color face of full page file, Xun Huan performs following operation:According to the identification information of each lattice file
Index information is read, and lattice file and color face layout essential information are read according to index information, is believed substantially according to the layout of color face
Breath performs corresponding lattice file space of a whole page process instruction, and segmentation generates the full page file in corresponding color face, exports full page file.It is real
The layout to lattice file is showed, has been more suitable for actual printing process, improves versatility.
Fig. 2 is the flow chart of the embodiment of the method two of lattice file layout of the present invention, as shown in Fig. 2, the present embodiment provides
Lattice file layout method, be on the basis of the embodiment of the method one of lattice file layout of the present invention, to step 105-
The further refinement of step 106, then the method for lattice file layout provided in this embodiment comprise the following steps.
Step 201, the layout parameter information that user is sent by terminal is received, each dot matrix is carried in layout parameter information
The layout essential information of the color face layout essential information of file, index information and full page file.
Further, in the present embodiment, index information includes:The index of the color face layout essential information of each lattice file
The index information of information and each lattice file.
Step 202, judge whether the picture quality in layout parameter information is arranged to fine grade, if it is not, then performing step
Rapid 203, otherwise perform step 204.
Step 203, picture quality is reset into fine grade.
Further, in the present embodiment, cause to spell in order to avoid lattice file is reduced in layout processing procedure is carried out
Full page file after version loses line, judges whether picture quality is fine grade, if not fine grade, then by picture quality weight
It is set to fine grade.
Step 204, the color face layout essential information and index information of each lattice file are write in disk file, and set
Put identification information.
Step 205, the color face information in the color face layout essential information of each lattice file updates full page file
The color face information of layout essential information.
Step 206, the layout process instruction of each lattice file is generated, and stores to instruction and handles in queue.
In the present embodiment, the realization method of step 204- steps 206 and the embodiment of the method for lattice file layout of the present invention
The realization method of step 102- steps 104 in one is identical, and this is no longer going to repeat them.
Step 207, the hop count for carrying out layout processing is calculated.
Further, in the present embodiment, step 207 can be divided into following three steps and perform.
Step 207a calculates the amount of ram carried out needed for layout processing according to the resolution ratio of full page file.
Wherein, carry out the amount of ram needed for layout processing and be represented by M.Full page text is calculated according to the resolution ratio of full page file
The data volume of part, and with the data volume divided by 8bit of full page file, obtain carrying out the amount of ram M needed for layout processing.
Step 207b obtains the capacity in memory buffer pond.
Wherein, the capacity in memory cache pond is expressed as m.
Step 207c carries out the hop count of typesetting processing according to the calculation of capacity in amount of ram and memory buffer pond.
Specifically, the hop count of typesetting processing can be by carrying out the amount of ram M needed for layout processing divided by memory cache pond
Capacity m is calculated.Fig. 3 is that the schematic diagram after step 207 is performed in the embodiment of the present invention two, as shown in figure 3, the full page file
31 points have been 8 sections, and label 32 is shown as per segment table.
Step 208, for each color face of full page file, Xun Huan performs following operation:According to the mark of each lattice file
Know information and read index information, and lattice file and color face layout essential information are read according to index information, according to the layout of color face
Essential information performs corresponding lattice file space of a whole page process instruction, and segmentation the output phase answers the full page file in color face.
Further, it is for the keyline layout method in each color face of full page file:Believed according to the mark of each lattice file
Breath reads index information, and reads lattice file and color face layout essential information according to index information, basic according to the layout of color face
Information performs corresponding lattice file space of a whole page process instruction, and segmentation the output phase answers the full page file in color face.To full page file
Previous color face complete layout after, perform the layout to the latter color face, after completing layout until the coloured face of institute, export layout
Full page file afterwards.
Further, index information is read according to the identification information of each lattice file, and point is read according to index information
Battle array file and color face layout essential information perform corresponding lattice file according to color face layout essential information space of a whole page processing and refer to
Order, segmentation the output phase answer the full page file in color face to specifically include:
First, the rope of the color face layout essential information of corresponding lattice file is read according to the identification information of each lattice file
Fuse ceases and the index information of corresponding lattice file.
Secondly, corresponding lattice file is read according to the index information of corresponding lattice file.
Again, color face layout is read according to the index information of the color face layout essential information of corresponding lattice file substantially to believe
Breath.
Then, according to the data after the layout of each lattice file in color face layout essential information calculating correspondent section, and will
Data after the layout of each lattice file are deposited into output caching.
Finally, the data after the layout of each lattice file in being cached according to output generate corresponding color face in correspondent section
Full page file.
In the present embodiment, when carrying out layout processing to every section of each color face, it can be sentenced according to color face layout essential information
It is disconnected whether to need to rotate lattice file, if desired, then according to the information such as the width of present segment, height, rotation angle with
And the color face layout essential information of lattice file calculates the initial row of present segment and the initial row and knot of ending row and lattice file
The correspondence of tail row, and the data-bias of present segment is calculated, the data of the lattice file after the layout calculated are stored in
In being cached to output.If need not rotate, according to the color face layout of the information such as the width of present segment, height and lattice file
Essential information calculates the correspondence of the initial row of present segment and the initial row and ending row of ending row and lattice file, and calculates
Go out the data-bias of present segment, the data of the lattice file after the layout calculated are deposited into output caching.
Step 209, full page file is exported.
The method of lattice file layout provided in this embodiment, the layout parameter sent by receiving user by terminal are believed
Breath carries the layout of the color face layout essential information of each lattice file, index information and full page file in layout parameter information
After essential information, judge whether the picture quality in layout parameter information is arranged to fine grade, if it is not, then by picture quality weight
Fine grade is set to, lattice file is avoided and losing for the full page file after causing layout is reduced in layout processing procedure is carried out
Line problem.
And the method for lattice file layout provided in this embodiment carries out the hop count of layout processing by calculating, for
Each color face of full page file, Xun Huan perform following operation:Index information is read according to the identification information of each lattice file, and
Lattice file and color face layout essential information are read according to index information, according to color face layout essential information to corresponding dot matrix text
Part performs space of a whole page process instruction, and segmentation the output phase answers the full page file in color face, exports full page file, is segmented and lattice file is carried out
Layout, reduces the load of memory, and improves processing speed.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Foregoing program can be stored in a read/write memory medium.The program is being held
During row, execution the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or CD
Etc. the various media that can store program code.
Fig. 4 is the structure diagram of the device embodiment one of lattice file layout of the present invention, as shown in figure 4, the present embodiment
The device of the lattice file layout of offer includes:Receiving module 41, writing module 42, update module 43, generation module 44 calculate
Module 45, execution module 46 and output module 47.
Wherein, receiving module 41, for receiving the layout parameter information that user is sent by terminal, in layout parameter information
Carry the layout essential information of the color face layout essential information of each lattice file, index information and full page file.Writing module
42, for the color face layout essential information and index information of each lattice file to be write in disk file, and mark is set to believe
Breath.Update module 43, for the color face information update full page file in the color face layout essential information according to each lattice file
Layout essential information color face information.Generation module 44 for generating the layout process instruction of each lattice file, and stores
It is handled to instruction in queue.Computing module 45, for calculating the hop count for carrying out layout processing.Execution module 46, it is whole for being directed to
Each color face of version file, Xun Huan perform following operation:Index information, and root are read according to the identification information of each lattice file
Lattice file and color face layout essential information are read according to index information, according to color face layout essential information to corresponding lattice file
Space of a whole page process instruction is performed, segmentation generates the full page file in corresponding color face.Output module 47, for exporting full page file.
The device of lattice file layout provided in this embodiment can perform the technical solution of embodiment of the method shown in Fig. 1,
Its implementing principle and technical effect is similar, and details are not described herein again.
Fig. 5 is the structure diagram of the device embodiment two of lattice file layout of the present invention, as shown in figure 5, the present embodiment
The device of the lattice file layout of offer is on the basis of the device embodiment one of lattice file layout of the present invention, further,
It further includes:Judgment module 51 and replacement module 52.
Further, whether judgment module 51, the picture quality for judging in layout parameter information are arranged to fine etc.
Grade.Module 52 is reset, if for the picture quality in layout parameter information being not provided with that for fine grade, picture quality being reset
For fine grade.
Wherein, index information includes:The index information and each dot matrix of the color face layout essential information of each lattice file
The index information of file.
Further, computing module 45 are specifically used for:It is calculated according to the resolution ratio of full page file needed for carrying out layout processing
Amount of ram;Obtain the capacity in memory buffer pond;Typesetting processing is carried out according to the calculation of capacity in amount of ram and memory buffer pond
Hop count.
Further, execution module 46 are specifically used for:Corresponding dot matrix text is read according to the identification information of each lattice file
The index information of the index information of the color face layout essential information of part and corresponding lattice file;According to the index of corresponding lattice file
Information reads corresponding lattice file;Color face is read according to the index information of the color face layout essential information of corresponding lattice file to spell
Version essential information;Data in correspondent section after the layout of each lattice file are calculated according to color face layout essential information, and will be every
Data after the layout of a lattice file are deposited into output caching;After the layout of each lattice file in being cached according to output
Data, generate the full page file in corresponding color face in correspondent section.
The device of lattice file layout provided in this embodiment can perform the technical solution of embodiment of the method shown in Fig. 2,
Its implementing principle and technical effect is similar, and details are not described herein again.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to
Can so modify to the technical solution recorded in foregoing embodiments either to which part or all technical characteristic into
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is not made to depart from various embodiments of the present invention technology
The scope of scheme.