Industry knowledge

Talking about the Printed Page Output Based on Postscript Language

Sep 25, 2018 Leave a message

Talking about the Printed Page Output Based on Postscript Language

We are a big printing company in Shenzhen China . We offer all book publications, hardcover book printing, papercover book printing, hardcover notebook, sprial book printing, saddle stiching book printing, booklet printing,packaging box, calendars, all kinds of PVC, product brochures, notes, Children's book, stickers, all kinds of special paper color printing products, game cardand so on.

For more information please visit 

http://www.joyful-printing.com.   ENG only    

http://www.joyful-printing.net 

http://www.joyful-printing.org

email: info@joyful-printing.net


In the prepress processing system, the currently used page description language is Adobe's Postscript language. The page description language is a general-purpose programming language with strong graphics functions. Its main function is to describe text, graphics and images on the output page. Since this description is done by extracting graphical entities, the description is high quality, cost effective, and device independent.


First, the basis of print page programming based on Postscript


1. Features of the Postscript language

From the perspective of the PS language itself, it is a general programming language with strong graphics functions on the one hand, and a page description language with general programming language features on the other hand. That is to say, Postscript has the dual features of a general programming language and a page description language. In summary,

The PS language has the following main features:


 With some basic structure of the general programming language, the page information described by Postscript is compact and efficient.


 has powerful text, graphics and image processing capabilities.


A graphic of any shape consisting of a straight line, an arc, and a cubic curve. The graphic can be self-intersecting or contain unconnected parts and voids; the filling operation allows the graphic outline to be of any shape and any width; the clipping path can be any shape; Colors can be specified in a variety of ways, including Grayscale, RGB, CMYK, CIE-based, or repeating patterns, smooth gradients, color maps, and spot colors; text is treated entirely as graphics, so any graphics operator in PS is equally applicable. In the text; the PS language can describe the sampled image at any resolution according to different color models, providing the function of processing and outputting the sampled image; in the universal coordinate system, the PS language supports a composite consisting of linear transformations such as translation, ratio and rotation. Transforms, and these transforms apply to all elements of the page description, namely text, graphics, and images.


2 . Postscript page graphic description basic method

The most striking feature of the PS language is its powerful page description capabilities. The PS language simplifies the description of the graphics on the page into two basic processes of constructing paths and coloring paths according to the imaging model proposed by Adobe. Geometry of any shape can be produced by these two basic operations.


 path construction.

A Postscript path is a method of defining a variety of shapes, trajectories, and regions. The path is used to draw lines, specify the boundaries of the filled area, and define templates for cropping other shapes. The path is composed of a straight line segment and a curved segment. These segments may or may not be connected to each other. The topology of the path is not limited, and may be convex or concave, and may include a plurality of closed sub-paths. Represents several regions, and the paths can intersect themselves in any way.


The path is represented by the internal data structure of the Postscript graphics mechanism. Although the path is not directly accessible like the Postscript object, its construction and use is completely under the control of the Postscript program.


 Shading and graphics generation.

The shading operator represents the mark on the current page by transforming the geometry scan into the raster memory. The commonly used shading operators are mainly stroke and fill, and the more specific operator is image.


 Postscript characters and font features.

In the PS language, text is composed of a series of Postscript characters, and any Postscript character is a graphic that can perform any graphics operation. It is only that they each have a different shape, and these graphic shapes are composed of a piece of Bezier curve segment and a straight line segment.


The font resource is one of the most important resource classes provided by the PS language. It is a collection of various types of characters, including the definition of the character shape path. Since characters have multiple font attributes, the same character has different character shapes when using different fonts. Therefore, Postscript stores the character definition of a font in a library resource instance. Such an instance is a font library. As a resource, fonts are usually loaded into virtual memory by the interpreter only when needed by the Postscript program. Usually, a font is in the form of a program file, so a font is a "font program." When the interpreter encounters findfont, it executes a font program based on the font name provided by its operand object, creating a dictionary of fonts and storing it in global or local virtual memory. In general, font names are always represented by the corresponding font name prefixed with " / ', such as / Helvetica, / Times-Roman, etc.


Since the Postscript font defines characters in a vector manner, the Postscript characters can be arbitrarily scaled without causing character distortion or aliasing. Therefore, in the Postscript font, only one character shape of a size is defined, and the corresponding character of any size can be obtained by the scaling operation of the character coordinate system.


 The process of processing text graphically.

The PS language treats any character as a graphic, and the description of the character path is contained in the font resource provided by Postscript. The Postscript program can call these character paths by using the corresponding font. PS language control text output includes two major processes, namely setting the current font and displaying characters.


Set current font


This process interpreter usually has to go through three steps: selecting a font, determining the font size, and setting the font.


Selecting a font: The PS language uses the findfont operator to push the required font dictionary onto the top of the operand stack, which can be achieved by using the corresponding font name as the operand object of the findfont operator. For example: Use / Times-Roman, etc.


Determining the font size: In the Postscript font, all characters are defined by a unit length. This means that in the default character space, the standard character size is the default unit length of the PS language, which is 1 / 72in. Therefore, a standard-sized font must be properly scaled before it can be used. This is also the reason for determining the font size of the output text in advance.


Set the current font: By default, the current font in the graphics state is empty, so you need to set the current font. This is done with the help of the setfont operator. This operator requires only one operand object to specify a dictionary of dictionaries to be used as the current font. For example: / Times-Roman findfont 72 scalefont setfont.


Display character


Once the current font has been set, the character description process can be invoked to create a character shape path and colorize it. This process is usually done by the shading operator show. But before the specific operation, first determine whether there is a current point in the graphics state, otherwise the program will make an error because there is no current point.


Determining the current point: The position is first determined when creating the contour path of most graphic objects. Characters as a special shape are no exception. Any character needs to be determined in advance on the current page before outputting. Therefore, its initial display position should be set before displaying characters.


Shading characters: If all the preparations have been completed, then you can use the character shading operators such as show to generate character content on the page.


3. Postscript file


 Postscript file features.

The file described in the PS language is called a Postscript file and is usually represented by the suffix .PS or .eps. Since the PS language has device-independent features, Postscript files have the advantage of being device-independent and independent of the operating system platform. In addition, although the Postscript file can also be stored in binary encoding, it is generally represented and stored in ASCII-encoded text, and the file is relatively small.


A Postscript file suffixed with eps. is called a packaged Postscript file. It is a standard Postscript file format that contains a set of text structure information and Postscript commands that can be used for input and output in applications in various system environments. . The EPS format file has two main features: file independence and encapsulation.


 Postscript file creation.

There are several ways to create a Postscript file. The following are the most typical three ways: directly in the PS language; using the application software to generate; using the printing method to generate.


 Use of Postscript files.

Screen reading with application software. Postscript files are platform-independent and can be read under Windows.MAC and other operating systems using the appropriate software. There are a variety of applications, such as ghostscript, Gsview, and Acrobat Distiller and Acrobat Reader, where Acrobat Distiller can interpret Postscript files to generate PDF files, and then read them with Acrobat Reader.


Raster output device and Postscript device. The PS language is essentially a print control language that can be used to control the recording actions of the output device. Therefore, many raster output devices use the PS language as their supported programming language and output conversion through the Postscript interpreter.


Hard copy output. To hard copy the output of the page content in the Postscript file, you need to have an output device that supports the RIP interpreter. Support for Postscript files Hard copy output devices can be any Postscript device or system. For example, Postscript printers, film imagesetters with hardware or software RIP capabilities, CTP and digital presses. In the output process of the Postscript file, RIP processing is always performed first, and the page content with the characteristics of the dot matrix image is generated, and then output through the corresponding raster output device.


Second, based on Postscript print page output explanation


1. Establishment of the Postscript language development environment

The PS language can be written and saved directly in the text file, and then the suffix name is changed to .PS, Acrobat Distiller and Acrobat Reader are installed. After the Acrobat Distiller interprets the Postscript file, the PDF file can be generated, and then the Acrobat Reader software is used. read.


2. Postscript-based printing page element programming practice

 vector implementation of the PS program.

softcover book print3.jpg

 text PS program implementation.

%!ps

72 72 translate

/ Helvetica – Oblique 50 selectfont

1.0 0.0 1.0 setrgbcolor

72 0 moveto

65 7 moveto

( printing engineering ) show

Showpage


Run the program, the result is as follows

%!ps

/ Helvetica 24 selectfont

72 72 translate

72 0 moveto

(QingDaoUniversityof Science&Technology)show

0.7 setgray

Fill

65 7 moveto

(QingDaoUniversityof Science&Technology)show

0.3 0.24 0.92 sethsbcolor

f i l l

Showpage


Run the program, the result is as follows

%!ps

/ Helvetica 2 4 selectfont

72 72 translate

72 0 moveto

(QingDaoUniversityof Science&Technology)show

0.0 1.0 0.0 setrgbcolor

Fill

Showpage


Run the program and the results are as follows.


3 PS program implementation of four-color ladder (gradient diagram) (see Appendix for programming).


4 PS program implementation of halftone map (see Appendix for programming).

softcover book print4.jpg

Third, summary


The importance of the Postscript language has become more and more recognized. It is widely used not only in the printing industry, but also as the de facto industry standard for digital prepress, digital printing and related fields for printing graphic information. Standard format for storage, transmission, exchange, and output. The Postscript language is also of great importance to electronic publishing. The PDF file developed on the basis of the Postscript language is the main electronic page file format in electronic publishing, and is also the main way to organize information in cross-media publishing.


Send Inquiry