[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: more work on resources (6da7c25)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sun May 19 23:56:24 CEST 2019
Repository : https://github.com/latex3/pdfresources
On branch : testlinkstuff
Link : https://github.com/latex3/pdfresources/commit/6da7c25deb09699c37555da0684b15fb46b4fc96
>---------------------------------------------------------------
commit 6da7c25deb09699c37555da0684b15fb46b4fc96
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun May 19 23:56:24 2019 +0200
more work on resources
>---------------------------------------------------------------
6da7c25deb09699c37555da0684b15fb46b4fc96
.gitignore | 2 +
.../test-pageresource-beamer.tex | 15 +++++++-
pageresources.tex | 2 +-
test-pageresource.tex | 40 +++++++++++++++++---
4 files changed, 50 insertions(+), 9 deletions(-)
diff --git a/.gitignore b/.gitignore
index b7a239d..6960900 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@ build/*
*.glo
*.idx
*.hd
+*.nav
+*.snm
tex/*
ls-R
*.dvi
diff --git a/test-pageresource.tex b/experiments/test-pageresource-beamer.tex
similarity index 82%
copy from test-pageresource.tex
copy to experiments/test-pageresource-beamer.tex
index 93bd913..a05b5e7 100644
--- a/test-pageresource.tex
+++ b/experiments/test-pageresource-beamer.tex
@@ -1,6 +1,7 @@
% !Mode:: "TeX:UTF-8:Main"
-\documentclass[12pt,oneside]{article}
-\usepackage[patches]{pdfresources}
+\RequirePackage[patches]{pdfresources}
+\documentclass{beamer}
+
\usepackage{tikz,xcolor,l3str-convert}
\usepackage{transparent}
\ExplSyntaxOn
@@ -22,10 +23,20 @@
\driver_pdf_pageresources_gput:nnnx{1}{ColorSpace}{foo}{\driver_pdf_object_ref:n{spotcolor_obj}}
\ExplSyntaxOff
\begin{document}
+\begin{frame}
\color{red}
Hello
\pdfliteral{/foo cs /foo CS 1 sc 1 SC}
world
+\end{frame}
+
+\begin{frame}
+\color{red}
+Hello
+\pdfliteral{/foo cs /foo CS 1 sc 1 SC}
+world
+\end{frame}
+
\end{document}
abc
diff --git a/pageresources.tex b/pageresources.tex
index 5c50f4e..3015f63 100644
--- a/pageresources.tex
+++ b/pageresources.tex
@@ -289,7 +289,7 @@ endobj
\end{description}
\subsection{Discussion}
-Some values in the catalog need special treatment. So we will have a central property for the catalog, and a number of special properties. An entry like Lang can be added to the catalog property, but e.g ViewerPreferences needs a special property, and the general prop should only contain the indirect reference to the dict obj. Probably a number of tests are needed to prevent users to write into the wrong prop.
+Some values in the catalog need special treatment. So we will have a central property for the catalog, and a number of special properties. An entry like Lang can be added to the catalog property, but e.g ViewerPreferences needs a special property, and the general prop should only contain the indirect reference to the dict obj. Probably a number of tests are needed to prevent users to write into the wrong prop. Check when the catalog is written and when the last changes can be added. Is e.g. end document to late for beamer?
\begin{itemize}
\item Collection: unclear
diff --git a/test-pageresource.tex b/test-pageresource.tex
index 93bd913..03eb1fa 100644
--- a/test-pageresource.tex
+++ b/test-pageresource.tex
@@ -1,7 +1,8 @@
% !Mode:: "TeX:UTF-8:Main"
\documentclass[12pt,oneside]{article}
\usepackage[patches]{pdfresources}
-\usepackage{tikz,xcolor,l3str-convert}
+\usepackage{tikz,colorspace}
+\usepackage{l3str-convert}
\usepackage{transparent}
\ExplSyntaxOn
\driver_pdf_compresslevel:n {0}
@@ -11,21 +12,48 @@
\driver_pdf_object_new:nn {spotcolor_obj}{array}
\cs_generate_variant:Nn \driver_pdf_object_write:nn {nx}
+
\str_set_convert:Nnnn \l_tmpa_str {BarTone~555~GN}{utf8}{utf8/name}
-\str_show:N\l_tmpa_str
+
\driver_pdf_object_write:nx{spotcolor_obj}
{
/Separation~/\l_tmpa_str~ /DeviceCMYK
<< /C0~[0~0~0~0] /FunctionType~2 /C1 [0.8~0.2~0.5~0.3] /Domain [0~1] /N~1 >>
}
-\cs_generate_variant:Nn \driver_pdf_pageresources_gput:nnnn {nnnx}
-\driver_pdf_pageresources_gput:nnnx{1}{ColorSpace}{foo}{\driver_pdf_object_ref:n{spotcolor_obj}}
+\cs_generate_variant:Nn \pdf_pageresources_gput:nnnn {nnnx}
+\pdf_pageresources_gput:nnnx{1}{ColorSpace}{foo}{\driver_pdf_object_ref:n{spotcolor_obj}}
+
+
+% colorspace is basically broken. One can readd the object to the ColorSpace but to really work
+% the package must be rewritten or avoided ...
+\cs_new:Npn \uf_storespotcolor_aux:w /#1~#2\q_stop
+ {
+ \pdf_pageresources_gput:nnn {ColorSpace}{#1}{#2}
+ }
+
+\NewDocumentCommand\storespotcolor{m}
+ {
+ \exp_last_unbraced:Nx \uf_storespotcolor_aux:w {\str_use:c{spc at ir@#1}} \q_stop
+ }
+
+
\ExplSyntaxOff
+\definespotcolor{spot}{Spotcolor}{0.85 0.75 0 0}
+\storespotcolor {spot}
+
\begin{document}
-\color{red}
+
+{%\color{red}
Hello
\pdfliteral{/foo cs /foo CS 1 sc 1 SC}
-world
+world}
+
+\newpage
+hello
+\pdfliteral{/foo cs /foo CS 1 sc 1 SC}
+abc
+
+\newpage \color{spot} xxxxxxxxxxxx
\end{document}
abc
More information about the latex3-commits
mailing list