[latex3-commits] [git/LaTeX3-latex3-pdfresources] splitting: moved lua code to backend, tool code to tools, meta code to meta (2616bb0)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Jul 5 19:40:45 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : splitting
Link       : https://github.com/latex3/pdfresources/commit/2616bb02e4761a672129e12b923861aba3ce29cd

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

commit 2616bb02e4761a672129e12b923861aba3ce29cd
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Jul 5 19:40:45 2020 +0200

    moved lua code to backend, tool code to tools, meta code to meta


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

2616bb02e4761a672129e12b923861aba3ce29cd
 l3backend-pdf-extra.dtx                            | 126 +++++++-
 l3pdfmeta.dtx                                      |   2 +-
 l3pdftools.dtx                                     | 137 ++++++++
 pdfresources.dtx                                   | 343 +++------------------
 pdfresources.ins                                   |   2 +-
 .../bdc-properties-inactive.pvt                    |   0
 6 files changed, 301 insertions(+), 309 deletions(-)

diff --git a/l3backend-pdf-extra.dtx b/l3backend-pdf-extra.dtx
index 3689558..b8ca94c 100644
--- a/l3backend-pdf-extra.dtx
+++ b/l3backend-pdf-extra.dtx
@@ -88,7 +88,7 @@
 %<*pdfmode>
 \sys_if_engine_luatex:T
   {
-    \directlua { require("pdfresources.lua") }
+    \directlua { require("l3backend-pdf.lua") }
   }
 %</pdfmode>
 %    \end{macrocode}
@@ -1037,6 +1037,130 @@
 %</dvips>
 %    \end{macrocode}
 % \end{macro}
+% \subsection{lua code for lualatex}
+%    \begin{macrocode}
+%<*lua>
+l3kernel= l3kernel or {}
+l3kernel.@@      = l3kernel.@@ or {}
+l3kernel.@@.Page = l3kernel.@@.Page or {}
+l3kernel.@@.Page.dflt = l3kernel.@@.Page.dflt or {}
+l3kernel= l3kernel or {}
+l3kernel.@@.Page.Resources = l3kernel.@@.Resources or {}
+l3kernel.@@.Page.Resources.Properties = l3kernel.@@.Page.Resources.Properties or {}
+l3kernel.@@.Page.Resources.List={"ExtGState","ColorSpace","Pattern","Shading"}
+l3kernel.@@.object = l3kernel.@@.object or {}
+
+l3kernel.pdf= l3kernel.pdf or {} -- for "public" functions
+
+local @@ = l3kernel.@@
+local pdf = pdf
+
+local function @@_backend_Page_gput (name,value)
+ @@.Page.dflt[name]=value
+end
+
+local function @@_backend_Page_gremove (name)
+ @@.Page.dflt[name]=nil
+end
+
+local function @@_backend_Page_gclear ()
+ @@.Page.dflt={}
+end
+
+local function @@_backend_ThisPage_gput (page,name,value)
+ @@.Page[page] = @@.Page[page] or {}
+ @@.Page[page][name]=value
+end
+
+local function @@_backend_ThisPage_gpush (page)
+ local token=""
+ local t = {}
+ local tkeys= {}
+ for name,value in pairs(@@.Page.dflt) do
+   t[name]=value
+ end
+ if @@.Page[page] then
+  for name,value in pairs(@@.Page[page]) do
+   t[name] = value
+  end
+ end
+ -- sort the table to get reliable test files.
+ for name,value in pairs(t) do
+  table.insert(tkeys,name)
+ end
+ table.sort(tkeys)
+ for _,name in ipairs(tkeys) do
+   token = token .. "/"..name.." "..t[name]
+ end
+ return token
+end
+
+function l3kernel.@@.backend_ThisPage_gput (page,name,value) -- tex.count["g_shipout_readonly_int"]
+ @@_backend_ThisPage_gput (page,name,value)
+end
+
+function l3kernel.@@.backend_ThisPage_gpush (page)
+  pdf.setpageattributes(@@_backend_ThisPage_gpush (page))
+end
+
+function l3kernel.@@.backend_Page_gput (name,value)
+  @@_backend_Page_gput (name,value)
+end
+
+function l3kernel.@@.backend_Page_gremove (name)
+  @@_backend_Page_gremove (name)
+end
+
+function l3kernel.@@.backend_Page_gclear ()
+  @@_backend_Page_gclear ()
+end
+
+
+local Properties  = l3kernel.@@.Page.Resources.Properties
+local ResourceList= l3kernel.@@.Page.Resources.List
+local function @@_backend_PageResources_gpush (page)
+ local token=""
+ if Properties[page] then
+-- we sort the table, so that the pdf test works
+  local t = {}
+  for name,value in pairs  (Properties[page]) do
+   table.insert (t,name)
+  end
+  table.sort (t)
+  for _,name in ipairs(t) do
+   token = token .. "/"..name.." ".. Properties[page][name]
+  end
+  token = "/Properties <<"..token..">>"
+ end
+  for i,name in ipairs(ResourceList) do
+   if l3kernel.@@.Page.Resources[name] then
+   token = token .. "/"..name.." "..l3kernel.pdf.object_ref("Page/Resources/"..name)
+   end
+  end
+ return token
+end
+
+-- the function is public, as I probably need it in tagpdf too ...
+function l3kernel.pdf.Page_Resources_Properties_gput (page,name,value) -- tex.count["g_shipout_readonly_int"]
+ Properties[page] = Properties[page] or {}
+ Properties[page][name]=value
+ pdf.setpageresources(@@_backend_PageResources_gpush (page))
+end
+
+function l3kernel.pdf.Page_Resources_gpush(page)
+ pdf.setpageresources(@@_backend_PageResources_gpush (page))
+end
+
+function l3kernel.pdf.object_ref (objname)
+ if l3kernel.@@.object[objname] then
+  local ref= l3kernel.@@.object[objname]
+  return ref
+ else
+  return "false"
+ end
+end
+%</lua>
+%    \end{macrocode}
 % \end{implementation}
 %
 % \PrintIndex
diff --git a/l3pdfmeta.dtx b/l3pdfmeta.dtx
index 2d944b5..a11bdba 100644
--- a/l3pdfmeta.dtx
+++ b/l3pdfmeta.dtx
@@ -89,7 +89,7 @@
 % We plan a \cs{DeclareDocumentMetaData} so let's start with it.
 % It should for the begin allow to set the version, to uncompress a pdf,
 % and set the language. We also add a key to activate the metadata stream and
-% to set a standard. The code has been moved to l3pdfmeta.
+% to set a standard. 
 % \begin{NOTE}{UF}
 % how to setup a backend/driver key? Can it be copied from expl3?
 % \end{NOTE}
diff --git a/l3pdftools.dtx b/l3pdftools.dtx
index 093396c..1365cae 100644
--- a/l3pdftools.dtx
+++ b/l3pdftools.dtx
@@ -94,6 +94,114 @@
 %     this converts into utf16/hex and add bracket around.
 %   \end{description}
 % \end{function}
+%
+% \subsection{BDC operator / Properties resource}
+% \begin{NOTE}{UF}
+%  we need a switch for the case that the resource should be added to
+%  xform resource instead of a page resources, see pdfbase.sty
+% - xdvipdfmx: looks fine, the resource is added to the xform resource automatically
+% - pdftex should now work okay too
+% \end{NOTE}
+% Entries to the /Properties dictionary in the page resources can
+% be added with dvips only through side-effects: if a BDC-mark is created
+% dvips/ghostscript will automatically create the necessary objects and names.
+% To get a sensible abstraction the code does the same for the other backends if the
+% core management code has been activated. This means that the behaviour
+% of the command is different then. The \cs{pdf_bdc_obj:..} should only be used
+% if the management is active.
+% \begin{function}[updated = 2020-07-03]
+%   {
+%     \pdf_bdc:nn
+%   }
+%   \begin{syntax}
+%     \cs{pdf_bdc:nn} \Arg{tag} \Arg{dictionary content}
+%   \end{syntax}
+%    This command adds a BDC marked content operator to the current page stream.
+%   \meta{tag} is the tag of this operator (without the leading slash),
+%   \meta{dictionary content} is the content of the second argument.
+%   If the PDF resource management is active an dictionary object with the
+%   content is created and referenced with a name in the BDC operator.
+%   Without the resource management the content is used directly. It then
+%   depends on the backend how it is handled: with dvips a name is used
+%   while the pdfmode engines and dvipdfmx write the content into the stream.
+%
+% \end{function}
+% \begin{function}[added = 2020-07-03]
+%   {
+%     \pdf_bdc_obj:nn
+%   }
+%   \begin{syntax}
+%     \cs{pdf_bdc_obj:nn} \Arg{tag} \Arg{object name}
+%   \end{syntax}
+%   This command adds a BDC marked content operator to the current page stream.
+%   \meta{tag} is the tag of this operator (without the leading slash),
+%   \meta{object name}  is a the name of an dictionary object reserved with
+%   \cs{pdf_object_new:nn} and filled with \cs{pdf_object_write:n} with
+%   the properties of the BDC. Reusing a predefined object can save space
+%   but the command works correctly
+%   only if the resources management has been activated and should be used only
+%   if this can be ensured.
+% \end{function}
+% \begin{function}[updated = 2020-07-03]
+%   {
+%     \pdf_bdc_obj:n
+%   }
+%   \begin{syntax}
+%     \cs{pdf_bdc_obj:n} \Arg{tag}
+%   \end{syntax}
+%    This command adds a BDC marked content operator to the current page stream.
+%   \meta{tag} is the tag of this operator (without the leading slash).
+%   As object this commands uses the last anonymous dictionary object created with
+%   \cs{pdf_object_now:nn}. It lies in the responsibility of the user that the last
+%   object is the wanted one. Like with \cs{pdf_bdc_obj:nn} the command works correctly
+%   only if the resources management has been activated and should be used only
+%   if this can be ensured.
+% \end{function}
+% \begin{function}[added = 2019-10-17]
+%   {
+%     \pdf_bmc:n
+%   }
+%   \begin{syntax}
+%     \cs{pdf_bmc:n} \Arg{tag}
+%   \end{syntax}
+%    This command created a BMC marked content operator. The argument is the
+%    tag without the leading slash. It can be e.g. used for simple artifact
+%    markers.
+% \end{function}
+% \begin{function}[added = 2019-06-30]
+%   {
+%     \pdf_emc:
+%   }
+%   \begin{syntax}
+%     \cs{pdf_emc:}
+%   \end{syntax}
+%    This command closes the  BDC marked content operator opened with \cs{pdf_bdc:nn}.
+%    It should be on the same page as the bdc-command.
+%
+%   \begin{verbatim}
+%   \pdf_object_new:nn   {objA}{dict}
+%   \pdf_object_write:nn {objA}{/Type/Artifact}
+%   \pdf_bdc:nn {Span}{objA}
+%   text
+%   \pdf_emc:
+%   \end{verbatim}
+% \end{function}
+%
+%\subsection{references to page objects}
+% \begin{NOTE}{UF}
+% a reference to the current page would be useful, but difficult to
+% abstract in a sensible way. With xetex it is simply @thispage, but the other
+% engines are unclear.
+% \end{NOTE}
+% \begin{function}[EXP, added = 2019-08-18]
+%   {\pdf_pageobject_ref:n}
+%   \begin{syntax}
+%     \cs{pdf_pageobject_ref:n} \Arg{number}
+%   \end{syntax}
+%   This returns the object reference of a page object. The \Arg{number} is
+%   the absolute page number. The count starts with one.
+% \end{function}
+%
 % \end{documentation}
 %
 % \begin{implementation}
@@ -258,10 +366,39 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+%
+% \subsubsection{BDC  operator commands}
+% \begin{macro}{\pdf_bdc:nn}
+% \begin{macro}{\pdf_bdc_obj:nn}
+% \begin{macro}{\pdf_bdc_obj:n}
+% \begin{macro}{\pdf_bmc:n}
+% \begin{macro}{\pdf_emc:}
+%    \begin{macrocode}
+%<*package>
+\cs_new_protected:Npn  \pdf_bdc:nn #1 #2 { \@@_backend_bdc:nn { #1 }{ #2 } }
+\cs_new_protected:Npn  \pdf_bdc_obj:nn #1 #2 { \@@_backend_bdc_obj:nn { #1 }{ #2 } }
+\cs_new_protected:Npn  \pdf_bdc_obj:n #1     { \@@_backend_bdc_obj:n  { #1 } }
+\cs_new_protected:Npn  \pdf_bmc:n #1     { \@@_backend_bmc:n  { #1 } }
+\cs_new_protected:Npn  \pdf_emc:         { \@@_backend_emc: }
+%</package>
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 %
+% \subsection{Reference to the page object}
+% \begin{macro}{ \pdf_pageobject_ref:n }
+%    \begin{macrocode}
+%<*package>
+\cs_new:Npn \pdf_pageobject_ref:n #1 { \@@_backend_pageobject_ref:n { #1 }}
+%</package>
+%    \end{macrocode}
+% \end{macro}
 % \end{implementation}
 %
 % \PrintIndex
diff --git a/pdfresources.dtx b/pdfresources.dtx
index a92c111..0234cbb 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -118,35 +118,18 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \subsection{references to page objects}
-% \begin{NOTE}{UF}
-% a reference to the current page would be useful, but difficult to
-% abstract in a sensible way. With xetex it is simply @thispage, but the other
-% engines are unclear.
-% \end{NOTE}
-% \begin{function}[EXP, added = 2019-08-18]
-%   {\pdf_pageobject_ref:n}
-%   \begin{syntax}
-%     \cs{pdf_pageobject_ref:n} \Arg{number}
-%   \end{syntax}
-%   This returns the object reference of a page object. The \Arg{number} is
-%   the absolute page number. The count starts with one.
-% \end{function}
-% \begin{macro}{ \pdf_pageobject_ref:n }
-%    \begin{macrocode}
-%<*package>
-\cs_new:Npn \pdf_pageobject_ref:n #1 { \@@_backend_pageobject_ref:n { #1 }}
-%</package>
-%    \end{macrocode}
-% \end{macro}
-% This loads the dict packages.
+% This loads tools and the core code.
 % \begin{NOTE}{UF}
 % The loading order must be sorted ...
 % \end{NOTE}
 %    \begin{macrocode}
 %<*package>
 \RequirePackage{l3pdfdict}
+\RequirePackage{l3pdftools}
+\RequirePackage{l3pdfmeta} %
 \RequirePackage{l3pdfcoredict}
+% %load backend driver
+\file_input:n {l3\g__sys_backend_tl-pdf.def}
 %</package>
 %    \end{macrocode}
 %
@@ -169,11 +152,11 @@
 % \end{NOTE}
 %
 % \subsubsection{\enquote{Info}/backend}
-% The backend code is already in expl3.
+% The backend code is already in \pkg{expl3}.
 % \cs{@@_backend_info_gput:nn} inserts one name/value pair.
 %
 % \subsubsection{\enquote{Info}/management}
-% moved to l3pdfcoredict
+% moved to \pkg{l3pdfcoredict}
 %
 % \subsection{The \enquote{Pages} dictionary (pdfpagesattr)}
 % The content of the property list associated with this dictionary name is written to the
@@ -186,7 +169,7 @@
 %  dvipdfmx syntax: \verb+\special{pdf:put @pages <</ABC /WEZ /EFG /XYZ /Rotate 0>>}+
 %  both remove duplicate entries automatically, so there is no need to be careful.
 % \end{NOTE}
-%
+% The code is in the extra backend code in \pkg{l3backend-pdf-extra}.
 % \subsubsection{\enquote{Pages} / management}
 % \begin{NOTE}{UF}
 % The register is normally used only a few times in a document, so it would be
@@ -194,11 +177,11 @@
 % but with dvips/dvipdfmx this would disable removing entries.
 % So we issue the push code only at the end of the document.
 % \end{NOTE}
-%  code moved to l3pdfcoredict
+% The code has been moved to \pkg{l3pdfcoredict}
 %
 % \subsection{\enquote{Page} and \enquote{ThisPage} (pdfpageattr)}
 % \subsubsection{\enquote{Page} and \enquote{ThisPage} /backend}
-% moved to l3backend-pdf-extra
+% The code has been moved to \pgk{l3backend-pdf-extra}.
 % \subsubsection{\enquote{Page} and \enquote{ThisPage} / management}
 % \begin{NOTE}{UF}
 % Open is the question if one need a command to set attribute on a page by page number.
@@ -206,7 +189,7 @@
 % See also https://tex.stackexchange.com/questions/479812/extension-of-rotating-package-to-set-pdf-rotation
 % (should work now)
 % \end{NOTE}
-% code moved to l3pdfcoredict ...
+% The code has been moved to \pkg{l3pdfcoredict}.
 %
 % \subsection{\enquote{Page/Resources}: ExtGState, ColorSpace, Shading, Pattern }
 % \begin{NOTE}{UF}
@@ -223,12 +206,12 @@
 % As pgf does the same, there is a need to patch it for now. Ditto for package colorspace.
 % \end{NOTE}
 % \subsubsection{\enquote{Page/Resources}: ExtGState, ColorSpace, Shading, Pattern / backend}
-% moved to l3backend-pdf-extra
+% The code has been moved to \pkg{l3backend-pdf-extra}.
 %
 % \subsection{\enquote{Catalog} \& subdirectories (pdfcatalog) }
 % \subsubsection{\enquote{Catalog} \& subdirectories / backend}
-% the backend command is already in the driver:
-% \cs{@@_backend_catalog_gput:nn}
+% The backend command is already in the driver:
+% \cs{@@_backend_catalog_gput:nn}.
 %
 
 % \subsubsection{\enquote{Catalog} \& subdirectories / management }
@@ -251,6 +234,8 @@
 % /Acroform/DR/ExtGState etc probably unneeded.
 % \end{NOTE}
 %
+%  The code has been moved to \pkg{l3pdfcoredict}.
+%
 % \subsection{Local dictionaries}
 %
 % All dictionaries described above were global dictionaries and basically they
@@ -271,123 +256,11 @@
 %  annot/Link/Named  & used in Named actions (menu calls) \\
 %  annot/Link/Launch & used in Launch links (application calls) \\
 % \end{tabular}
+%
 % \section{Various PDF contents}
 % The following commands allow to create a number of important pdf objects and contents in a
 % backend independant way.
-%
-% \subsection{BDC operator / Properties resource}
-% \begin{NOTE}{UF}
-%  we need a switch for the case that the resource should be added to
-%  xform resource instead of a page resources, see pdfbase.sty
-% - xdvipdfmx: looks fine, the resource is added to the xform resource automatically
-% - pdftex should now work okay too
-% \end{NOTE}
-% Entries to the /Properties dictionary in the page resources can
-% be added with dvips only through side-effects: if a BDC-mark is created
-% dvips/ghostscript will automatically create the necessary objects and names.
-% To get a sensible abstraction the code does the same for the other backends:
-% There are no public commands to add values to the /Properties dictionary
-% directly, only commands to set BDC-marks.
-% \begin{function}[updated = 2020-07-03]
-%   {
-%     \pdf_bdc:nn
-%   }
-%   \begin{syntax}
-%     \cs{pdf_bdc:nn} \Arg{tag} \Arg{dictionary content}
-%   \end{syntax}
-%    This command adds a BDC marked content operator to the current page stream.
-%   \meta{tag} is the tag of this operator (without the leading slash),
-%   \meta{dictionary content} is the content of the second argument.
-%   If the PDF resource management is active an dictionary object with the
-%   content is created and referenced with a name in the BDC operator.
-%   Without the resource management the content is used directly. It then
-%   depends on the backend how it is handled: with dvips a name is used
-%   while the pdfmode engines and dvipdfmx write the content into the stream.
-%
-% \end{function}
-% \begin{function}[added = 2020-07-03]
-%   {
-%     \pdf_bdc_obj:nn
-%   }
-%   \begin{syntax}
-%     \cs{pdf_bdc_obj:nn} \Arg{tag} \Arg{object name}
-%   \end{syntax}
-%   This command adds a BDC marked content operator to the current page stream.
-%   \meta{tag} is the tag of this operator (without the leading slash),
-%   \meta{object name}  is a the name of an dictionary object reserved with
-%   \cs{pdf_object_new:nn} and filled with \cs{pdf_object_write:n} with
-%   the properties of the BDC. Reusing a predefined object can save space
-%   but the command works correctly
-%   only if the resources management has been activated and should be used only
-%   if this can be ensured.
-% \end{function}
-% \begin{function}[updated = 2020-07-03]
-%   {
-%     \pdf_bdc_obj:n
-%   }
-%   \begin{syntax}
-%     \cs{pdf_bdc_obj:n} \Arg{tag}
-%   \end{syntax}
-%    This command adds a BDC marked content operator to the current page stream.
-%   \meta{tag} is the tag of this operator (without the leading slash).
-%   As object this commands uses the last anonymous dictionary object created with
-%   \cs{pdf_object_now:nn}. It lies in the responsibility of the user that the last
-%   object is the wanted one. Like with \cs{pdf_bdc_obj:nn} the command works correctly
-%   only if the resources management has been activated and should be used only
-%   if this can be ensured.
-% \end{function}
-% \begin{function}[added = 2019-10-17]
-%   {
-%     \pdf_bmc:n
-%   }
-%   \begin{syntax}
-%     \cs{pdf_bmc:n} \Arg{tag}
-%   \end{syntax}
-%    This command created a BMC marked content operator. The argument is the
-%    tag without the leading slash. It can be e.g. used for simple artifact
-%    markers.
-% \end{function}
-% \begin{function}[added = 2019-06-30]
-%   {
-%     \pdf_emc:
-%   }
-%   \begin{syntax}
-%     \cs{pdf_emc:}
-%   \end{syntax}
-%    This command closes the  BDC marked content operator opened with \cs{pdf_bdc:nn}.
-%    It should be on the same page as the bdc-command.
-%
-%   \begin{verbatim}
-%   \pdf_object_new:nn   {objA}{dict}
-%   \pdf_object_write:nn {objA}{/Type/Artifact}
-%   \pdf_bdc:nn {Span}{objA}
-%   text
-%   \pdf_emc:
-%   \end{verbatim}
-% \end{function}
-%
 
-%
-% \subsubsection{BDC and Properties  / management}
-% \begin{macro}{\pdf_bdc:nn}
-% \begin{macro}{\pdf_bdc_obj:nn}
-% \begin{macro}{\pdf_bdc_obj:n}
-% \begin{macro}{\pdf_bmc:n}
-% \begin{macro}{\pdf_emc:}
-%    \begin{macrocode}
-%<*package>
-\cs_new_protected:Npn  \pdf_bdc:nn #1 #2 { \@@_backend_bdc:nn { #1 }{ #2 } }
-\cs_new_protected:Npn  \pdf_bdc_obj:nn #1 #2 { \@@_backend_bdc_obj:nn { #1 }{ #2 } }
-\cs_new_protected:Npn  \pdf_bdc_obj:n #1     { \@@_backend_bdc_obj:n  { #1 } }
-\cs_new_protected:Npn  \pdf_bmc:n #1     { \@@_backend_bmc:n  { #1 } }
-\cs_new_protected:Npn  \pdf_emc:         { \@@_backend_emc: }
-%</package>
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
 % \subsection{Form XObject (pdfxform)}
 % \begin{NOTE}{UF}
 %  - As in dvi mode the xform is immediate, this is done for pdftex/luatex too.
@@ -857,7 +730,7 @@
 %   \begin{syntax}
 %     \cs{pdfannot_box_last:}
 %   \end{syntax}
-%   This retrieves the object reference of the last annotation created.
+%   This retrieves the object reference of the last box annotation created.
 % \end{function}
 %    \begin{macrocode}
 %<*package>
@@ -887,7 +760,7 @@
   }
 %</package>
 %    \end{macrocode}
-% \subsection{Annotations, Flags}
+% \subsection{Flags}
 % Every flag should have an associated property that allows to set/clear flag positions by
 % name. The name is \cs{c_@@_flag_\#1_prop}
 % \begin{NOTE}{UF}
@@ -918,8 +791,8 @@
     LockedContents = 9
   }
 
-\pdf_flag_new:nn {annot/Field} %it is not really an annot, but we will put
-  {                                 % form field in this module.
+\pdf_flag_new:nn {annot/Field} %name is wrong ... form?? it is not really an annot,
+  {
     ReadOnly          = 0,
     Required          = 1,
     NoExport          = 2,
@@ -942,7 +815,7 @@
     CommitOnSelChange = 26
   }
 
-\pdf_flag_new:nn {annot/field/submit}
+\pdf_flag_new:nn {annot/Field/submit} %name is wrong ...
   {
     Include/Exclude       = 0,
     IncludeNoValueFields  = 1,
@@ -1197,7 +1070,8 @@
 %    \end{macrocode}
 % \begin{function}[added = 2020-03-12]{  \pdfannot_link_last: }
 %   This retrieves the object reference a previously link created with the commands
-%   above. This doesn't work with xelatex.
+%   above. This doesn't work currently with xelatex but a feature request has
+%   been made.
 % \end{function}
 %    \begin{macrocode}
 %<*package>
@@ -1250,16 +1124,16 @@
 % arguments, but we add support for the casing of hyperref and the pdf reference.
 %
 % \begin{tabular}{llll}
-% Type & status    & input    &remark \\\hline
-% /Fit & supported & fit, Fit \\%
-% /FitH& supported & fith, FitH \\
+% Type             & status    & input    &remark \\\hline
+% /Fit             & supported & fit, Fit \\%
+% /FitH            & supported & fith, FitH \\
 % /FitH \emph{top} & not supported\\
-% /FitV & supported& fitv, FitV\\
-% /FitV \emph{left} & not supported\\
-% /FitB & supported & fitb, FitB\\
-% /FitBH & supported & fitbh, FitBH\\
+% /FitV            & supported & fitv, FitV\\
+% /FitV \emph{left}& not supported\\
+% /FitB            & supported & fitb, FitB\\
+% /FitBH           & supported & fitbh, FitBH\\
 % /FitBH \emph{top}& not supported\\
-% /FitBV & supported & fitbv, FitBV\\
+% /FitBV           & supported & fitbv, FitBV\\
 % /FitBV \emph{left} & not supported\\
 % /FitR \emph{left bottom right top} & supported in part& typesets a box\\
 % /XYZ \emph{left} \emph{top} NULL & supported & xyz, XYZ &left, top are automatic\\
@@ -1288,7 +1162,7 @@
 % perhaps some manipulation of the argument will be needed to map the current
 % hyperref syntax
 % unclear currently if is this is useful for anything.
-\prop_new:N \l_@@_views_map_prop
+\prop_new:N   \l_@@_views_map_prop
 \prop_put:Nnn \l_@@_views_map_prop {XYZ} { xyz }
 \prop_put:Nnn \l_@@_views_map_prop {xyz} { xyz }
 \prop_put:Nnn \l_@@_views_map_prop {Fit} { fit }
@@ -1326,11 +1200,11 @@
    \@@_backend_destination_box:nn { #1 }{ #2 } %new name!!
  }
 
-%avoid that destinations names are optimized.
-% is this still needed??
-%see https://tug.org/pipermail/dvipdfmx/2019-May/000002.html
 %</package>
 %<*dvipdfmx|xdvipdfmx>
+% avoid that destinations names are optimized.
+% is this still needed??
+% see https://tug.org/pipermail/dvipdfmx/2019-May/000002.html
     \__kernel_backend_literal:x { dvipdfmx:config~C~ 0x10 }
 %</dvipdfmx|xdvipdfmx>
 %    \end{macrocode}
@@ -1367,26 +1241,7 @@
 %    \end{macrocode}
 %
 % \section{Document metadata}
-% We plan a \cs{DeclareDocumentMetaData} so let's start with it.
-% It should for the begin allow to set the version, to uncompress a pdf,
-% and set the language. We also add a key to activate the metadata stream and
-% to set a standard. The code has been moved to l3pdfmeta.
-% \begin{NOTE}{UF}
-% how to setup a backend/driver key? Can it be copied from expl3?
-% \end{NOTE}
-% \begin{function}[added=2019-08-25]{\DeclareDocumentMetaData}
-%    \begin{macrocode}
-%<*package>
-\RequirePackage{l3pdfmeta} %
-%</package>
-%    \end{macrocode}
-% \end{function}
-% %load backend driver
-%    \begin{macrocode}
-%<*package>
-\file_input:n {l3\g__sys_backend_tl-pdf.def}
-%</package>
-%    \end{macrocode}
+% The code has been moved to \pkg{l3pdfmeta}.
 %
 % \section{Patches}
 % This code is temporary! It tries to patch commands of other packages which
@@ -1576,129 +1431,5 @@
   }
 %</package>
 %    \end{macrocode}
-% \subsection{lua code for lualatex}
-%    \begin{macrocode}
-%<*lua>
-l3kernel= l3kernel or {}
-l3kernel.@@      = l3kernel.@@ or {}
-l3kernel.@@.Page = l3kernel.@@.Page or {}
-l3kernel.@@.Page.dflt = l3kernel.@@.Page.dflt or {}
-l3kernel= l3kernel or {}
-l3kernel.@@.Page.Resources = l3kernel.@@.Resources or {}
-l3kernel.@@.Page.Resources.Properties = l3kernel.@@.Page.Resources.Properties or {}
-l3kernel.@@.Page.Resources.List={"ExtGState","ColorSpace","Pattern","Shading"}
-l3kernel.@@.object = l3kernel.@@.object or {}
-
-l3kernel.pdf= l3kernel.pdf or {} -- for "public" functions
-
-local @@ = l3kernel.@@
-local pdf = pdf
-
-local function @@_backend_Page_gput (name,value)
- @@.Page.dflt[name]=value
-end
-
-local function @@_backend_Page_gremove (name)
- @@.Page.dflt[name]=nil
-end
-
-local function @@_backend_Page_gclear ()
- @@.Page.dflt={}
-end
-
-local function @@_backend_ThisPage_gput (page,name,value)
- @@.Page[page] = @@.Page[page] or {}
- @@.Page[page][name]=value
-end
-
-local function @@_backend_ThisPage_gpush (page)
- local token=""
- local t = {}
- local tkeys= {}
- for name,value in pairs(@@.Page.dflt) do
-   t[name]=value
- end
- if @@.Page[page] then
-  for name,value in pairs(@@.Page[page]) do
-   t[name] = value
-  end
- end
- -- sort the table to get reliable test files.
- for name,value in pairs(t) do
-  table.insert(tkeys,name)
- end
- table.sort(tkeys)
- for _,name in ipairs(tkeys) do
-   token = token .. "/"..name.." "..t[name]
- end
- return token
-end
-
-function l3kernel.@@.backend_ThisPage_gput (page,name,value) -- tex.count["g_shipout_readonly_int"]
- @@_backend_ThisPage_gput (page,name,value)
-end
-
-function l3kernel.@@.backend_ThisPage_gpush (page)
-  pdf.setpageattributes(@@_backend_ThisPage_gpush (page))
-end
-
-function l3kernel.@@.backend_Page_gput (name,value)
-  @@_backend_Page_gput (name,value)
-end
-
-function l3kernel.@@.backend_Page_gremove (name)
-  @@_backend_Page_gremove (name)
-end
-
-function l3kernel.@@.backend_Page_gclear ()
-  @@_backend_Page_gclear ()
-end
-
-
-local Properties  = l3kernel.@@.Page.Resources.Properties
-local ResourceList= l3kernel.@@.Page.Resources.List
-local function @@_backend_PageResources_gpush (page)
- local token=""
- if Properties[page] then
--- we sort the table, so that the pdf test works
-  local t = {}
-  for name,value in pairs  (Properties[page]) do
-   table.insert (t,name)
-  end
-  table.sort (t)
-  for _,name in ipairs(t) do
-   token = token .. "/"..name.." ".. Properties[page][name]
-  end
-  token = "/Properties <<"..token..">>"
- end
-  for i,name in ipairs(ResourceList) do
-   if l3kernel.@@.Page.Resources[name] then
-   token = token .. "/"..name.." "..l3kernel.pdf.object_ref("Page/Resources/"..name)
-   end
-  end
- return token
-end
-
--- the function is public, as I probably need it in tagpdf too ...
-function l3kernel.pdf.Page_Resources_Properties_gput (page,name,value) -- tex.count["g_shipout_readonly_int"]
- Properties[page] = Properties[page] or {}
- Properties[page][name]=value
- pdf.setpageresources(@@_backend_PageResources_gpush (page))
-end
-
-function l3kernel.pdf.Page_Resources_gpush(page)
- pdf.setpageresources(@@_backend_PageResources_gpush (page))
-end
-
-function l3kernel.pdf.object_ref (objname)
- if l3kernel.@@.object[objname] then
-  local ref= l3kernel.@@.object[objname]
-  return ref
- else
-  return "false"
- end
-end
-%</lua>
-%    \end{macrocode}
 % \newpage
 % \PrintIndex
diff --git a/pdfresources.ins b/pdfresources.ins
index 747e1b9..84968ff 100644
--- a/pdfresources.ins
+++ b/pdfresources.ins
@@ -113,5 +113,5 @@ and all files in that bundle must be distributed together.
   \MetaPrefix\space End of File `\outFileName'.%
 }
 \def\currentpostamble{\defaultpostamble}%
-\generate{\file{pdfresources.lua}   {\from{pdfresources.dtx}{lua}}}
+\generate{\file{l3backend-pdf.lua}   {\from{l3backend-pdf-extra.dtx}{lua}}}
 \endbatchfile
diff --git a/testfiles-dvips/bdc-properties-inactive.pvt b/testfiles-pool/bdc-properties-inactive.pvt
similarity index 100%
rename from testfiles-dvips/bdc-properties-inactive.pvt
rename to testfiles-pool/bdc-properties-inactive.pvt





More information about the latex3-commits mailing list.