Background technology
In the page-description language technical field, PS (PostScript) language is a kind of programming language that is used for describing content of pages.The imaging model of PS language is for replacing model, in this imaging model, the color of the pel that the back occurs in the page, it is foreground color, the color that always replaces background, also be that foreground color always covers background color, foreground color is 100% to the contribution degree of page color, and background color is 0% to the contribution degree of page color.According to this imaging model, various transparent effects can not directly be described in the PS language, because various transparent effects need foreground color and background color acting in conjunction, in the PS language, can only generate corresponding image to content of pages part by image processing software and realize indirectly with transparent effect.
Domestic and international most literal, figure and image processing software all adopt the PS language to carry out page-describing at present.With the closely-related another one notion of PS language be exactly EPS (Encapsulated PostScript), EPS is a kind of PS of encapsulation.The instruction set that allows in the eps file to use is a subclass of standard P S instruction, does not comprise the instruction that influences the overall situation that allows in those PS standards.As shown in Figure 1, be the advertisement at two EPS forms of the overseas insertion of space of a whole page text area of the layout area of newspaper, the i.e. advertisement 2 of the advertisement 1 of EPS form and EPS form.These two EPS advertisements may be to use different ad production software development by different advertising companies.The producer of newspaper layout need not to be concerned about how ad content is made, and only needs to reserve the advertisement one layout region, EPS form promotional literature is embedded in the PS file get final product.Adopt the promotional literature of EPS form to improve advertisement design, production efficiency.But because the EPS form is not supported transparent model, some special-effects of advertisement layout can't be described and present yet,, influenced the aesthetic effect of advertisement as effects such as shade, emergence.
In the page-description language technical field, also has a kind of electronic file form PDF (Portable Document Format) form of describing content of pages.Usually describe same space of a whole page content, pdf document is littler than PS file, and more compact structure is more suitable for Internet communication.On the other hand, the page-describing ability of PDF is also strong than PS, is mainly reflected on the imaging model.The imaging model of PDF no longer is the replacement model of always continuing to use among the PS, but transparent model: promptly foreground color and corresponding background color determine page color jointly.In this imaging model, foreground color to the contribution degree of page color smaller or equal to 100%, and background color to the contribution degree of page color more than or equal to 0%, in fact replace model and be a kind of special case in the transparent model.
How the advertisement layout of the PDF of supporting transparent model being inserted in the big space of a whole page of PS format description, is the realistic problem that often runs in the actual production.Because the page animation software that is adopted in the space of a whole page manufacturing process of PS format description at present, folding hand layout software and output software all are the streamline of supporting the PS form, therefore, the pdf document of advertisement layout correspondence need be converted into view data and be inserted into then in the PS file and go, the main cause of doing like this is exactly because the PS standard is not supported transparent model.It is exactly to become view data to the content of pages of the transparent part among the PDF " pressing " that pdf document is converted to the PS file, uses among the PS image instruction to be described then.The efficient of this transfer process is low-down, and is device-dependent.If the final big space of a whole page PS file that generates is the words of exporting on the output device of 2400DPI in resolution, when being converted into view data, pdf document also must handle by the resolution of 2400DPI, only in this way could guarantee that literal and the pairing dot matrix of Drawing Object in the pdf document are very accurate, can not produce so-called " sawtooth ".The view data that above-mentioned conversion process not hard to imagine generates is very huge, is far longer than the size of original pdf document, has a strong impact on transformation efficiency, is unfavorable for that also the PS file that generates carries out Network Transmission.
No matter use the PS form also to be to use PDF to describe content of pages, all to use so-called raster image processor (Raster Image Processor, RIP), the PS form page or the PDF page are converted into page dot matrix, could on various grating output devices such as printer, film setter, direct platemaking machine, digital printer, export.The RIP that can handle PS form page description file is called PS RIP, and the RIP that can handle the PDF page description file is called PDF RIP.At present, most of RIP products can both be supported PS and two kinds of page-describing forms of PDF simultaneously on the market.
Summary of the invention
In view of this, method and device that the embodiment of the invention provides a kind of PS page to support transparent model are not supported the problem of transparent model in order to solve the PS page.
A kind of PS page that the embodiment of the invention provides is supported the method for transparent model, and steering order is used to quote the PS file in the PS page, and described steering order also is used to quote pdf document;
Steering order is quoted pdf document: the content with described pdf document is inserted in the PS page in the replacement mode;
Move described steering order: PS raster image processor RIP moves described steering order, judges whether the file that described steering order is quoted is pdf document;
When described steering order was quoted pdf document, the PDF RIP that calls setting explained described pdf document, obtains the dot matrix of described pdf document correspondence;
The dot matrix of described pdf document correspondence is associated with in the PS page, obtains whole PS page corresponding page dot matrix, export according to described page dot matrix through the assembling of page dot matrix.
A kind of PS page that the embodiment of the invention provides is supported the device of transparent model, comprising:
Quote module, be used to adopt steering order to quote pdf document, insert in the PS page in the replacement mode with the content of described pdf document;
Judge module is used for when PS RIP raster image processor moves described steering order, judges whether described steering order is the steering order of quoting pdf document;
Calling module is used for calling PDF RIP and explaining described pdf document when described steering order is quoted pdf document, obtains the dot matrix of described pdf document correspondence;
Integrate module is used for the dot matrix of described pdf document correspondence is associated with the PS page, obtains whole PS page corresponding page dot matrix through the assembling of page dot matrix, exports according to described page dot matrix.
In the embodiment of the invention for of the support of the PS page to transparent model, on realizing, passes through by software the function of expansion steering order, realization is quoted pdf document, reading this steering order, and judge when file that this steering order is quoted is pdf document, explain this pdf document by calling PDF RIP, thus the dot matrix that output printing device can be discerned, according to this dot matrix the dot matrix of the PS page is integrated output, thereby realize PS page support transparent model.On software is realized, only need in original RIP, to add the PDF RIP that explains pdf document, and set up related getting final product between this PDF RIP and PS RIP.Realize convenient and simple, and data processing efficiency height, the PS page of Sheng Chenging is to the description and the device independent of transparent model simultaneously, and data are accurate.
Embodiment
The embodiment of the invention is supported the method for transparent model in order to have realized the PS page, as shown in Figure 2, provide a kind of PS page to support the method for transparent model, the steering order user quotes the PS file in embodiments of the present invention, and steering order also is used to quote pdf document;
Steering order is quoted pdf document: the content with described pdf document is inserted in the PS page in the replacement mode;
The detailed process of moving described steering order may further comprise the steps:
S201:PS raster image processor RIP moves described steering order, judges whether the reference document of described steering order is pdf document.
Steering order comprises in embodiments of the present invention: run instruction in the PS file and/or exec instruction.When steering order was the run instruction, its way of reference of quoting pdf document can be (filename.pdf) run; When steering order is exec when instruction, its way of reference of quoting pdf document can be (filename.pdf) (r) file cvx exec.
And the effect of moving the pdf document that steering order run instruction or exec instruction quotes in embodiments of the present invention comprises: adopt the described content of pages of quoting of pdf document to cover the content of pages of corresponding host PS file description with the method that replaces, treat that whole pdf document explanation finishes, turn back to host PS file and continue to carry out follow-up PS instruction.
Wherein when whether the application file of judging steering order is pdf document, can judge that wherein description information of files comprises: the file header information of file or the extension name information of file according to description information of files.
S202: when described file was pdf document, the PDF RIP that calls setting explained described pdf document, obtains the dot matrix of described pdf document correspondence.
The dot matrix of described pdf document correspondence comprises: the page dot matrix of PDF and the masking-out dot matrix of PDF.
And when PS RIP explains described pdf document at the PDF RIP that calls described setting, with current transformation matrix of coordinates (Current Transformation Matrix, CTM) instruct and/or cut out (clip) instruction and send to described PDF RIP, PDF RIP operates described pdf document according to the content of described instruction after receiving the instruction of PS RIP transmission.
The particular location of the described content of pages of pdf document in the described page of host PS file and size are instructed or exec instruction CTM and/or clip constantly at operation steering order run by host PS file, decisions such as eoclip, and CTM can specifically be provided with by the various coordinate space transformation directives that define in the PS standard, as coordinate space translation instruction translate, coordinate space rotate instruction rotate, the coordinate space linear transformation instruction concat of coordinate space convergent-divergent instruction scale and general type adopts CTM can specify particular location and the size of pdf document in the PS page of being quoted; Various instruction clip, the eoclip etc. of cutting out that define in the PS standard can cut out the described content of pages of the pdf document of inserting.
S203: the dot matrix of described pdf document correspondence is associated with in the PS page, obtains whole PS page corresponding page dot matrix, export according to described page dot matrix through the assembling of page dot matrix.
The dot matrix of described pdf document correspondence is associated with in the PS page comprises: PS RIP calls in the process that PDF RIP explains this pdf document, generated the page-describing instruction of intermediate form, the page-describing instruction of this intermediate form is the reference instruction to pdf document corresponding page dot matrix and masking-out dot matrix, the instruction of the page-describing of this intermediate form as the page-describing instruction class of the intermediate form that generates in the interpretation process of PS RIP to the PS file seemingly, promptly be similar to some basic page-describing instructions, the for example description instruction of the black and white lattice of the positional information of character and correspondence, to the PDI of forming by broken line and Bezier, description to monochromatic and coloured image is instructed, and to the instruction that is provided with of literal and graphic color.
Obtaining whole PS page corresponding page dot matrix through the assembling of page dot matrix comprises: PS RIP handles the process of the page dot matrix of PDF, is similar to the processing procedure of PS RIP to image lattice in the PS file.Owing to the regulation that has realized cutting, particular location and size to pdf document by steering order, therefore the pdf document for this position size realizes concrete above-mentioned association, integrated operation, can finish the support of the last PS page to pdf document.
PS RIP is according to the page-describing instruction of intermediate form, obtain pdf document corresponding page dot matrix and masking-out dot matrix, according to the numerical value of each point in the masking-out dot matrix, data of corresponding positions value in the PS page dot matrix that whether replaces correspondence of the data value of each point in the PDF page dot matrix of definite correspondence.Obtain the dot matrix of full page.
The page dot matrix of the pdf document of Sheng Chenging and masking-out dot matrix can be kept in the internal memory of PSRIP or in the hard disk in embodiments of the present invention, judge and get final product when taking out from internal memory or hard disk when carrying out the integration of the PS page.
In embodiments of the present invention for of the support of the PS page to transparent model, on realizing, passes through by software the function of expansion steering order, realization is quoted pdf document, reading this steering order, and judge whether this steering order is the steering order of quoting pdf document, when steering order is quoted pdf document, explain this pdf document by the PDF RIP that calls setting, thereby the dot matrix that output printing device can be discerned, according to this dot matrix the dot matrix of the PS page is carried out association assembling output, thereby realize of the support of the PS page transparent model.On software is realized, only need in original RIP, to add the PDF RIP that explains pdf document, and set up related getting final product between this PDF RIP and PS RIP.
Realize the method for PS page support transparent model by page animation software, do not need pdf document is converted to view data, implementation is simple, efficiently, simultaneously owing to just in the PS page, quote pdf document by the run steering order, do not have this pdf document any processing, when this pdf document is repeatedly quoted by the different pages, as long as in whole PS file, increase the number of times of quoting to this pdf document, can not increase the size of PS file, while is owing to description and the device independent of the PS page that generates to transparent model, so the transparent model that this mode obtains is very accurate.
At the PS standard, expanded the function of steering order run instruction or exec instruction in embodiments of the present invention.In original PS standard, steering order run instruction or exec instruction only allow operation PS file, do not allow to move the file of other form.Its operational effect comprises: carry out the PS instruction in this PS file, returning original PS file after all instructions in pending intact this PS file again is that host PS file continues to carry out subsequent instructions.
To steering order run instruction or the semantic expansion of exec instruction on original basis, having carried out, allow steering order run instruction or exec instruction also can move pdf document, and define its operational effect in the embodiment of the invention.The operational effect of steering order run instruction or exec instruction specifically comprises: the content of pages that the described content of pages of pdf document is covered corresponding host PS file description in the replacement mode, treat that whole pdf document explanation finishes, control turns back to host PS file and continues to carry out follow-up PS instruction.
Can in the same PS page, embed eps file and plug-in pdf document simultaneously in the embodiment of the invention, and can carry out any type of rotation, translation or trimming operation to eps file and pdf document as requested, can satisfy the requirement of different user advertising format and advertisement display format.
Below by Figure of description, the embodiment of the invention is elaborated.
The PS page that adopts the embodiment of the invention to provide is provided supports the method for transparent model, overseas at the space of a whole page text area of same PS layout area, the advertisement 2 of not only inserting the advertisement 1 of EPS form but also inserting PDF.When the PS file of the full page that print to generate, the promotional literature processing mode of EPS form with traditional method, promptly is embedded into the PS data in the whole eps file in the host PS file fully.And, in host PS file, quote this pdf document by steering order run instruction to the promotional literature of PDF, concrete way of reference comprises (filename.pdf) run.And all plug-in pdf documents that are cited can be kept in the same file with host PS file, so that the different disposal module that PS handles on the streamline can conveniently find corresponding pdf document when needed; Certainly the plug-in pdf document that is cited can not leave in the same file with host PS file yet.Can be provided with flexibly as required in the concrete implementation procedure.
Though the PS file that page animation software generates has been quoted plug-in pdf document, but can also carry out layout and the processing of folding hand by normal PS file, just in the processing procedure of layout and folding hand, do not need the pdf document of quoting is done any processing, but in the output software PS RIP of rear end, need make special processing to steering order run instruction and could realize the transparent total solution of PS page support.
As shown in Figure 4, the PS page that provides for the embodiment of the invention is supported the method embodiment of transparent model, specifically may further comprise the steps:
Steering order run instruction in the S401:PS RIP operation host PS file.
S402: from operand stack, take out the operand of run instruction,, judge whether file is pdf document, if carry out S403 according to the file description information character string in this run instruction operands; Otherwise, carry out S404.
S403: call the pdf document that PDF RIP explains that this is quoted, generate page dot matrix and masking-out dot matrix that should pdf document, and be buffered in internal memory or the hard disk.Dot matrix quotes in increasing this internal memory or hard disk simultaneously in PS page-describing instruction sequence.
S404: carry out the file of being quoted according to the PS grammer.
S405:PS RIP moves other PS instructions after this run instruction.
After S406:PS RIP finishes the explanation of full page, will obtain the page-describing instruction sequence of intermediate form, will comprise quoting in this instruction sequence all pdf document corresponding page dot matrix and masking-out dot matrix.Explain this instruction sequence by scanning, carry out the dot matrix assembling of current page.
S407: this page processing finishes.Obtain the dot matrix of the whole PS page, export according to this dot matrix.
PS RIP calls in the process that PDF RIP explains this pdf document, generated the page-describing instruction of intermediate form, the page-describing instruction of this intermediate form is the reference instruction to pdf document corresponding page dot matrix and masking-out dot matrix, the instruction of the page-describing of this intermediate form as the page-describing instruction class of the intermediate form that generates in the interpretation process of PS RIP to the PS file seemingly, promptly be similar to some basic page-describing instructions, the for example description instruction of the black and white lattice of the positional information of character and correspondence, to the PDI of forming by broken line and Bezier, description to monochromatic and coloured image is instructed, and to the instruction that is provided with of literal and graphic color.
PS RIP handles the process of the page dot matrix of PDF, is similar to the processing procedure of PS RIP to image lattice in the PS file.According to PDF is explained page dot matrix and the masking-out dot matrix that obtains, according to the numerical value of each point in the masking-out dot matrix, data of corresponding positions value in the PS page dot matrix that whether replaces correspondence of the data value of each point in the PDF page dot matrix of definite correspondence.Obtain the dot matrix of full page.
Owing to the regulation that has realized cutting, particular location and size to pdf document by steering order, therefore the pdf document for this position size realizes concrete above-mentioned association, integrated operation, can finish the support of the last PS page to pdf document.
Certainly said process also can be expanded at steering order exec instruction, and instruction can be (filename.pdf) (r) file cvx exec when it quotes pdf document.When PS RIP moves this steering order exec instruction, concrete implementation process comprises: PS RIP runs to this steering order exec instruction, descriptor according to reference document in this instruction, judge whether this reference document is pdf document, when this reference document is pdf document, call PDF RIP and explain this document, generate page dot matrix and masking-out dot matrix according to this document; After all steering orders disposed, PS RIP was with the dot matrix array output of current page.
As shown in Figure 5, the embodiment of the invention provides a kind of PS page to support the device of transparent model, and this device comprises:
Quote module 50, be used to adopt steering order to quote pdf document, insert in the PS page in the replacement mode with the content of described pdf document;
Judge module 51 is used for when PS RIP raster image processor moves described steering order, judges whether described steering order is the steering order of quoting pdf document;
Calling module 52 is used for calling PDF RIP and explaining described pdf document when described steering order reference document is pdf document, obtains the dot matrix of described pdf document correspondence;
Integrate module 53 is used for the dot matrix of described pdf document correspondence is associated with the PS page, obtains whole PS page corresponding page dot matrix through the assembling of page dot matrix, exports according to described page dot matrix.
Described calling module 52 comprises:
First Interpretation unit 520 is used for described pdf document is explained, generates described pdf document corresponding page dot matrix;
Second Interpretation unit 521 is used for described pdf document is explained, generates the masking-out dot matrix of described pdf document correspondence.
Described integrate module 53 comprises:
Associative cell 530 is used for the page-describing instruction at the intermediate form that generates, and increases the page-describing instruction of the intermediate form that the dot matrix of described pdf document correspondence is quoted;
Integral unit 531 is used for the masking-out dot matrix of PDF that the instruction of the page-describing of described intermediate form is quoted, judges whether each data value in the PDF page dot matrix replaces data of corresponding positions value in the PS page dot matrix;
Output unit 532 is used for the full page dot matrix that obtains after integrating is exported.
Described calling module 52 also is used for:
To send to described PDFRIP to the current transformation matrix of coordinates and/or the cutting mode of described PDF control.
In the embodiment of the invention in order to realize of the support of the PS page to transparent model, on realizing, passes through by software the function of expansion steering order, realization is quoted pdf document, reading this steering order, and judge when file that this steering order is quoted is pdf document, explain this pdf document by calling PDF RIP, thus the dot matrix that output printing device can be discerned, according to this dot matrix the dot matrix of the PS page is carried out association assembling output, thereby realize of the support of the PS page transparent model.On software is realized, only need in original RIP, to add the PDF RIP that explains pdf document, and set up related getting final product between this PDF RIP and PS RIP.Realize convenient and simple, and data processing efficiency height, the PS page of Sheng Chenging is to transparent description and device independent simultaneously, and data are accurate.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.