diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/spec-fdf.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/spec-fdf.tex | 99 |
1 files changed, 65 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/context/base/spec-fdf.tex b/Master/texmf-dist/tex/context/base/spec-fdf.tex index fbb88677281..51da45ff7a6 100644 --- a/Master/texmf-dist/tex/context/base/spec-fdf.tex +++ b/Master/texmf-dist/tex/context/base/spec-fdf.tex @@ -177,6 +177,7 @@ \def\checkPDFextgstates {\ifx\docuPDFextgstates\empty \else \ifnum\realpageno=\lastpage\relax + %\doPDFreserveddictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}% \doPDFdictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}% \fi \doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference @@ -197,6 +198,7 @@ \def\checkPDFcolorspaces {\ifx\docuPDFcolorspaces\empty \else \ifnum\realpageno=\lastpage\relax + %\doPDFreserveddictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}% \doPDFdictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}% \fi \doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference @@ -217,6 +219,7 @@ \def\checkPDFshades {\ifx\docuPDFshades\empty \else \ifnum\realpageno=\lastpage\relax + %\doPDFreserveddictionaryobject{FDF}{docushades}{\docuPDFshades}% \doPDFdictionaryobject{FDF}{docushades}{\docuPDFshades}% \fi \doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference @@ -307,12 +310,9 @@ \def\doPDFsetupwhateverbox#1#2#3#4#5#6% watch the extra arguments {\bgroup - \!!widtha#5% - \advance\!!widtha#3% - \!!heighta-#6% - \!!heightb#2% extra argument - \advance\!!heightb -#4% - \advance\!!heighta \!!heightb + \!!widtha \dimexpr#5+#3\relax + \!!heightb\dimexpr#2-#4\relax + \!!heighta\dimexpr\!!heightb-#6\relax % sometimes whole values give better results % \PointsToWholeBigPoints{#3}\left % \PointsToWholeBigPoints\!!heighta\bottom @@ -889,8 +889,8 @@ \@EA\processallactionsinset\@EA [#3] [\v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }]% -\collectdriverresource -% \flushatshipout % since it can be buried in a chained box + \collectdriverresource + %\flushatshipout % since it can be buried in a chained box {\doPDFannotation{0pt}{0pt} {/Subtype /Movie /Border [0 0 0] @@ -913,7 +913,7 @@ \def\doPDFattachfile#1#2#3#4#5#6#7#8% {\bgroup % title width height color symbol file - \edef\PDFfile{#8}\convertcommand\PDFfile\to\PDFfile + \edefconvertedargument\PDFfile{#8}% % beware: the symbol may (indirectly) use the file % reference when typesetting the object number; \presetPDFsymbolappearance{#5}{#6}{#2}{#3}{#4}% sets width/height @@ -934,17 +934,17 @@ % semi-public \def\doPDFembedfile#1#2#3% symbolic name | filename | user name - {\edef\PDFfile{#1}\convertcommand\PDFfile\to\PDFfile + {\edefconvertedargument\PDFfile{#1}% \doifnotflagged{a:\PDFfile}% {\doPDFfilestreamobject{PDFEF}{\PDFfile}{#2}{#3}% \doglobal\setflag{a:\PDFfile}}} \def\doPDFgetembeddedfilereference#1#2% - {\edef\PDFfile{#1}\convertcommand\PDFfile\to\PDFfile + {\edefconvertedargument\PDFfile{#1}% \doPDFgetobjectreference{PDFEF}\PDFfile#2} \def\doPDFgetembeddedfilestreamreference#1#2% - {\edef\PDFfile{#1}\convertcommand\PDFfile\to\PDFfile + {\edefconvertedargument\PDFfile{#1}% \doPDFgetfilestreamreference\PDFfile#2} % == \doPDFgetobjectreference{PDFFS}\PDFfile#2 \definespecial \doattachfile {\doPDFattachfile} @@ -2299,9 +2299,9 @@ \def/doVb##1##2 {\egroup\check\Value{##2}} % watch the space \def\check##1##2% {\def##1{##2} - \advance\scratchcounter by 1 + \advance\scratchcounter\plusone\relax \ifodd\scratchcounter \else - \convertcommand\Title\to\asciia + \defconvertedcommand\asciia\Title \global\setFDFfield{\asciia}{\Value} \doglobal\addtocommalist\Title\allFDFfields \fi} @@ -2421,9 +2421,13 @@ \long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8% % \@@DriverCommentLayer set otherwise {\bgroup % title width height color open symbol collect data \presetPDFsymbolappearance{#4}{#6}{#2}{#3}\!!zeropoint% sets width/height +% \doifelsenothing{#1} +% {\let\PDFidentifier\empty} +% {\def\PDFidentifier{/T (#1)}}% \doifelsenothing{#1} {\let\PDFidentifier\empty} - {\def\PDFidentifier{/T (#1)}}% + {\sanitizePDFencoding#1\to\PDFcommenttitle + \def\PDFidentifier{/T \ifPDFunicode <\PDFcommenttitle>\else (\PDFcommenttitle)\fi}}% \sanitizePDFencoding#8\to\PDFdata \setFDFlayer\@@DriverCommentLayer \startPDFsymbolappearance @@ -2886,17 +2890,51 @@ \definespecial\doregisterspotcolorname{\doPDFregisterspotcolorname} -\def\doPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b +\def\dodoPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}% {\ifcase#2\or dup #5 mul exch dup #6 mul exch #7 mul\else#5 #6 #7\fi}} -\def\doPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k +\def\dodoPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}% {\ifcase#2\or dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul\else #5 #6 #7 #8\fi}} -\def\doPDFregistergrayspotcolor#1#2#3#4#5% name noffractions names p's s +\def\dodoPDFregistergrayspotcolor#1#2#3#4#5% name noffractions names p's s {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% - {\ifcase#2\or pop\else#5\fi}} + {\ifcase#2\or #5 mul\else #5\fi}} + +% \let\doPDFregisterrgbspotcolor \dodoPDFregisterrgbspotcolor +% \let\doPDFregistercmykspotcolor\dodoPDFregistercmykspotcolor +% \let\doPDFregistergrayspotcolor\dodoPDFregistergrayspotcolor + +\def\doPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b + {\ifRGBsupported + \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}% + \else + \edef\@@cl@@r{#5}\edef\@@cl@@g{#6}\edef\@@cl@@b{#7}% + \ifCMYKsupported + \convertRGBtoCMYK\@@cl@@r\@@cl@@g\@@cl@@b + \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k + \else + \convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b + \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s + \fi + \fi} + +\def\doPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k + {\ifCMYKsupported + \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% + \else + \edef\@@cl@@c{#5}\edef\@@cl@@m{#6}\edef\@@cl@@y{#7}\edef\@@cl@@k{#8}% + \ifRGBsupported + \convertCMYKtoRGB\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k + \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}\@@cl@@r\@@cl@@g\@@cl@@b + \else + \convertCMYKtoGRAY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k + \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s + \fi + \fi} + +\def\doPDFregistergrayspotcolor{\dodoPDFregistergrayspotcolor} %D New and very experimental. @@ -2912,12 +2950,6 @@ {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% {pop}} -% \def\doPDFregisterfigurecolor#1% -% {\dogetobjectreference -% {PDF\ifcase\internalspotcolorsize{#1} CS\or CS\else IX\fi} -% {\internalspotcolorname{#1}} -% \PDFimagecolorreference} - \let\checkpredefinedcolor\predefineindexcolor % we need an index in order to negate bitmaps \def\doPDFregisterfigurecolor#1% always an index color @@ -3048,10 +3080,10 @@ {\ifx\initializePDFoverprint\undefined\else \initializePDFoverprint % \PDFdirectcode{/GSknockout gs}% - \PDFcode{/GSknockout gs}% + \PDFcode{/GSknockout gs}% wrong \fi} -%D Transparency support (experimental): +%D Transparency support: \newif\ifPDFtransparencysupported @@ -3066,11 +3098,9 @@ \def\dodoPDFstarttransparency#1#2% {\presetPDFtransparency{#1}{#2}% -% \PDFdirectcode{\PDFtransparencyidentifier\space gs }} \PDFcode{\PDFtransparencyidentifier\space gs }} \def\dodoPDFstoptransparency -% {\PDFdirectcode{/Tr0 gs }} {\PDFcode{/Tr0 gs }} \def\doPDFstarttransparency @@ -3242,7 +3272,8 @@ %D Handy for the \METAPOST\ to \PDF\ converter: -\newevery \everyPDFxform \relax % we can also use this one in meta-pdf +\newevery \everyPDFximage \relax +\newevery \everyPDFxform \relax \appendtoksonce \collectPDFresources @@ -3251,13 +3282,13 @@ \let\collectedPDFresources\empty -\def\collectPDFresources - {\doifobjectreferencefoundelse{FDF}{docushades} +\def\collectPDFresources % suboptimal + {\doifobjectreferencefoundelse{FDF}{docushades} % redundant, we have an reserved object now {\doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/Shading \PDFobjectreference}}\donothing + \xdef\collectedPDFresources{\collectedPDFresources/Shading \PDFobjectreference}}\donothing \doifobjectreferencefoundelse{FDF}{docuextgstates} {\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/ExtGState \PDFobjectreference}}\donothing + \xdef\collectedPDFresources{\collectedPDFresources/ExtGState \PDFobjectreference}}\donothing \doifobjectreferencefoundelse{FDF}{colorspaces} {\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference \xdef\collectedPDFresources{\collectedPDFresources/ColorSpace \PDFobjectreference}}\donothing |