Documente Academic
Documente Profesional
Documente Cultură
%
% This software is provided AS-IS with no warranty, either express or
% implied.
%
% This software is distributed under license and may not be copied,
% modified or distributed except as expressly authorized under the terms
% of the license contained in the file LICENSE in this distribution.
%
% For more information about licensing, please refer to
% http://www.ghostscript.com/licensing/. For information on
% commercial licensing, go to http://www.artifex.com/licensing/ or
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
/graphicsbeginpage {
initgraphics
currentdict /ClipRect knownoget { aload pop rectclip } if
0 g 0 G false op false OP 0 OPM
1 ca 1 CA null SMask false AIS /Compatible BM true TK
} bdef
% Restore graphics state, but do not modify path. Paths are not part
% of the PDF graphics state; see 4.4.1 of PDF reference 3rd ed.
/grestore_nopath {
% Collect the upath with an identity CTM
{ matrix setmatrix //false upath } stopped {
pop grestore newpath
} {
% Save the CTM, set identity during the uappend, then set the CTM
grestore matrix currentmatrix matrix setmatrix
exch newpath uappend setmatrix
} ifelse
} bdef
/q {
gsave //nodict begin
} bdef
% Some PDF files have excess Q operators!
/Q {
currentdict /self .knownget {
exec //nodict eq { end grestore_nopath false } { true } ifelse
} {
true % formaterror -- not a gsave dict
} ifelse
{ (\n **** File has imbalanced q/Q operators \(too many Q's\) ****\n)
pdfformaterror
} if
} bdef
% Clipping:
/textbeginpage
{ /TextSpacing 0 def % 0 Tc
/TextLeading 0 def % 0 TL
/TextRenderingMode 0 def % 0 Tr
/TextRise 0 def % 0 Ts
/WordSpacing 0 def % 0 Tw
/TextHScaling 1.0 def % 100 Tz
/TextFont null def
/Show { showfirst } def
} bdef
/settextmatrix {
TextMatrix concat
TextHScaling 1 ne { TextHScaling 1 scale } if
TextRise 0 ne { 0 TextRise translate } if
TextFont dup null eq { pop } { setfont } ifelse
} bdef
/settextstate {
% The text state can be set even outside BT/ET.
currentdict /TextSaveMatrix known {
TextSaveMatrix setmatrix settextmatrix
} if
} bdef
/settextposition {
% Update the TextMatrix translation.
gsave TextSaveMatrix setmatrix
currentpoint TextRise sub TextMatrix 4 2 getinterval astore pop
% We would like to do "grestore currentpoint translate"
% here, but some PDF files set a singular text matrix
% (0 0 0 0 <x> <y> Tm), so we can't do this.
TextTempMatrix identmatrix setmatrix currentpoint
grestore
TextTempMatrix currentmatrix 4 2 getinterval astore pop
TextTempMatrix setmatrix
} bdef
/BT {
currentdict /TextLineMatrix .knownget
{ identmatrix pop TextMatrix identmatrix pop }
{ matrix /TextLineMatrix gput matrix /TextMatrix gput }
ifelse
{ showfirst } /Show gput
currentdict /TextSaveMatrix .knownget not {
matrix dup /TextSaveMatrix gput
} if currentmatrix pop settextmatrix
matrix /TextTempMatrix gput % see settextposition
} bdef
/ET {
TextRenderingMode 4 ge { clip newpath } if
TextSaveMatrix setmatrix
currentdict /TextSaveMatrix undef
} bdef
/Tc { /TextSpacing gput { showfirst } /Show gput } bdef
/TL { /TextLeading gput } bdef
/Tr { dup .settextrenderingmode /TextRenderingMode gput { showfirst } /Show gput }
bdef
/Ts { /TextRise gput settextstate } bdef
/Tw { /WordSpacing gput { showfirst } /Show gput } bdef
/Tz { 100 div /TextHScaling gput settextstate} bdef
/Td {
TextLineMatrix transform TextLineMatrix 4 2 getinterval astore pop
TextLineMatrix TextMatrix copy pop settextstate
} bdef
/TD { dup neg /TextLeading gput Td } bdef
/T* { 0 TextLeading neg Td } bdef
/Tm {
TextLineMatrix astore TextMatrix copy pop settextstate
} bdef
/Vexch {
rootfont /WMode knownoget { 1 eq { exch } if } if
} bind def
/Tj {
0 0 moveto Show settextposition
} bdef
/' { T* Tj } bdef
/" { exch Tc exch Tw T* Tj } bdef
/TJ {
0 0 moveto {
dup type /stringtype eq {
Show
} { -1000 div
currentfont /ScaleMatrix .knownget { 0 get mul } if
0 Vexch rmoveto
} ifelse
} forall settextposition
} bdef
.setglobal