[latex3-commits] [git/LaTeX3-latex3-latex3] master: Setting for PDF version (e98931e)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Apr 11 23:22:59 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/e98931e23303ac08bdeed07c11769b892a404abc

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

commit e98931e23303ac08bdeed07c11769b892a404abc
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Apr 11 22:22:51 2019 +0100

    Setting for PDF version
    
    At present, all the major version stuff is a no-op ...


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

e98931e23303ac08bdeed07c11769b892a404abc
 l3kernel/l3drivers-pdf.dtx              |   63 +++++++++++++++++++++++++++++--
 l3kernel/l3drivers.dtx                  |   21 +++++++++--
 l3kernel/testfiles/m3expl001.luatex.tlg |    3 ++
 l3kernel/testfiles/m3expl001.ptex.tlg   |    3 ++
 l3kernel/testfiles/m3expl001.tlg        |    3 ++
 l3kernel/testfiles/m3expl001.uptex.tlg  |    3 ++
 l3kernel/testfiles/m3expl001.xetex.tlg  |    3 ++
 l3kernel/testfiles/m3expl003.luatex.tlg |    3 ++
 l3kernel/testfiles/m3expl003.ptex.tlg   |    3 ++
 l3kernel/testfiles/m3expl003.tlg        |    3 ++
 l3kernel/testfiles/m3expl003.uptex.tlg  |    3 ++
 l3kernel/testfiles/m3expl003.xetex.tlg  |    3 ++
 12 files changed, 106 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index 06514a5..d3d4131 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -334,9 +334,19 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[EXP]{\driver_pdf_version_minor:}
+% \begin{macro}
+%   {\driver_pdf_version_major_gset:n, \driver_pdf_version_minor_gset:n}
 %   Data not available!
 %    \begin{macrocode}
+\cs_new_protected:Npn \driver_pdf_version_major_gset:n #1 { }
+\cs_new_protected:Npn \driver_pdf_version_minor_gset:n #1 { }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\driver_pdf_version_major:, \driver_pdf_version_minor:}
+%   Data not available!
+%    \begin{macrocode}
+\cs_new:Npn \driver_pdf_version_major: { -1 }
 \cs_new:Npn \driver_pdf_version_minor: { -1 }
 %    \end{macrocode}
 % \end{macro}
@@ -545,10 +555,28 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[EXP]{\driver_pdf_version_minor:}
+% \begin{macro}
+%   {\driver_pdf_version_major_gset:n, \driver_pdf_version_minor_gset:n}
+%   At present, we don't have a primitive for the major version!
 %    \begin{macrocode}
+\cs_new_protected:Npn \driver_pdf_version_major_gset:n #1 { }
+\cs_new_protected:Npx \driver_pdf_version_minor_gset:n #1
+  {
+    \cs_if_exist:NTF \tex_pdfminorversion:D
+      { \exp_not:N \tex_pdfminorversion:D }
+      { \tex_pdfvariable:D minorversion }
+        \exp_not:N \int_eval:n {#1} \scan_stop:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\driver_pdf_version_major:, \driver_pdf_version_minor:}
+%   At present, we don't have a primitive for the major version!
+%    \begin{macrocode}
+\cs_new:Npx \driver_pdf_version_major: { 1 }
 \cs_new:Npx \driver_pdf_version_minor:
   {
+    \exp_not:N \tex_the:D
     \cs_if_exist:NTF \tex_pdfminorversion:D
       { \exp_not:N \tex_pdfminorversion:D }
       { \tex_pdfvariable:D minorversion }
@@ -741,9 +769,26 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[EXP]{\driver_pdf_version_minor:}
+% \begin{macro}
+%   {\driver_pdf_version_major_gset:n, \driver_pdf_version_minor_gset:n}
+%   We start with the assumption that the default is active.
+%    \begin{macrocode}
+\cs_new_protected:Npn \driver_pdf_version_major:n #1
+  {
+    \cs_gset:Npx \driver_pdf_version_major: { \int_eval:n {#1} }
+  }
+\cs_new_protected:Npn \driver_pdf_version_minor:n #1
+  {
+    \cs_gset:Npx \driver_pdf_version_minor: { \int_eval:n {#1} }
+    \@@_literal:x { dvipdfmx:config~V~ \driver_pdf_version_minor: }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\driver_pdf_version_major:, \driver_pdf_version_minor:}
 %   We start with the assumption that the default is active.
 %    \begin{macrocode}
+\cs_new:Npn \driver_pdf_version_major: { 1 }
 \cs_new:Npn \driver_pdf_version_minor: { 5 }
 %    \end{macrocode}
 % \end{macro}
@@ -786,9 +831,19 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[EXP]{\driver_pdf_version_minor:}
+% \begin{macro}
+%   {\driver_pdf_version_major_gset:n, \driver_pdf_version_minor_gset:n}
+%   Data not available!
+%    \begin{macrocode}
+\cs_new_protected:Npn \driver_pdf_version_major_gset:n #1 { }
+\cs_new_protected:Npn \driver_pdf_version_minor_gset:n #1 { }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\driver_pdf_version_major:, \driver_pdf_version_minor:}
 %   Data not available!
 %    \begin{macrocode}
+\cs_new:Npn \driver_pdf_version_major: { -1 }
 \cs_new:Npn \driver_pdf_version_minor: { -1 }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 65770f4..24581f4 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -573,13 +573,26 @@
 %   be set only once.
 % \end{function}
 %
-% \begin{function}[EXP, added = 2019-04-09]{\driver_pdf_version_minor:}
+% \begin{function}[EXP, added = 2019-04-11]
+%   {\driver_pdf_version_major:, \driver_pdf_version_minor:}
 %   \begin{syntax}
+%     \cs{driver_pdf_version_major:}
 %     \cs{driver_pdf_version_minor:}
 %   \end{syntax}
-%   Expands to the current value of the minor version of PDF being created, a
-%   non-negative integer. Where a value is not available at the \TeX{} run
-%   level, the result is $-1$.
+%   Expands to the current value of the major or minor version of PDF being
+%   created, a non-negative integer. Where a value is not available at the
+%   \TeX{} run level, the result is $-1$. (This is necessary as the minor
+%   version may be $0$.)
+% \end{function}
+%
+% \begin{function}[EXP, added = 2019-04-11]
+%   {\driver_pdf_version_major_gset:n, \driver_pdf_version_minor_gset:n}
+%   \begin{syntax}
+%     \cs{driver_pdf_version_major_gset:n} \arg{integer}
+%     \cs{driver_pdf_version_minor_gset:n} \arg{integer}
+%   \end{syntax}
+%   Sets the PDF version as specified: the allowable range is not checked
+%   at this level.
 % \end{function}
 %
 % \end{documentation}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index b1a1c66..b88f0f3 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -6479,6 +6479,9 @@ Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
 Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_version_major_gset:n on line ...
+Defining \driver_pdf_version_minor_gset:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 130459f..be80382 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -6529,6 +6529,9 @@ Defining \driver_pdf_link_margin:n on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_version_major:n on line ...
+Defining \driver_pdf_version_minor:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index e43db86..6c90a4b 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -6820,6 +6820,9 @@ Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
 Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_version_major_gset:n on line ...
+Defining \driver_pdf_version_minor_gset:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 49b8934..2c2aee5 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -6826,6 +6826,9 @@ Defining \driver_pdf_link_margin:n on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_version_major:n on line ...
+Defining \driver_pdf_version_minor:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index e3ca4a8..dbe0206 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -6505,6 +6505,9 @@ Defining \driver_pdf_link_margin:n on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_version_major:n on line ...
+Defining \driver_pdf_version_minor:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index b1a1c66..b88f0f3 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -6479,6 +6479,9 @@ Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
 Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_version_major_gset:n on line ...
+Defining \driver_pdf_version_minor_gset:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 130459f..be80382 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -6529,6 +6529,9 @@ Defining \driver_pdf_link_margin:n on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_version_major:n on line ...
+Defining \driver_pdf_version_minor:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index e43db86..6c90a4b 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -6820,6 +6820,9 @@ Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
 Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_version_major_gset:n on line ...
+Defining \driver_pdf_version_minor_gset:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 49b8934..2c2aee5 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -6826,6 +6826,9 @@ Defining \driver_pdf_link_margin:n on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_version_major:n on line ...
+Defining \driver_pdf_version_minor:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index e3ca4a8..dbe0206 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -6505,6 +6505,9 @@ Defining \driver_pdf_link_margin:n on line ...
 Defining \driver_pdf_compresslevel:n on line ...
 Defining \driver_pdf_objects_enable: on line ...
 Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_version_major:n on line ...
+Defining \driver_pdf_version_minor:n on line ...
+Defining \driver_pdf_version_major: on line ...
 Defining \driver_pdf_version_minor: on line ...
 )
 Defining \__expl_status_pop:w on line ...





More information about the latex3-commits mailing list