Pregunta

I am a newcomer in PostScript language. Now I am using ps to print a scaled image of dots. The default dpi in ps is 72dpi, I am wondering how to change it to 600dpi.

The code i write as follows, it is a square of dots.

%%Dot_unit
%%position setting
100 200 translate
%%size setting    
52 49 scale
%%parameter setting:width height bit matrix
52 49 1 [52 0 0 -49 0 49]
%%dot unit discribe
{<
fff7ff7ff7ff7f 
ffffffffffffff
ffffffffffffff
ffffffffffffff
fffff7ffff7fff
ffffffffffffff
ffffffffffffff
ffffffffffffff
ffffffffffffff
fdfffffdffffff
ffffffffffffff
ffffffffffffff
7ff7ff7ff7ff7f
ffffffffffffff
ffffffffffffff
ffffffffffffff
ffff7ffffff7ff
ffffffffffffff
ffbfffffbfffff
ffffffffffffff
ffffffffffffff
ffffffffffffff
ffffffffffffff
ffffffffffffff
7ff7ff7ff7ff7f
ffffffffffffff
ffffffffffffff
ffffffffffffff
fffffff7ffffff
ffffffffffffff
fffffbffffffff
ffffffffffffff
ff7fffffffffff
ffffffffffdfff
ffffffffffffff
ffffffffffffff
7ff7ff7ff7ff7f
ffffffffffffff
ffffffffffffff
ffffffffffffff
ffffffff7fffff
ffffffffffffff
ffffffffffffff
ffffffffffffff
ff7fffffffffff
7fffdfffffdfff
ffffffffffffff
ffffffffffffff
fff7ff7ff7ff7f
>}
image
showpage
¿Fue útil?

Solución

There is no default dpi in PostScript. User space is set up so that the co-ordinate system is 72 units to the inch, but that's not actually the same thing. If you want a different user space then you alter the CTM (Current Transformation Matrix). All co-ordinate system alterations rely on changes to a matrix, often the CTM.

In the case of images, the image operator maps the image into a 1 unit square area, which is then passed through the image matrix to render to the canvas, using the CTM. In the case of the example above the image is scaled by a factor of 52 in the x direction and 49 in the Y direction. If you change the scale or the image matrix, you will get different results.

The area covered by the image is device-independent, when you print it the user space objects are rendered into device space (using the device matrix). So if your printer is 600 dpi or 2400 dpi, the image will still cover the same area on the output page.

All you need to worry about is the area you want covered, you don't need to be concerned with the resoltuion.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top