[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: cleaning up (b2f982a)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Aug 25 19:09:39 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : backendtest
Link       : https://github.com/latex3/pdfresources/commit/b2f982a1314b80ee7943c6ae27cbdfcca74054ec

>---------------------------------------------------------------

commit b2f982a1314b80ee7943c6ae27cbdfcca74054ec
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Aug 25 19:09:39 2019 +0200

    cleaning up


>---------------------------------------------------------------

b2f982a1314b80ee7943c6ae27cbdfcca74054ec
 pdfresources.dtx | 77 +++++++++++++++++++++++++++-----------------------------
 1 file changed, 37 insertions(+), 40 deletions(-)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index 628d266..a4e9dd5 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2349,46 +2349,6 @@
   }
 %    \end{macrocode}
 
-% ??????????
-%    \begin{macrocode}
-\cs_set_eq:NN \pdf_link_margin:n \@@_backend_link_margin:n
-\cs_set_eq:NN \pdf_link_last: \@@_backend_link_last:
-%    \end{macrocode}
-
-% \subsection{Setting / comparing pdf versions}
-% The code assumes that the versions are two integers separated by a period.
-% The pdf version should be set rather early, before any object has been written.
-% So we define a \cs{documentsetup} commmand which should go before \cs{documentclass}
-% \begin{macro}{\documentsetup}
-%    \begin{macrocode}
-
-\NewDocumentCommand\documentsetup { m }
- {
-  \cs_if_eq:NNTF \documentclass \@twoclasseserror
-   {\msg_error:nn {pdf}{setup-after-documentclass }}
-   {\keys_set:nn { pdf / setup } { #1 }}
- }
-
-\keys_define:nn { pdf / setup }
- {
-  pdfversion .code:n =
-   {
-    \pdf_version_gset:n { #1 }
-    \@@_version_checks:
-   }
- }
-\cs_new_protected:Npn \@@_version_checks:
- {
-  \pdf_version_compare:NnT < { 1.5 }
-   {
-    \@@_backend_compress_objects:n {0}
-    \msg_info:nnx {pdf}{object-compression-disabled}
-    { \@@_backend_version_major:.\@@_backend_version_minor:}
-   }
- }
-
-%    \end{macrocode}
-% \end{macro}
 
 % \subsection{Higher-level link management}
 % \subsubsection{Startlink}
@@ -2483,6 +2443,12 @@
   { #2 }
 }
 %    \end{macrocode}
+%% ??????????
+%    \begin{macrocode}
+\cs_set_eq:NN \pdf_link_margin:n \@@_backend_link_margin:n
+\cs_set_eq:NN \pdf_link_last: \@@_backend_link_last:
+%    \end{macrocode}
+%
 % \subsection{Destinations}
 % The command expects a lower case argument, it is up to the package to
 % ensure this.
@@ -2551,6 +2517,37 @@
 \seq_new:N \l_@@_hook_link_begin_link_seq
 %    \end{macrocode}
 %
+% \section{Document metadata}
+% We plan a \cs{DeclareDocumentMetaData} so let's start with it.
+% It should allow to set the version, to uncompress a pdf, and set the language.
+% \begin{Function}[added=2019-08-25]{\DeclareDocumentMetaData}
+%    \begin{macrocode}
+\NewDocumentCommand\DeclareDocumentMetaData { m }
+  {
+    \cs_if_eq:NNTF \documentclass \@twoclasseserror
+      { \msg_error:nn { pdf }{ setup-after-documentclass } }
+      { \keys_set:nn  { pdf / setup } { #1 } }
+  }
+
+\keys_define:nn { pdf / setup }
+  {
+    pdfversion .code:n =
+      {
+        \pdf_version_gset:n { #1 }
+      },
+    uncompress .code:n =
+      {
+        \pdf_uncompress:
+      },
+    lang .code:n =
+      {
+        \pdf_catalog_gput:nn {Lang}{(#1)}
+      }
+  }
+
+%    \end{macrocode}
+% \end{macro}
+
 % \section{Hook management}
 % hooks are commands that allow users and other packages to inject code.
 %





More information about the latex3-commits mailing list