[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: first changes pageattr -> pdfdict (792c00b)
Ulrike Fischer
fischer at troubleshooting-tex.de
Fri Apr 10 18:29:22 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : renamedict77
Link : https://github.com/latex3/pdfresources/commit/792c00b080a5a3b02dc9dbe63f35d1864146c622
>---------------------------------------------------------------
commit 792c00b080a5a3b02dc9dbe63f35d1864146c622
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Fri Apr 10 18:29:22 2020 +0200
first changes pageattr -> pdfdict
>---------------------------------------------------------------
792c00b080a5a3b02dc9dbe63f35d1864146c622
hgeneric-experimental.def | 4 ++--
pdfresources.dtx | 14 ++++++++++++++
testfiles/mixpageattr.pvt | 4 ++--
testfiles/pageattr.pvt | 10 +++++-----
4 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index 894990f..d1af860 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -1421,7 +1421,7 @@
\pdf_pageattr_gremove:n {Trans}
\tl_if_empty:NF \@pdfpagetransition
{
- \pdf_pageattr_gput:nn {Trans}{<< /S /\@pdfpagetransition\space >>}
+ \pdfdict_put:nnx {Page} {Trans}{<< /S /\@pdfpagetransition\space >>}
}
\fi
}
@@ -1432,7 +1432,7 @@
\pdf_pageattr_gremove:n {Dur}
\tl_if_empty:NF \@pdfpageduration
{
- \pdf_pageattr_gput:nn {Dur}{\@pdfpageduration\space}
+ \pdfdict_put:nnx {Page} {Dur}{\@pdfpageduration\space}
}
\fi
}
diff --git a/pdfresources.dtx b/pdfresources.dtx
index a255d22..653c937 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -1191,6 +1191,13 @@
}
\cs_generate_variant:Nn \pdf_pageattr_gput:nn {nx}
+
+%handler for pdfdict
+\cs_new_protected:cpn { @@_dict_/Page/?_gput:nn } #1 #2
+ {
+ \prop_gput:cnn { \@@_dict_Xname:n { ThisPage } }{ #1 } { #2 }
+ \@@_backend_Page_gput:nn { #1 }{ #2 }
+ }
% remove:
%^^A documentated
\cs_new_protected:Npn \pdf_pageattr_gremove:n #1
@@ -1202,11 +1209,18 @@
%^^A documentated
\cs_new_protected:Npn \pdf_thispageattr_gput:nn #1 #2
{
+ \prop_gput:cnn { \@@_dict_Xname:n { ThisPage } }{ #1 } { #2 }
\@@_backend_PageN_gput:nn { #1 }{ #2 }
}
\cs_generate_variant:Nn \pdf_thispageattr_gput:nn {nx}
+% handler for pdfdict
+\cs_new_protected:cpn { @@_dict_/ThisPage/?_gput:nn } #1 #2
+ {
+ \@@_backend_PageN_gput:nn { #1 }{ #2 }
+ }
+
% \end{macrocode}
%
% \subsection{pdfdict: \enquote{Info} (pdfinfo)}
diff --git a/testfiles/mixpageattr.pvt b/testfiles/mixpageattr.pvt
index 3ec11c3..3329cf8 100644
--- a/testfiles/mixpageattr.pvt
+++ b/testfiles/mixpageattr.pvt
@@ -5,7 +5,7 @@
\usepackage{fancyhdr,zref-user}
\pagestyle{fancy}
\ExplSyntaxOn \makeatletter
-\lfoot{\pdf_pageattr_gput:nx {Rotate}{\ifodd\c at page -90\else 90 \fi}}
+\lfoot{\pdfdict_put:nnx {Page} {Rotate}{\ifodd\c at page -90\else 90 \fi}}
\ExplSyntaxOff
\usepackage{kantlipsum}
\begin{document}
@@ -16,7 +16,7 @@ some text \kant
\ExplSyntaxOn
\begin{figure}%[p]
\zlabel{a}\label{a}
-\pdf_thispageattr_gput:nx{Rotate}{90}
+\pdfdict_put:nnx {ThisPage}{Rotate}{90}
\Huge
code~is~on~page~\thepage\par
float~is~on~page~\zpageref{a}\par
diff --git a/testfiles/pageattr.pvt b/testfiles/pageattr.pvt
index 15e4115..31c0353 100644
--- a/testfiles/pageattr.pvt
+++ b/testfiles/pageattr.pvt
@@ -6,16 +6,16 @@
\START
some text
\ExplSyntaxOn
- \pdf_pageattr_gput:nn {Rotate}{90}
+ \pdfdict_put:nnn {Page} {Rotate}{90}
%test local:
-{\pdf_pageattr_gput:nn {CropBox}{[0~0~300~350]}}
+{\pdfdict_put:nnn {Page} {CropBox}{[0~0~300~350]}}
%test doublette
- \pdf_pageattr_gput:nn {Rotate}{90}
+ \pdfdict_put:nnn {Page} {Rotate}{90}
%test command:
\newcommand\attributecontent{(somesetting)}
-\exp_args:Nno\pdf_pageattr_gput:nn {SSS}{\attributecontent}
+\exp_args:Nno\pdfdict_put:nnn {Page} {SSS}{\attributecontent}
\newpage
\pdf_pageattr_gremove:n {Rotate}
@@ -23,7 +23,7 @@ some text
some text more text
\begin{figure}[p]
\rule{1cm}{15cm}
-\pdf_thispageattr_gput:nn{Rotate}{-90}
+\pdfdict_put:nnn {ThisPage}{Rotate}{-90}
\end{figure}
\newpage
abbb
More information about the latex3-commits
mailing list.