[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: working on file embedding (b174b7f)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Apr 22 00:36:36 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : renamedict77
Link       : https://github.com/latex3/pdfresources/commit/b174b7f39b0bdd90d084667a08a30c97868b684f

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

commit b174b7f39b0bdd90d084667a08a30c97868b684f
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Apr 22 00:36:36 2020 +0200

    working on file embedding


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

b174b7f39b0bdd90d084667a08a30c97868b684f
 experiments/embedfiles.tex |  2 +-
 l3pdffile.dtx              | 43 ++++++++++++++++++++++++++++++++++++++++++-
 pdfresources.dtx           |  5 +++++
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/experiments/embedfiles.tex b/experiments/embedfiles.tex
index 82f4f70..1697dc1 100644
--- a/experiments/embedfiles.tex
+++ b/experiments/embedfiles.tex
@@ -6,7 +6,7 @@
 \begin{document}
 blub
 \ExplSyntaxOn
-\pdfdict_put:nnn {embeddedfile}{Subtype}{\pdftool_name:n{application/postscript}}
+\pdfdict_put:nnn  {embeddedfile}{Subtype}{\pdftool_name:n{application/postscript}}
 \pdffile_embed:nN {example-image.eps}\l_tmpa_tl
 \ExplSyntaxOff
 \end{document} 
\ No newline at end of file
diff --git a/l3pdffile.dtx b/l3pdffile.dtx
index ce86082..6a51b82 100644
--- a/l3pdffile.dtx
+++ b/l3pdffile.dtx
@@ -60,11 +60,52 @@
 % Url links (1) are created with the \cs{pdfannot} commands.
 %
 % This module handles the two last possibilities. Actually from the view
-% of the PDF format there are quite similar:
+% of the PDF format they are quite similar:
 % In both cases the core dictionaries are /FileSpec dictionaries which similar entries.
 % In the embedding case there is only an additional /EF entry which points to the
 % stream object of the file.
 %
+% The tasks to embed and reference such file are
+% \begin{enumerate}
+% \item Embed the file in a stream. (This is optional).
+% \item Create a FileSpec dictionary which if needed reference the embedded file.
+% \item Reference the FileSpec dictionary so that the user can access the file.
+%       This can be done in various way:
+%       \begin{enumerate}
+%       \item With an annotation (/Subtype/FileAttachment). This done by
+%       attachfile, attachfile2 and intopdf. Typical entries of such an annotation
+%       are:
+%
+%             \begin{tabular}{lll}
+%             FS      & object reference &(FileSpec dictionary)\\
+%             Name    & name           & Graph, PushPin, Paperclip, Tag\\
+%             Contents & text string & optional but recommended\\
+%             F        & integer     & Flags\\
+%             AP       & dictionary  & Appearance (required if rectangle >0) \\
+%             AS       & name\\
+%             \end{tabular}
+%
+%             The AP takes precedance over Border and similar keys.
+%       \item Through an entry in the EmbeddedFiles name tree. This what embedfiles does.
+%       \begin{verbatim}
+%       20 0 obj %Document Name tree
+%        <</EmbeddedFiles 21 0 R>>
+%           endobj
+%         21 0 obj %Embedded Files Name dictionary
+%        <</Names [(AcmeCustomCrypto Protected PDF.pdf) 17 0 R]>>
+%        endobj
+%       \end{verbatim}
+%       \item Through the /AF key in various objects (pdf 2.0), the value is normally an array of object
+%       references.
+%        But it can also be a name which is mapped to an array in /Properties:
+%        \begin{verbatim}
+%        /AF /NamedAF BDC
+%        /Properties <</NamedAF [12 0 R]
+%        \end{verbatim}
+%        The related FileSpec dictionary should contain an /AFRelationship key in this case.
+%       \end{enumerate}
+% \end{enumerate}
+%
 % \begin{verbatim}
 % <<
 % /Type /Filespec
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 79d785a..7b633c6 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -1715,10 +1715,15 @@
 %    \end{macrocode}
 %
 % \subsection{\enquote{Catalog} \& subdirectories (pdfcatalog) }
+% \begin{NOTE}{UF}
+% missing is an access to /Names (\pdfnames), needed for EmbeddedFiles
+% missing is a handler for Collection (ditto embedfiles)
+% \end{NOTE}
 % \subsubsection{\enquote{Catalog} \& subdirectories / backend}
 % the backend command is already in the driver:
 % \cs{@@_backend_catalog_gput:nn}
 %
+%
 % \subsubsection{\enquote{Catalog} \& subdirectories / management }
 % \begin{NOTE}{UF}
 % The catalog dictionary is filled by e.g. \cs{pdfcatalog}. Multiple appearances of





More information about the latex3-commits mailing list.