-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprint_version.ps
110 lines (88 loc) · 2.63 KB
/
print_version.ps
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
%!PS-Adobe-3.0 EPSF-3.0
%%Pages: 1
%%BoundingBox: 0 0 1000 1000
%%LanguageLevel: 1
%%EndComments
%%BeginProlog
%%EndProlog
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% RedTeam Pentesting GmbH %
% https://www.redteam-pentesting.de/ %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/initialdevicename currentpagedevice /OutputDevice get 100 string cvs def
/showline {
0 0 0 setrgbcolor
/curpos curpos interval sub def
interval 1 mul curpos moveto
show
} def
/concat { exch dup length
2 index length add string
dup dup 4 2 roll copy length
4 -1 roll putinterval
} bind def
% output filename
currentpagedevice /OutputFile known {
/outputfilename currentpagedevice /OutputFile get def
} {
/outputfilename (undefined) def
} ifelse
% OS Detection
% LIBPATH contains paths, on linux they begin with %rom% or similar, or /, on windows with %rom% or c:/
/detectedos (undetected) def
systemdict /LIBPATH get {
/curpath exch def
curpath (c:/) search {
pop pop
/detectedos (Windows) def
} if
pop
curpath (/usr) search {
pop pop
/detectedos (Linux) def
} if
pop
} forall
/pathcontrolstate false def
systemdict /SAFER known {
/saferline SAFER 100 string cvs def
/pathcontrolstate SAFER def
} {
/saferline (not set?) def
} ifelse
systemdict /DELAYSAFER known {
/delaysaferline DELAYSAFER 100 string cvs def
} {
/delaysaferline () def
} ifelse
systemdict /.currentpathcontrolstate known {
/pathcontrolstateline .currentpathcontrolstate 100 string cvs def
/pathcontrolstate .currentpathcontrolstate def
} {
% old versions of ghostscript do not have .currentpathcontrolstate
/pathcontrolstateline () def
} ifelse
%%%%%%%%%%%%%%%%%%% Drawing Code
1 1 1 setrgbcolor clippath fill
/pagewidth currentpagedevice /PageSize get 1 get def
/curpos pagewidth def
/interval pagewidth 25 div def
/Courier findfont interval scalefont setfont
0 1 5 { () showline pop } for
(Ghostscript detected) showline
(Revision : ) revision 10 string cvs concat showline
(Rev date : ) revisiondate 10 string cvs concat showline
(Detected OS : ) detectedos concat showline
(OutputDevice : ) initialdevicename concat showline
(OutputFilename : ) outputfilename concat showline
(SAFER : ) saferline concat showline
pathcontrolstateline () eq not {
(Pathcontrolstate : ) pathcontrolstateline concat showline
} if
delaysaferline () eq not {
(DELAYSAFER : ) delaysaferline concat showline
} if
showpage