diff options
Diffstat (limited to 'tex/context/base/spec-tpd.tex')
-rw-r--r-- | tex/context/base/spec-tpd.tex | 90 |
1 files changed, 51 insertions, 39 deletions
diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex index bf062854b..ed8ae3ac1 100644 --- a/tex/context/base/spec-tpd.tex +++ b/tex/context/base/spec-tpd.tex @@ -11,15 +11,15 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% method = auto +% method = auto % % \definefileinsertion{tpd}{auto}#1#2#3#4#5#6#7#8#9% -% {\executesystemcommand{t:/ruby/pstopdf.rb #2}% +% {\executesystemcommand{t:/ruby/pstopdf.rb #2}% % \dodoinsertfile{tpd}{pdf}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}} - + % \let\PDFdestvoffset\zeropoint % \newbox\pdfdestbox -% +% % \def\doPDFdestination name #1% % {\ifdim\PDFdestvoffset=\zeropoint\relax % \pdfdest name {#1}\PDFpageviewkey @@ -29,7 +29,7 @@ % \ht\pdfdestbox\zeropoint % \box\pdfdestbox % \fi} -% +% % \def\PDFdestvoffset{2\lineheight} % {1.5\strutht} %D \macros @@ -88,20 +88,32 @@ \newcount\pdflastximagepages \pdflastximagepages=1 \fi -%D And: +%D And: -\ifx\pdfpageresources\undefined +\ifx\pdfpageresources\undefined \newtoks\pdfpageresources \fi %D In order to get high quality \METAPOST\ inclusion, we set -%D the number of digits to~5 (prevents rounding errors). +%D the number of digits to~5 (prevents rounding errors). \ifx\pdfdecimaldigits\undefined \newcount\pdfdecimaldigits \fi -\pdfdecimaldigits=5 +\pdfdecimaldigits=5 + +\ifx\pdfoptionpdfinclusionerrorlevel\undefined + \newcount\pdfoptionpdfinclusionerrorlevel +\fi + +\pdfoptionpdfinclusionerrorlevel=0 + +\ifx\pdfoptionpdfminorversion\undefined + \newcount\pdfoptionpdfminorversion +\fi + +\pdfoptionpdfminorversion=4 % %D Why are the Acrobat viewers so buggy? To prevent font cache % %D mismatches, we say: @@ -210,8 +222,8 @@ \definefileinsertion{tpd}{mps}#1#2#3#4#5#6#7#8#9% {\hbox {%\convertMPcolors{#1}% plugged in supp-mpe - \scratchdimen#3\s!pt \PointsToReal{.01\scratchdimen}\xscale - \scratchdimen#4\s!pt \PointsToReal{.01\scratchdimen}\yscale + \scratchdimen#3\points \PointsToReal{.01\scratchdimen}\xscale + \scratchdimen#4\points \PointsToReal{.01\scratchdimen}\yscale \convertMPtoPDF{#1}\xscale\yscale \global\let\PDFimagereference\empty}} @@ -477,7 +489,7 @@ %D \macros %D {dostarttransparency,dostoptransparency} %D -%D For transparency, we need to implement a couple of +%D For transparency, we need to implement a couple of %D auxiliary macros. If needed, we will generalize tham later. \definespecial\dostarttransparency{\doPDFstarttransparency} @@ -487,24 +499,24 @@ \def\@@PDT{@PDT@} -\newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 +\newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 \def\assignPDFtransparency#1#2% {\def\PDFtransparencyidentifier{/Tr#1}% - \def\PDFtransparencyreference{#2 0 R}} + \def\PDFtransparencyreference{#2 0 R}} -\def\presetPDFtransparency#1#2% - {\initializePDFtransparency +\def\presetPDFtransparency#1#2% + {\initializePDFtransparency \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}} -\def\dopresetPDFtransparency#1#2% +\def\dopresetPDFtransparency#1#2% {\global\advance\PDFcurrenttransparency \plusone \immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}% \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% \edef\PDFtransparencyreference {\the\pdflastobj\space 0 R}% \setxvalue{\@@PDT#1:#2}% {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\pdflastobj}}% - \appendtoPDFdocumentextgstates + \appendtoPDFdocumentextgstates {\PDFtransparencyidentifier\space \PDFtransparencyreference\space}} @@ -730,11 +742,11 @@ \def\dodostopobject {\egroup \ifx\PDFimagereference\empty - % We also flush page resources, since shared - % resources end up there; otherwise transparencies - % won't work in xforms; some day I will optimize - % this. - \immediate\pdfxform + % We also flush page resources, since shared + % resources end up there; otherwise transparencies + % won't work in xforms; some day I will optimize + % this. + \immediate\pdfxform resources {\currentPDFresources\the\pdfpageresources}% \nextbox \global\let\currentPDFresources\empty @@ -866,10 +878,10 @@ % \pdfsavepos % \doTPDsetposition % \egroup} -% +% % \definespecial\dosetposition#1% % {\doTPDsetposition{\pospxy}{#1}{}} -% +% % \definespecial\dosetpositionwhd#1#2#3#4% % {\doTPDsetposition{\pospxywhd}{#1}{{#2}{#3}{#4}}} @@ -918,14 +930,14 @@ \newif\ifsharePDFactions \sharePDFactionstrue -% hm, due to some stupid optimization this feature has been -% disabled for some time, watch out \lastPDFaction is to be +% hm, due to some stupid optimization this feature has been +% disabled for some time, watch out \lastPDFaction is to be % persistent \ifnum\pdftexversion>13 \def\doPDFaction width #1 height #2 action #3% - {\ifcollectreferenceactions + {\ifcollectreferenceactions \xdef\lastPDFaction{#3}% \else \ifsharePDFactions @@ -935,7 +947,7 @@ \immediate\pdfobj{<<#3>>}% \xdef\lastPDFaction{\the\pdflastobj\space0 R}% \else - % leave \lastPDFaction untouched + % leave \lastPDFaction untouched \fi \else \xdef\lastPDFaction{<<#3>>}% @@ -948,11 +960,11 @@ /A \lastPDFaction}% \fi} - % less #2 passing - + % less #2 passing + \def\doPDFaction width #1 height #2 action #3% {\xdef\lastPDFcontent{#3}% - \ifcollectreferenceactions + \ifcollectreferenceactions \global\let\lastPDFaction\lastPDFcontent \else \ifsharePDFactions @@ -962,7 +974,7 @@ \immediate\pdfobj{<<\lastPDFcontent>>}% \xdef\lastPDFaction{\the\pdflastobj\space0 R}% \else - % leave \lastPDFaction untouched + % leave \lastPDFaction untouched \fi \else \xdef\lastPDFaction{<<\lastPDFcontent>>}% @@ -978,7 +990,7 @@ \else \def\doPDFaction width #1 height #2 action #3% - {\ifcollectreferenceactions + {\ifcollectreferenceactions \xdef\lastPDFaction{#3}% \else \ifsharePDFactions @@ -988,7 +1000,7 @@ \immediate\pdfobj{<<#3>>}% \xdef\lastPDFaction{\the\pdflastobj\space0 R}% \else - % leave \lastPDFaction untouched + % leave \lastPDFaction untouched \fi \else \xdef\lastPDFaction{<<#3>>}% @@ -1139,9 +1151,9 @@ \appendtoPDFdocumentextgstates{/GSpositive \the\pdflastobj\space0 R}% \global\let\initializePDFnegative\relax} -%D File embedding. Storing the stream identifier is needed -%D to get access to the number. When typeset, the user can -%D use feed this number to \type {pdftosrc} and filter the +%D File embedding. Storing the stream identifier is needed +%D to get access to the number. When typeset, the user can +%D use feed this number to \type {pdftosrc} and filter the %D file from the \PDF\ file. \let\PDFlaststreamobject\s!unknown @@ -1153,7 +1165,7 @@ \doPDFdictionaryobject class {#1} name {#2} data {/Type /Filespec /F (#3) /EF <</F \PDFlaststreamobject\space0 R>>}} -\def\doPDFfilestreamidentifier#1% +\def\doPDFfilestreamidentifier#1% {\doifsomething{#1} {\doPDFgetobjectreference{PDFFS}{#1}\PDFobjectreference \@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject |