| 1 |
% $Id: test-shipout.tex 910 2023-08-26 17:47:24Z karl $ |
| 2 |
% Public domain. Originally by Phelype Oleinik, 2023. |
| 3 |
% Test `shipout' keyword on \special and \pdfliteral to delay expansion. |
| 4 |
|
| 5 |
\catcode`\{=1 \catcode`\}=2 |
| 6 |
\output={\global\advance\count0 by 1 \shipout\box255 } |
| 7 |
|
| 8 |
\pdfoutput=1 |
| 9 |
\pdfcompresslevel=0 |
| 10 |
\pdfobjcompresslevel=0 |
| 11 |
\hsize=4.6cm |
| 12 |
\pdfpagewidth=\hsize |
| 13 |
\hoffset=-1in |
| 14 |
\topskip=10pt |
| 15 |
\baselineskip=12pt |
| 16 |
\vsize=\dimexpr\topskip+3\baselineskip\relax |
| 17 |
\pdfpageheight=\vsize |
| 18 |
\voffset=-1in |
| 19 |
\parindent=0pt |
| 20 |
|
| 21 |
\font\f = cmr10 \f |
| 22 |
|
| 23 |
\def\!{\ifodd\count0 0\else 1\fi} |
| 24 |
\def\0{\pdfliteral {0 g}} |
| 25 |
|
| 26 |
\def\text{% |
| 27 |
\pdfliteral direct {\! 1 0 0 k}1hello\01 % |
| 28 |
\special {PDF:direct:\! g}2hello\02 % |
| 29 |
\pdfliteral shipout direct {\! 1 0 0 k}3hello\03 % |
| 30 |
\special shipout {PDF:direct:\! g}4hello\04 % |
| 31 |
} |
| 32 |
|
| 33 |
\text \text \text \text |
| 34 |
\text \text \text \text |
| 35 |
\text \text \text \text |
| 36 |
\text \text \text \text |
| 37 |
|
| 38 |
\end |