File: overprint.php

package info (click to toggle)
php-ps 1.4.4%2B1.3.7-7
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 2,392 kB
  • sloc: ansic: 3,852; php: 1,628; xml: 667; makefile: 1
file content (34 lines) | stat: -rw-r--r-- 805 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
define("LEFT_BORDER", 50);

function footer($ps, $text) {
	$psfont = ps_findfont($ps, "Helvetica", "", 0);
	ps_setfont($ps, $psfont, 8.0);
	$buffer = "This file has been created with pslib ".ps_get_parameter($ps, "dottedversion", 0.0);
	ps_show_xy($ps, $buffer, LEFT_BORDER, 25);
}

$ps = ps_new();

if (!ps_open_file($ps, "overprint.ps")) {
	print "Cannot open PostScript file\n";
	exit;
}

ps_set_info($ps, "Creator", "draw.php");
ps_set_info($ps, "Author", "Uwe Steinmann");
ps_set_info($ps, "Title", "Overprint");

ps_begin_page($ps, 596, 842);
footer($ps, "");
ps_setcolor($ps, "fill", "cmyk", 1.0, 0.0, 0.0, 0.0);
ps_rect($ps, 100, 100, 200, 200);
ps_fill($ps);
ps_setoverprintmode($ps, 1);
ps_rect($ps, 120, 120, 100, 100);
ps_fill($ps); 
ps_end_page($ps);

ps_close($ps);
ps_delete($ps);
?>