summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/spec-fdf.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/spec-fdf.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/spec-fdf.tex41
1 files changed, 30 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/context/base/spec-fdf.tex b/Master/texmf-dist/tex/context/base/spec-fdf.tex
index 853dbb678a6..5f759941bc0 100644
--- a/Master/texmf-dist/tex/context/base/spec-fdf.tex
+++ b/Master/texmf-dist/tex/context/base/spec-fdf.tex
@@ -59,7 +59,14 @@
\newif\ifovercomePDFbugs \overcomePDFbugsfalse % dest sort problem / 3-
\newif\ifovercomePDFspace \overcomePDFspacetrue % dest sort problem / 3-
-\newif\ifovercomePDFpage \overcomePDFpagetrue % pdf spec change / 5+
+
+% the pdf spec changed cq. viewers started behaving differently / 5+
+
+\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one
+\chardef\overcomePDFpage\plustwo % page:number
+%chardef\overcomePDFpage\plusthree % pdftex page ref feature
+
+\ifx\pdfpageref\undefined \else \chardef\overcomePDFpage\plusthree \fi
\chardef\safePDFcode=`-
@@ -399,6 +406,9 @@
\doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}%
\doPDFaddtoinfo{/Trapped /False}%
\doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}%
+ \doPDFaddtoinfo{/ConTeXt.Time (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}%
+ \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}%
+ \doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}%
\to \everyfirstshipout
\def\PDFversion{1.5}
@@ -453,13 +463,17 @@
\def\doPDFsetupidentity#1#2#3#4#5#6%
{\bgroup
\enablePDFdocencoding
+ \edef\!!stringa{#5}%
+ \ifx\!!stringa\empty \ifx\pdfdate\undefined\else
+ \edef\!!stringa{D:\pdfdate}%
+ \fi \fi
\expanded{\doPDFaddtoinfo
{/Title (#1)
/Subject (#2)
/Author (#3)
/Creator (#4)
- /ModDate (#5)
- /ID (\jobname.#5) % needed for pdf/x
+ /ModDate (\!!stringa)
+ /ID (\jobname.\!!stringa) % needed for pdf/x
/Keywords (#6)}}%
\egroup}
@@ -653,7 +667,6 @@
\doifelsenothing{#3}% #1 = url
{\scratchcounter0#5\relax
\ifnum\scratchcounter>0
- \advance\scratchcounter \minusone % pdf starts numbering at zero
\doifelsenothing{#4}
{\let\PDFfile\empty}
{\expanded{\beforesplitstring#4}\at.\to\PDFfile
@@ -663,12 +676,18 @@
{\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile
\edef\PDFfile{R /F (\PDFfile)\PDFgotonewwindow}}}%
\ifx\PDFfile\empty
- \ifovercomePDFpage % a named page ref
- \edef\PDFdestination{(page:\the\scratchcounter)}%
- \else % beware: optimizers remove this one
+ \ifcase\overcomePDFpage
+ \or % pdf starts numbering at zero
+ \advance\scratchcounter \minusone
\edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}%
+ \or % pdf starts numbering at zero
+ \advance\scratchcounter \minusone
+ \edef\PDFdestination{(page:\the\scratchcounter)}%
+ \or % pdftex starts numbering at one
+ \edef\PDFdestination{[\pdfpageref\scratchcounter\space0 R \PDFpageviewwrd]}%
\fi
- \else % across files it's a page number
+ \else % across files it's a page number / pdf starts numbering at zero
+ \advance\scratchcounter \minusone
\edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}%
\fi
\edef\action{/S /GoTo\PDFfile\space /D \PDFdestination}%
@@ -694,7 +713,7 @@
\let\lastfakedPDFpage\!!zerocount
\def\fakePDFpagedestination % as in pdf, we start numbering at zero
- {\iflocation \ifovercomePDFpage \ifarrangingpages \else
+ {\iflocation \ifarrangingpages \ifnum\overcomePDFpage=\plustwo \else
\ifnum\lastfakedPDFpage<\realpageno
\bgroup
\xdef\lastfakedPDFpage{\realfolio}%
@@ -973,8 +992,8 @@
\@EA\processallactionsinset\@EA
[#9]
[\v!controls=>\donetrue,
- \v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat },
- \v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]%
+ \v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat },
+ \v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]%
\edef\pdf@@actions{\pdf@@actions /ShowControls \ifdone true\else false\fi}%
\doPDFannotation width #7 height #8 data
{/Subtype /Movie