Summary of the invention
The object of the present invention is to provide a kind of mixed keyline layout method and system, can carry out layout, improve the efficient of mixed keyline layout the page-description language file of different-format type.
To achieve the above object of the invention, mixed keyline layout method of the present invention by the following technical solutions.
A kind of mixed keyline layout method may further comprise the steps:
Explanation module, Knockdown block, shared memory cell are set respectively;
Be described explanation module setting and distribution layout parameter, and be that described explanation module distributes the little page or leaf page;
Described explanation module carries out grammar explanation according to the layout parameter that is provided with to the little page or leaf page, generates intermediate file;
Described Knockdown block is assembled described intermediate file, generates big version typeface dot-matrix;
Described big version typeface dot-matrix is stored in the described shared memory cell.
Above-mentioned explanation module is the explanation module of at least two kinds of different-format types.
Above-mentioned explanation module carries out grammar explanation according to the layout parameter that is provided with to the little page or leaf page, and the step that generates intermediate file also comprises:
After the every explanation of described each explanation module finishes a little page or leaf page, return the included explain information of this little page or leaf page, and after all little page or leaf pages explanations are finished, return explanation and finish control signal;
According to the explain information that returns, determine the assembling parameter, generate the assembling control command, and will assemble parameter and assemble control command and send to described Knockdown block.
Wherein, explain information comprises look face number and the look face title that the little page or leaf page comprises.
The assembling parameter comprises: high, the total segments of section of each assembling section, and every section every look face needs memory size, and every section needs memory size altogether.
Above-mentioned Knockdown block is assembled described intermediate file, and the step that generates big version typeface dot-matrix is specially:
Knockdown block is assembled described intermediate file, generates big version typeface dot-matrix, and generates the low resolution preview graph according to described intermediate file.
Above-mentioned layout parameter comprises: big version layout parameter, little page or leaf page output information.
Above-mentioned big version layout parameter comprises: big version type page size, and output device resolution, the output device position is dark, and whether output device supports special look;
Little page or leaf page output information is meant the positional information of the little page or leaf page at the big version space of a whole page; Described positional information obtains by a transformation matrix of coordinates, and the form of described transformation matrix of coordinates is:
[1 0 0 1 tx ty],
Wherein, tx, ty are under user coordinate system, and the big relatively version of little page or leaf page space of a whole page coordinate system is at x, the translational movement that the y direction is carried out.
For achieving the above object, mixed keyline layout of the present invention system by the following technical solutions:
A kind of mixed keyline layout system comprises:
The explanation module allocation units are used to explanation module that the layout parameter is set, and distribute described layout parameter, the little page or leaf page;
Explanation module is connected with described explanation module allocation units, is used for according to the layout parameter that is provided with, and the little page or leaf page is carried out grammar explanation, generates intermediate file;
Knockdown block is connected with described explanation module, is used to assemble the intermediate file that described explanation module generates, and generates big version typeface dot-matrix;
Shared memory cell is connected with described Knockdown block, is used to store big version typeface dot-matrix.
Above-mentioned explanation module is the explanation module of at least two kinds of different-format types.
Described mixed keyline layout system also comprises previewing module, is connected with described explanation module, is used to read the intermediate file that described explanation module generates, and generates the low resolution preview graph.
Described mixed keyline layout system also comprises print control unit, and described print control unit comprises:
Explain control module, be connected, be used for producing the distribution control command with described explanation module allocation units;
The assembling control module is connected respectively with Knockdown block with described explanation module, is used for finishing control signal according to the explain information and the explanation of explanation module output, determines the assembling parameter, generates the assembling control command.
Wherein, the explain information of described each explanation module output comprises: look face number and look face title that the little page or leaf page comprises.
The assembling parameter that described assembling control module is determined comprises: high, the total segments of section of each assembling section, and every section every look face needs memory size, and every section needs memory size altogether.
The layout parameter that above-mentioned explanation module allocation units are distributed comprises: big version layout parameter and little page or leaf page output information.
Above-mentioned big version layout parameter comprises: big version type page size, and output device resolution, the output device position is dark, and whether output device supports special look;
Described little page or leaf page output information is meant the positional information of the little page or leaf page at the big version space of a whole page; Described positional information obtains by a transformation matrix of coordinates, and the form of described transformation matrix of coordinates is:
[1 0 0 1 tx ty],
Wherein, tx, ty are under user coordinate system, and the big relatively version of little page or leaf page space of a whole page coordinate system is at x, the translational movement that the y direction is carried out.
Compare with keyline layout method before the rasterisation, mixed keyline layout method of the present invention, to the Format Type of each little page or leaf page of input without limits, by each explanation module each little page or leaf page is carried out grammar explanation, generate each intermediate file, therefore the layout system was in the process of a rasterisation before this had just broken through rasterisation, can only carry out grammar explanation to the little page or leaf page of same Format Type, and can not be simultaneously the little page or leaf page of multiple Format Type be carried out the restriction of grammar explanation, thereby improve the efficient of mixed keyline layout, improved the compatibility and the extendability of mixed keyline layout.In addition, as further improvement to mixed keyline layout method of the present invention, in the process of the little page or leaf page of explaining various different-format types, can utilize the corresponding intermediate file that generates to generate the preview graph of low resolution, and can carry out the judgement of layout correctness, and then before rasterisation, can make an explanation again to explaining the incorrect little page or leaf page, thereby reduced the probability of the big version layout error of final output, improved the efficient of layout.
Simultaneously, compare with keyline layout method behind the rasterisation, mixed keyline layout method of the present invention in the process that forms the final big version space of a whole page, reads each intermediate file by Knockdown block, generate big version typeface dot-matrix, and a big version typeface dot-matrix is stored in the shared memory cell, therefore, this just can export big edition typeface dot-matrix storing in the shared memory cell to output device, thereby avoided read-write operation repeatedly, farthest improved the efficient of mixed keyline layout calculator memory or hard disk.
Compare with layout system before the grating, because mixed keyline layout of the present invention system is provided with at least two kinds of dissimilar explanation modules, make this mixed keyline layout system to carry out grammar explanation to the little page or leaf page of different-format type, and generate each intermediate file, therefore the layout system was in the process of a rasterisation before this had just broken through rasterisation, can only carry out grammar explanation to the little page or leaf page of same Format Type, and can not be simultaneously the little page or leaf page of multiple Format Type be carried out the restriction of grammar explanation, thereby improve the efficient of mixed keyline layout.In addition, as perfect in shape and function to Knockdown block described in the present invention, described Knockdown block also is used to read each intermediate file, generate the low resolution preview graph, in this case, this mixed keyline layout system can generate the preview graph of low resolution according to intermediate file, thereby can judge early whether each explanation module is correct to the explanation of each little page or leaf page, and then before rasterisation, can make an explanation again to explaining the incorrect little page or leaf page, the layout mode can only further improve the layout efficient of mixed keyline layout system to the whole big edition situation that the page makes an explanation before having avoided rasterisation after certain little page or leaf explanation makes mistakes.
Simultaneously, compare with layout system behind the rasterisation, mixed keyline layout of the present invention system, in the layout process, read each intermediate file that each explanation module generates by Knockdown block, assembling generates big version typeface dot-matrix, and big version typeface dot-matrix is stored in the shared memory cell, and this just makes this mixed keyline layout system the big version typeface dot-matrix of storing in the shared memory cell can be outputed on the output device.Therefore, layout needed respectively the data with rasterized of each little page or leaf page is constantly carried out situation to the read-write operation of calculator memory or hard disk in assembling process after this had just been avoided rasterisation, thereby had improved the layout efficient of mixed keyline layout system.
Embodiment
Below in conjunction with drawings and embodiments technical scheme of the present invention is done detailed explanation.
As shown in Figure 3 be the process flow diagram of mixed keyline layout method of the present invention.The mixed keyline layout here is meant the process that the little page or leaf of the various Format Types page to input (as the little page or leaf page of the little page or leaf page of the little page or leaf page of PostScript language description, PDF type, PCL Format Type, tiff format type etc.) carries out layout.
This method mainly comprises the steps:
(S1) explanation module, Knockdown block, shared memory cell are set respectively;
(S2) be explanation module setting and distribution layout parameter, and be that explanation module distributes the little page or leaf page;
(S3) explanation module carries out grammar explanation according to the layout parameter that is provided with to the little page or leaf page, generates intermediate file;
(S4) described Knockdown block assembling intermediate file generates big version typeface dot-matrix;
(S5) big version typeface dot-matrix is stored in the shared memory cell.
In above-mentioned steps (S1), the explanation module of explanation module at least two kinds of different-format types can be set.Here the explanation module of every kind of Format Type is distinguished the little page or leaf page of corresponding a kind of Format Type, explanation module as the corresponding PS Format Type of the little page or leaf page of PostScript Format Type, the explanation module of the corresponding PDF type of the little page or leaf page of PDF type, the explanation module of the corresponding PCL Format Type of the explanation module of PCL Format Type, the explanation module of the corresponding tiff format type of the little page or leaf page of tiff format type etc.
In the above-mentioned steps, form final big version typeface dot-matrix and will be somebody's turn to do the process that big version typeface dot-matrix stores shared memory cell into, without limits the Format Type of each little page of page of input.Method of the present invention is carried out grammar explanation by each explanation module to the little page or leaf page of various Format Types, generate each intermediate file, therefore the layout system was in the process of a rasterisation before this had just broken through rasterisation, can only carry out grammar explanation to the little page or leaf page of same Format Type, and can not be simultaneously the little page or leaf page of multiple Format Type be carried out the restriction of grammar explanation, thereby improve the efficient of mixed keyline layout, improved the compatibility and the extendability of mixed keyline layout.
In above-mentioned steps (S2), described layout parameter comprises: the little page or leaf page output information of big version layout parameter and various Format Types.
Described big version layout parameter comprises: big version type page size, and output device resolution, the output device position is dark, and whether output device supports special look.
The little page or leaf page output information of described various Format Types is meant the positional information of the little page or leaf page of various Format Types at the big version space of a whole page; Described positional information obtains by a transformation matrix of coordinates.
In page description file, described all pels based on coordinate system be referred to as user coordinate system system (User Coordinate System), and this user coordinate system and output device are irrelevant.May there be X in the little page or leaf page with respect to the coordinate system of the big version space of a whole page, the skew of Y direction, and this offset operation can pass through transformation matrix CTM (Transformation Matrix) to be realized.The form of the mathematical description of transformation matrix is as follows:
[1 0 0 1 tx ty]
Wherein, tx, ty are exactly under user coordinate system, the little page or leaf page with respect under the big version space of a whole page coordinate system at x, the translational movement that the y direction need be carried out.
Need the account form of the position coordinates of the little page or leaf page in the big version space of a whole page of various Format Types of layout as follows:
x’=x+tx
y’=y+ty
Wherein, x, y are the coordinate figures in the little page or leaf page, and x ', y ' are the coordinate figures in the big version space of a whole page.Coordinate figure in the little page or leaf page is known, the coordinate figure of this little page or leaf page in the big version space of a whole page can be provided with by the user, so just can calculate very easily under user coordinate system, little page of page with respect under the big edition space of a whole page coordinate system at x, the translational movement tx that the y direction need be carried out, ty.
When the little page or leaf page of various Format Types, big version layout information are sent to each explanation module, the transformation matrix of the little page or leaf page correspondence of various Format Types is sent simultaneously, thereby can guarantee that each little page or leaf page obtains correct position in the big version space of a whole page.
The detailed process for the little page or leaf of each explanation module distribution page described in the step (S2) is: be the explanation module of every kind of Format Type, distribute and the corresponding little page or leaf page of its Format Type, for example distribute the little page or leaf page of PDF, distribute little page or leaf page of PS form or the like for the PS explanation module for the PDF explanation module.Like this, just can carry out grammar explanation to the little page or leaf page of the multiple Format Type of input.
In above-mentioned steps (S3), by grammar explanation, the content of pages of the little page or leaf page can be decomposed into independently a series of element figure object, as the literal object, Drawing Object, image object, gradient object and their assembly.
Described intermediate file, can be understood as can be assembled a kind of file that is similar to the page-description language form of module identification.Intermediate file is the little page or leaf page that is independent of original various Format Types, that is to say, this intermediate file has comprised the information of the original little page or leaf page that its corresponding explanation module imports.
In addition, behind the intact little page or leaf page of the every explanation of each explanation module, export the included explain information of this little page or leaf page, and after all little page or leaf pages explanations were finished, output was explained and is finished control signal.
According to the explain information of each explanation module output, determine the assembling parameter, generate the assembling control command, and will assemble parameter and assemble control command and send to described Knockdown block.
Described explain information comprises look face number and the look face title that the little page or leaf page of various Format Types comprises respectively.
Described assembling parameter comprises: high, the total segments of section of each assembling section, and every section every look face needs memory size, and every section needs memory size altogether.
According to the resource for computer system situation, calculate each assembling parameter.The size of each assembling section is mainly determined according to the size of computing machine free memory.
In above-mentioned (S4), Knockdown block assembling intermediate file, the detailed process that generates big version typeface dot-matrix comprises;
(S41) calculate each height H s that assembles section:
Hs=M/X/n
Wherein, Hs is the height of each assembling section, unit: pixel;
M is the size of computing machine free physical memory, unit: megabyte;
X is the width of the big version of final physical space of a whole page directions X, unit: pixel;
N is the look face number that the big version of the final physical space of a whole page comprises.
(S42) the assembling control module is according to the height of each assembling section in the segmentation assembling that calculates, physics type page size in conjunction with the big version space of a whole page, can further calculate: segments altogether, every section required memory size of every look face, and the size of the section of needs internal memory altogether.These CALCULATION OF PARAMETERS methods once are described below.
Segments Ns altogether:
When Ns=H/Hs is the Hs integral multiple as H;
Ns=H/Hs+1 other.
Wherein, Ns is total hop count;
H is the height of big version space of a whole page physics type page, unit: pixel;
Hs is the height of each assembling section, unit: pixel.
Every section every look face needs memory size Ms:
Ms=(W*B+7)/8
Wherein, Ms is that every section every look face needs memory size, unit: byte;
B is that the output device position is dark, and general value is: 1 or 8;
W is the width of big version space of a whole page physics type page, unit: pixel.
Every section needs memory size Mt altogether:
Mt=Ms*n
Wherein, Mt is every section size that needs internal memory altogether, unit: byte;
Ms is that every section every look face needs memory size, unit: byte;
N is the look face number that the big version of the final physical space of a whole page comprises.
After calculating, applying for distributing memory headroom, earlier memory headroom is carried out initialization.This initialized work is only carried out once before Knockdown block is assembled, and does not carry out initialized work in the operating process afterwards.
In the described step (S4), assemble each intermediate file, it should be noted that the only responsible assembling of Knockdown block in the process of the big version of generation typeface dot-matrix, calculator memory is not carried out any initialized operation at Knockdown block.Therefore, when the class description language file of the one little page of page in back stored in the storage unit, the intermediate file of the little page or leaf page of storage before can not be capped, thus the assembling result's of other the little page or leaf page before guaranteeing validity.
As further optimization, Knockdown block carry out segmentation when assembling can be only to having the little page or leaf page of friendship to carry out the assembling of dot matrix with current assembling section, thereby avoided in the assembling process repeatedly scanning work, improve the efficient of mixed keyline layout.
In the assembling process, Knockdown block successively the intermediate file of the corresponding little page or leaf page in the assembling section is assembled, and the result of every section assembling adopts the mode of sharing dot matrix according to described assembling parameter.This has also just been avoided behind the rasterisation needing constantly carry out repeatedly the operation of writable computer internal memory or hard disk to the data with rasterized of each little page or leaf page in the layout system.
The implication of sharing dot matrix is meant, the result of every section assembling, promptly dot array data all will leave in the shared memory cell in advance in the internal memory of its appointment, be that each big version typeface dot-matrix is in storing shared memory cell into the time, according to the positional alignment of each little page or leaf page in the big version space of a whole page of having determined.The big version typeface dot-matrix that to store at last outputs on the output device.
Described step (S5) also comprises: after generating big version typeface dot-matrix, also can read each intermediate file and generate the low resolution preview graph.By this step, can judge early whether each explanation module is correct to the explanation of each little page or leaf page, and then before rasterisation, can make an explanation again to explaining the incorrect little page or leaf page, the layout mode can only further improve the layout efficient of mixed keyline layout system to the whole big edition situation that the page makes an explanation before having avoided rasterisation after certain little page or leaf explanation makes mistakes.
Simultaneously, in the prior art,, be respectively to finish by the explanation module of PDF raster image processor and the explanation module of PostScript raster image processor to the explanation of pdf document and PostScript tab file.Owing to lack necessary connection between the explanation module of two kinds of different raster image processors, like this, traditional rasterization process mode can't combine both functions, adds the PostScript mark when also just can't realize the pdf document rasterisation.
But, according to the method for the invention, owing to can make an explanation to pdf document and PostScript tab file simultaneously, and the intermediate file of generation consolidation form, therefore, when explanation module makes an explanation, just can join the PostScript mark in the pdf document.
Corresponding with mixed keyline layout method of the present invention, the present invention also provides a kind of system of mixed keyline layout.
Fig. 4 is the structural drawing of mixed keyline layout of the present invention system.As shown in Figure 4, mixed keyline layout of the present invention system comprises:
The explanation module allocation units are used to explanation module that the layout parameter is set, and distribute described layout parameter, the little page or leaf page;
Explanation module is connected with described explanation module allocation units, is used for according to the layout parameter that is provided with, and the little page or leaf page is carried out grammar explanation, generates intermediate file;
Knockdown block is connected with described explanation module, is used to assemble the intermediate file that described explanation module generates, and generates big version typeface dot-matrix;
Shared memory cell is connected with described Knockdown block, is used to store big version typeface dot-matrix.
Wherein, described explanation module is the explanation module of at least two kinds of different-format types.
The layout parameter of described explanation module allocation units setting comprises: the little page or leaf page output information of big version layout parameter and various Format Types.The little page or leaf page output information of described various Format Types is meant the positional information of the little page or leaf page of various Format Types at the big version space of a whole page.The little page or leaf page that calculates various Format Types is as follows in the process of the positional information of the big version space of a whole page:
May there be x in the little page or leaf page of various Format Types with respect to the coordinate system of the big version space of a whole page, the skew of y direction, and this offset operation can pass through transformation matrix CTM (Transformation Matrix) to be realized.The mathematical description form of transformation matrix is as follows:
[1 0 0 1 tx ty]
Wherein, tx, ty are exactly under user coordinate system, the little page or leaf page with respect under the big version space of a whole page coordinate system at x, the translational movement that the y direction need be carried out.
The account form of the position coordinates of the little page or leaf page of various Format Types that needs layout in the big version space of a whole page (x ', y ') is as follows:
x’ =x+tx
y’ =y+ty
Wherein, x, y are the coordinate figures in the little page or leaf page, and x ', y ' are the coordinate figures in the big version space of a whole page.Coordinate figure in the little page or leaf page is known, and the coordinate figure of this little page or leaf page in the big version space of a whole page can be provided with by the user.So just can calculate very easily under user coordinate system, the little page or leaf page with respect under the big version space of a whole page coordinate system at x, the translational movement tx that the y direction need be carried out, ty.Transformation matrix according to the little page or leaf page correspondence of the various Format Types that calculate can guarantee that each little page or leaf page obtains correct position in the big version space of a whole page.
Compare with layout system before the grating, because mixed keyline layout of the present invention system is provided with at least two kinds of dissimilar explanation modules, make this mixed keyline layout system to carry out grammar explanation to the little page or leaf page of different-format type, and generate each intermediate file, therefore the layout system was in the process of a rasterisation before this had just broken through rasterisation, can only carry out grammar explanation to the little page or leaf page of same Format Type, and can not be simultaneously the little page or leaf page of multiple Format Type be carried out the restriction of grammar explanation, thereby improve the efficient of mixed keyline layout.
Compare with layout system behind the rasterisation, in the layout process, read each intermediate file that each explanation module generates by Knockdown block, assembling generates big version typeface dot-matrix, and a version typeface dot-matrix is stored in the shared memory cell greatly, and this just makes this mixed keyline layout system the big version typeface dot-matrix of storing in the shared memory cell can be outputed on the output device.Therefore, layout needed respectively the data with rasterized of each little page or leaf page is constantly carried out situation to the read-write operation of calculator memory or hard disk in assembling process after this had just been avoided rasterisation, thereby had improved the layout efficient of mixed keyline layout system.
As shown in Figure 5, on the basis of mixed keyline layout system shown in Figure 4, described mixed keyline layout system also comprises print control unit, previewing module, storage control unit.
Wherein, described print control unit comprises:
Explain control module, be connected, be used for determining the layout parameter, and produce the distribution control command with described explanation module allocation units;
The assembling control module is connected with described each explanation module, is used for finishing control signal according to the explain information and the explanation of each explanation module output, determines the assembling parameter, generates the assembling control command.
The explain information of described each explanation module output comprises: look face number and look face title that the little page or leaf page comprises.
The assembling parameter that described assembling control module is determined comprises: high, the total segments of section of each assembling section, every section every look face need memory size and every section to need memory size altogether.
It is as follows to calculate described assembling CALCULATION OF PARAMETERS mode:
(1) calculate each height H s that assembles section:
Hs=M/X/n
Wherein, Hs is the height of each assembling section, unit: pixel;
M is the size of computing machine free physical memory, unit: megabyte;
X is the width of the big version of final physical space of a whole page directions X, unit: pixel;
N is the look face number that the big version of the final physical space of a whole page comprises.
(2) the assembling control module is according to the height of each assembling section in the segmentation that the calculates assembling, and the physics type page size in conjunction with the big edition space of a whole page can further calculate: segments altogether, every section required memory size of every look face, and the size of the section of needs internal memory altogether.
Segments Ns altogether:
When Ns=H/Hs is the Hs integral multiple as H;
Ns=H/Hs+1 other.
Wherein, Ns is total hop count;
H is the height of big version space of a whole page physics type page, unit: pixel;
Hs is the height of each assembling section, unit: pixel.
Every section every look face needs memory size Ms:
Ms=(W*B+7)/8
Wherein, Ms is that every section every look face needs memory size, unit: byte;
B is that the output device position is dark, and general value is: 1 or 8;
W is the width of big version space of a whole page physics type page, unit: pixel.
Every section needs memory size Mt altogether:
Mt=Ms*n
Wherein, Mt is every section size that needs internal memory altogether, unit: byte;
Ms is that every section every look face needs memory size, unit: byte;
N is the look face number that the big version of the final physical space of a whole page comprises.
As further improvement, Knockdown block carry out segmentation when assembling can be only to having the little page or leaf page of friendship to carry out the assembling of dot matrix with current assembling section, thereby avoided the scanning work of mixed keyline layout system repeatedly, improve the efficient of mixed keyline layout.
In mixed keyline layout of the present invention system, each explanation module and Knockdown block are independently of one another in the course of the work, do not have any dependence.Have only and submit the little page or leaf page to or trigger that explanation module makes an explanation or Knockdown block is assembled, explanation module or Knockdown block just can be started working.Explanation module is explained and has been finished to stop at once explaining behind the little page or leaf page, unless there is another little page or leaf page to submit to again; Stop assembling behind the little page or leaf content of pages of Knockdown block in having assembled specified section, trigger unless receive another assembling.In the assembling process, Knockdown block successively the intermediate file of the corresponding little page or leaf page in the assembling section is assembled, and the result of every section assembling adopts the mode of sharing dot matrix according to described assembling parameter.The implication of sharing dot matrix is meant, the result of every section assembling, and promptly dot array data all will leave in the shared memory cell in advance in the internal memory of its appointment.
Described previewing module, be connected with described explanation module, be used to read each intermediate file, generate the low resolution preview graph, in this case, this mixed keyline layout system can generate the preview graph of low resolution according to intermediate file, early judge whether each explanation module correct to the explanation of each little page or leaf page, and then before rasterisation, can make an explanation again to explaining the incorrect little page or leaf page, the layout mode can only further improve the layout efficient of mixed keyline layout system to the whole big edition situation that the page makes an explanation before having avoided rasterisation after certain little page or leaf explanation makes mistakes.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those skilled in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.