[latex3-commits] [git/LaTeX3-latex3-pdfresources] develop: add \pdffile_filespec:nnn (11f2f05)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue May 18 18:39:58 CEST 2021


Repository : https://github.com/latex3/pdfresources
On branch  : develop
Link       : https://github.com/latex3/pdfresources/commit/11f2f056a1d9a12ef6add4c83bcf7a4b96a93496

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

commit 11f2f056a1d9a12ef6add4c83bcf7a4b96a93496
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue May 18 18:39:58 2021 +0200

    add \pdffile_filespec:nnn


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

11f2f056a1d9a12ef6add4c83bcf7a4b96a93496
 CHANGELOG.md  |   8 ++++++--
 l3pdffile.dtx |  32 ++++++++++++++++++++++++++++----
 l3pdffile.pdf | Bin 551626 -> 552986 bytes
 3 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d114f50..961f357 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,14 +5,18 @@ first release 0.95a, 2021-02-23 will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 this project uses date-based 'snapshot' version identifiers.
 
-## [2021-05-14
+## [Unreleased]
+### Added
+ - \pdffile_filespec:nnn to create a filespec dictionary
+
+## [2021-05-14]
 ### Fixed 
  - xcolor patch for [ps] type used in pstricks
  - value of citecolor wasn't expanded (errored with tcolorbox)
  - \url, \href, \hrefurl, \hrefrun and \hrefpdf leaves now vmode
  - handling of pdfauthor, pdftitle and pdfsubject in hyperxmp patch
 
-### Changes 
+### Changed 
  - the module for formfield and checkboxes has been in part rewritten to 
    better fit to the new module for textfield. 
    Keys and documentation has been extended. 
diff --git a/l3pdffile.dtx b/l3pdffile.dtx
index cf2176e..fa103ca 100644
--- a/l3pdffile.dtx
+++ b/l3pdffile.dtx
@@ -31,7 +31,7 @@
 \documentclass[full]{l3doc}
 \usepackage{array,booktabs,hyperxmp}
 \hypersetup{pdfauthor=The LaTeX Project,pdftitle=l3pdffile (LaTeX PDF management testphase bundle)}
-
+\usepackage{caption}
 \providecommand\potentialclash{\noindent\llap{\dbend\ }}
 \begin{document}
   \DocInput{\jobname.dtx}
@@ -245,13 +245,14 @@
 % \end{function}
 % \begin{table}
 % \caption{Preset values in the file dictionaries\label{tab:filedict}}
-% \begin{tabular}{lll}
+% \hspace*{-3cm}\begin{tabular}{lll}
 % dictionary & key      & value \\\hline
 % l\_pdffile       & Type     & /EmbeddedFile\\
 % l\_pdffile/Params& Size     & |\file_size:n{\l_pdffile_source_name_str}|\\
 % l\_pdffile/Params& ModDate  & |(\file_timestamp:n {\l_pdffile_source_name_str})|\\
 % l\_pdffile/Params& CheckSum & |(\file_mdfive_hash:n{\l_pdffile_source_name_str})|\\
-% l\_pdffile/streamParams&    &  a /ModDate entry with year/month/date  (used with \cs{pdffile_embed_stream:nnn})\\
+% l\_pdffile/streamParams&    &  a /ModDate entry with year/month/date \\
+%                        &    & (used with \cs{pdffile_embed_stream:nnn})\\
 % l\_pdffile/Filespec & Type  & /Filespec\\
 % l\_pdffile/Filespec & AFRelationship &Unspecified
 % \end{tabular}
@@ -324,6 +325,28 @@
 %   The stream should not be too long, at least PS imposes a size limit for strings.
 % \end{function}
 %
+% \begin{function}{\pdffile_filespec:nnn,\pdffile_filespec:nnx}
+%   \begin{syntax}
+%     \cs{ pdffile_filespec:nnn }\Arg{object name}\Arg{file name}{stream object reference}
+%   \end{syntax}
+%  The previous commands are fine if stream and filespec dictionary can be created together.
+%  But there are cases where the |filespec| dictionary should be referenced when the
+%  stream object doesn't exist yet. For example in the |AF| key of a structure at
+%  the begin of an environment where the stream is created from the body.
+%
+%  This command allows to write a filespec dictionary alone and reference a previously
+%  created stream.
+%
+%  \begin{verbatim}
+%  \pdf_object_new:nn{module/filespec/A}{dict} % a new filespec object
+%  \pdf_object_ref:n {module/filespec/A}       % a reference
+%  \pdf_object_unnamed_write:nn { stream }{ {...}{content} } %writing the stream
+%  % filling and writing the filespec dictionary:
+%  \pdffile_filespec:nnn {module/filespec/A}{A.xml}{\pdf_object_ref_last:}
+%  \end{verbatim}
+%
+% \end{function}
+%
 %  \begin{variable}{\g_pdffile_mimetypes_prop}
 %   This property contains a list of extensions and their mimetypes.
 %   Values can be added or changed with the standard commands:
@@ -636,7 +659,8 @@
       }
   }
 
-
+\cs_set_eq:NN \pdffile_filespec:nnn \@@_filespec_write:nnn
+\cs_generate_variant:Nn \pdffile_filespec:nnn {nnx}
 %#1 {source filename}
 %#2 {target filename}
 %#3 { filespec object name } (will internally get a prefix! ??)
diff --git a/l3pdffile.pdf b/l3pdffile.pdf
index b9b9a92..3aad0ed 100644
Binary files a/l3pdffile.pdf and b/l3pdffile.pdf differ





More information about the latex3-commits mailing list.