[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: starting the catalog (31bf502)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon May 20 23:53:34 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/31bf502bcc37e9b0c074ef1c60d28ea343fe92f6

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

commit 31bf502bcc37e9b0c074ef1c60d28ea343fe92f6
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon May 20 23:53:34 2019 +0200

    starting the catalog


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

31bf502bcc37e9b0c074ef1c60d28ea343fe92f6
 hyperref-patches.tex |   15 +++++++++++++++
 pageresources.tex    |    7 ++-----
 pdfresources.dtx     |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/hyperref-patches.tex b/hyperref-patches.tex
index f63bf9f..bcd395d 100644
--- a/hyperref-patches.tex
+++ b/hyperref-patches.tex
@@ -161,3 +161,18 @@ A number of providing H-counter for various classes/styles: foils, seminar
 (slidesec): a number of patches for hyperref stuff.
 
 \@setref, \@pagesetref: to get link 
+
+\section{Escaping in the drivers}
+
+\pdf at escapestring -> \Hy at pstringdef\Hy at pstringDest{\HyperDestNameFilter{#1}}
+
+\EdefEscapeName
+
+\Hy at escapeform?? (probably \pdfescapestring but ...
+
+\HyPsd at XeTeXBigCharstrue
+    \pdfstringdef\Hy at gtemp#1%
+
+ \pdfstringdef
+   \HyPsd at ConvertToUnicode#1%
+      \ifx\HyPsd at pdfencoding\HyPsd at pdfencoding@auto   
\ No newline at end of file
diff --git a/pageresources.tex b/pageresources.tex
index 3015f63..fb7c6a3 100644
--- a/pageresources.tex
+++ b/pageresources.tex
@@ -219,7 +219,7 @@ endobj
 \begin{enumerate}
   \item Type (name, required, automatic)
   \item Pages (dict, required, automatic)
-  \item Version (name, e.g. /1.4), takes precendance over the heaver \emph{if later}
+  \item Version (name, e.g. /1.4), takes precendance over the header \emph{if later}
   \item \emph{Collection} (dict, pdf 1.7, (for file attachments))
   \item \emph{OCProperties} (dict, pdf 1.5, required if a document contains optional content)
         contains OCGs (array of references), D (dict pointing to a start config), Configs (array of dicts).
@@ -237,9 +237,6 @@ endobj
 
   \item PageLayout (name: one of SinglePage, OneColumn,
   TwoColumnLeft, TwoColumnRight, TwoPageLeft (PDF 1.5), TwoPageRight (PDF 1.5)
-  \item PageMode (name: UseNone, UseOutlines, UseThumbs, FullScreen, UseOC (PDF 1.5),
-   UseAttachments (PDF 1.6)
-
   \item Outlines (dict, must be an indirect reference)
   \item Threads (array, must be an indirect reference)
   \item OpenAction (array (dest) or dictionary (action))
@@ -247,7 +244,7 @@ endobj
   \item URI (dict)
   \item StructTreeRoot (dict) relevant for tagging
 
-   \item Lang (string, e.g. (de-DE))
+  \item Lang (string, e.g. (de-DE))
   \item SpiderInfo (dict)
   \item PieceInfo (dict)
 
diff --git a/pdfresources.dtx b/pdfresources.dtx
index b25b58b..ef97d10 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -727,9 +727,58 @@
   { \token_to_str:N \documentsetup\c_space_tl should~be~used~only~before~\token_to_str:N\documentclass}
 \msg_new:nnn { pdf } {object-compression-disabled}
              {object~compression~is~not~supported~in~pdf~version~#1}
+\msg_new:nnn { pdf } {catalog-special}
+             {values~to~the~catalog~entry~#1~should~be~added~with~\token_to_str:N\pdf_catalog_ #1_gput:nn}
 
 %</package>
 %    \end{macrocode}
+% \subsection{the pdfcatalog}
+% The catalog is a dictionary whose entries have varying requirements regarding the
+% pdf management. Some entries (like /Lang) are simple values where the last setting can
+% simply win, other like /OutputIntents are dictionaries which can be filled from more than
+% one source. /AF is even an array of dictionaries.
+% There is probably no way to test what has already been added to the catalog,
+% so doublettes can only be avoided with ``don't do it''.
+% \subsubsection{Simple values}
+% Simple values can be added with \cs{\pdf_catalog_gput:nn}. This will add the value to
+% a prop. The prop is then pushed to the catalog at the end of the document.
+% Entries which can be added like this are
+% \begin{description}
+% \item[Version]  a version as name, e.g. \texttt{/1.7}
+% \item[PageMode] (name: /UseNone, /UseOutlines, /UseThumbs, /FullScreen, /UseOC (PDF 1.5),
+%   /UseAttachments (PDF 1.6)
+% \item[MarkInfo] a dictionary with up to three entries, whose values are booleans (\texttt{true}
+% or \texttt{false}). The default values of all always \texttt{false}. The dictionary should be set
+% in one go by whatever package is handling tagging. Example\\
+%  \verb+<</Marked true /UserProperties true /Suspects true>>+
+%  \item[PageLayout] (name: one of /SinglePage, /OneColumn,
+%  /TwoColumnLeft, /TwoColumnRight, /TwoPageLeft (PDF 1.5), /TwoPageRight (PDF 1.5)
+%  \item[Outlines] a indirect reference (x 0 R) to an object.
+%  \item[OpenAction] array (e.g. \verb+[page /Fit]+ or dictionary \verb+<</Type /Action /S /GoTo /D /somedest>>)
+%  \item[URI] dict, e.g. \verb+<</S/URI /URI (someurl)>>+
+%  \item[StructTreeRoot] a dict (normally an indirect reference to a dict),
+%   the package doing the tagging should create this.
+%  \item[Lang] (string, e.g. (de-DE))
+%  \item[NeedsRendering] (boolean, pdf 1.7)
+% \end{description}
+%    \begin{macrocode}
+%<*package>
+\prop_new:N \g_@@_pdf_catalog_prop
+\cs_new_protected:Npn \pdf_catalog_gput:nn #1 #2 %#1 name, #2 value
+ {
+  % Add later: test for the names that should be handled specially
+  \prop_gput:Nnn \g_@@_pdf_catalog_prop {#1}{#2}
+ }
+%</package>
+%    \end{macrocode}
+%%% open: Collection, OCProperties, AcroForm, Metadata, ViewerPreferences, OutputIntents, PageLabels, Names,
+%% Dests, AF (array of dictionaries, pdf 2.0, associated files, important for accessibility),
+%% Threads, AA (dict, additional-actions),
+%% open not so important:SpiderInfo (dict), PieceInfo (dict), (dict, pdf 1.5, permissions), Legal (dict, pdf 1.5)
+%% Requirements (array, pdf 1.7), Extensions (dict, pdf 2.0), DSS (dict, pdf 2.0),
+%% DPartRoot, (dict, pdf 2.0)
+% \subsubsection{catalog, special cases}
+%
 % \subsection{pdfpagesattr}
 % A token register that is added to the root pages object when the pdf is finished.
 % The following command copy more or less the driver commands but add a few tests





More information about the latex3-commits mailing list