+% Careful with double % as comment prefix.
+% Any %%X comment is interpreted as DSC comments.
+
+% TODO: use dicts or prefixes to prevent namespace pollution.
+
+/pdfmark where
+{pop} {userdict /pdfmark /cleartomark load put} ifelse
+
+% from adobe tech note 5002.
+/BeginEPSF { %def
+ /b4_Inc_state save def % Save state for cleanup
+ /dict_count countdictstack def % Count objects on dict stack
+ /op_count count 1 sub def % Count objects on operand stack
+ userdict begin % Push userdict on dict stack
+ /showpage { } def % Redefine showpage, { } = null proc
+ 0 setgray 0 setlinecap % Prepare graphics state
+ 1 setlinewidth 0 setlinejoin
+ 10 setmiterlimit [ ] 0 setdash newpath
+ /languagelevel where % If level not equal to 1 then
+ {pop languagelevel % set strokeadjust and
+ 1 ne % overprint to their defaults.
+ {false setstrokeadjust false setoverprint
+ } if
+ } if