[latex3-commits] [git/LaTeX3-latex3-pdfresources] test-new-hooks: standards, work in progress (3340fb3)
Ulrike Fischer
fischer at troubleshooting-tex.de
Thu May 14 00:24:34 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : test-new-hooks
Link : https://github.com/latex3/pdfresources/commit/3340fb33b1ffe9c37a4e5bf94d19b2be0dd8cf8a
>---------------------------------------------------------------
commit 3340fb33b1ffe9c37a4e5bf94d19b2be0dd8cf8a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Thu May 14 00:24:34 2020 +0200
standards, work in progress
>---------------------------------------------------------------
3340fb33b1ffe9c37a4e5bf94d19b2be0dd8cf8a
hgeneric-experimental.def | 79 +++++++++++++++++++++++++++++++----------------
l3pdfmeta.dtx | 62 ++++++++++++++++++++++++++++++++-----
2 files changed, 108 insertions(+), 33 deletions(-)
diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index 21f6f48..2a4daa7 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -38,13 +38,16 @@
\ProvidesFile{hgeneric-experimental.def}
[2020/03/16 v0.5 %
Hyperref driver for luaTeX]
-\RequirePackage{xparse,etoolbox}
\RequirePackage{pdfresources}
+\RequirePackage{xparse,etoolbox}
+
\chardef\Hy at VersionChecked=1 %don't check the version!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ExplSyntaxOn
%% messages, should later (with more drivers) go somewhere more generic ...
\prop_gput:Nnn \g_msg_module_name_prop { hyp }{ hyperref }
+
+\cs_new:Npn \__hyp_clist_display:n #1 {*~#1\\}
\msg_new:nnn
{ hyp }
{ missing-bookmark-package }
@@ -107,6 +110,15 @@
Value~'#3'~is~invalid~for~key~'#1'.\\
The~key~accepts~only~the~choices\\
\clist_map_function:nN { #2 }\__hyp_clist_display:n
+ }
+
+\msg_new:nnn
+ { hyp }
+ { unknown-choice+empty }
+ {
+ Value~'#3'~is~invalid~for~key~'#1'.\\
+ The~key~accepts~only~the~choices\\
+ \clist_map_function:nN { #2 }\__hyp_clist_display:n
An~empty~value~removes~the~setting.
}
@@ -122,7 +134,8 @@
No~value~is~equivalent~to~using~`true`.
}
-\cs_new:Npn \__hyp_clist_display:n #1 {*~#1\\}
+
+
%% I require the bookmark package to get rid of some of the bookmarks code.
% but the testing code doesn't work.
% !!!!!!!!!!!!!!!!!!!!! to do !!!!!!!!!!!!!!!!!!!!!
@@ -145,20 +158,16 @@
% checked dvips, luatex, xetex, dvipdfm: values are identical:
\providecommand*\@pdfborder{0~0~1}
\providecommand*\@pdfborderstyle{}
+\providecommand*\@pdfview{XYZ}
+
% unicode ...
\HyPsd at LoadUnicode
\Hy at unicodetrue
\let\HyPsd at pdfencoding\HyPsd at pdfencoding@unicode
-\providecommand*\@pdfview{XYZ}
-
\pdfannot_link_margin:n { 1pt }
%%%%%%%%%%
-% variants
-\cs_generate_variant:Nn \pdf_object_write:nn {nx}
-
-%\cs_generate_variant:Nn \pdf_pagesattr_gput:nn {nx} %not really needed but one shouldn't rely on side effects
% tmp
\box_new:N \l__hyp_tmpa_box
@@ -176,7 +185,7 @@
\tl_new:N \g__hyp_pdfstartpage_tl
\tl_new:N \g__hyp_pdfstartview_tl
-% bools
+% booleans
%%% pdfa key:
\bool_new:N \l__hyp_pdfa_bool
\ifHy at pdfa
@@ -871,7 +880,7 @@
}
,pdfdirection / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfdirection }
{ L2R , R2L }
{ \exp_not:n {#1} }
@@ -908,7 +917,7 @@
}
,pdfduplex / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfduplex }
{ Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge }
{ \exp_not:n {#1} }
@@ -987,7 +996,7 @@
}
,pdfnonfullscreenpagemode / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfnonfullscreenpagemode }
{ UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttachments (PDF 1.6) }
{ \exp_not:n {#1} }
@@ -1020,7 +1029,7 @@
{ \pdfdict_gremove:nn {Catalog} { PageLayout } }
,pdfpagelayout / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfpagelayout }
{ SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight }
{ \exp_not:n {#1} }
@@ -1045,7 +1054,7 @@
,pdfpagemode .initial:n = { UseOutlines } %for now ...
,pdfpagemode / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfpagemode }
{ UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttachments (PDF 1.6) }
{ \exp_not:n {#1} }
@@ -1121,7 +1130,7 @@
{ \pdfdict_gremove:nn {Catalog / ViewerPreferences } { PrintArea } }
,pdfprintarea / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfprintarea }
{ MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
{ \exp_not:n {#1} }
@@ -1148,7 +1157,7 @@
}
,pdfprintclip / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfprintclip }
{ MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
{ \exp_not:n {#1} }
@@ -1197,7 +1206,7 @@
}
,pdfprintscaling / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfprintarea }
{ None, AppDefault }
{ \exp_not:n {#1} }
@@ -1278,7 +1287,7 @@
}
,pdfviewarea / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfviewarea }
{ MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
{ \exp_not:n {#1} }
@@ -1305,7 +1314,7 @@
}
,pdfviewclip / unknown .code:n =
{
- \msg_warning:nnxxx { hyp } { unknown-choice }
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
{ pdfviewclip }
{ MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
{ \exp_not:n {#1} }
@@ -1351,6 +1360,31 @@
\hypupdateattribute
+%"info" keys
+\keys_define:nn { hyp / setup }
+ {
+ ,pdftrapped .code:n =
+ {
+ \exp_args:Nne
+ \keys_set:nn { hyp / setup } { __pdftrapped = \str_uppercase:n { #1 } }
+ }
+ ,__pdftrapped .choices:nn = {TRUE,FALSE,UNKNOWN}
+ {
+ \pdfdict_gput:nnx {Info}{Trapped}
+ {/
+ \str_uppercase:f { \str_head:n { #1 } }
+ \str_lowercase:f { \str_tail:n { #1 } }
+ }
+ }
+ ,__pdftrapped / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice }
+ { pdftrapped }
+ { true~(case~insensitive), false~(case~insensitive), unknown~(case~insensitive) }
+ { \exp_not:n {#1} }
+ }
+ }
+
\cs_set_protected:Npn \PDF at SetupDoc
{
%\bool_if:nF
@@ -1405,12 +1439,6 @@
}
\pdfdict_gput:nnx {Info}
{Keywords}{(\@pdfkeywords)}
- \tl_if_empty:NF
- \@pdftrapped
- {
- \pdfdict_gput:nnx {Info}
- {Trapped}{/\@pdftrapped}
- }
}
\Hy at DisableOption{pdfauthor}%
\Hy at DisableOption{pdftitle}%
@@ -1420,7 +1448,6 @@
\Hy at DisableOption{pdfmoddate}%
\Hy at DisableOption{pdfproducer}%
\Hy at DisableOption{pdfkeywords}%
- \Hy at DisableOption{pdftrapped}%
\Hy at DisableOption{pdfinfo}%
}
diff --git a/l3pdfmeta.dtx b/l3pdfmeta.dtx
index 1e3e5a7..f5b1805 100644
--- a/l3pdfmeta.dtx
+++ b/l3pdfmeta.dtx
@@ -32,7 +32,7 @@
% \fi
%
% \title{^^A
-% The \pkg{l3pdfmeta} package\\ Adding XMP-metadata to a pdf ^^A
+% The \pkg{l3pdfmeta} package\\ pdf-standards and XMP-metadata ^^A
% }
%
% \author{^^A
@@ -50,22 +50,27 @@
% \begin{documentation}
%
% \section{\pkg{l3pdfmeta} documentation}
-% XMP-metadata are needed for various standards. Currently they can be added
-% by two mutual incompatible packages: \pkg{hyperxmp} and \pkg{pdfx}. Both
+% This module sets up some tools and commands needed for pdf standards in general
+% and to setup XMP-metadata needed by the various standards in special.
+% Currently XMP-metadata can be added by two mutual incompatible packages:
+% \pkg{hyperxmp} and \pkg{pdfx}. Both
% packages are currently also incompatible with the pdf resource management.
%
-% This package should not replace both packages. Its goal is to create
-% a skeleton metadata stream, add some core default values
+% This package should not replace both packages. Regarding XMP-metadate its goal
+% is to create a skeleton metadata stream, add some core default values
% and to define interfaces that allows other packages
% to add data to this metadata and so to extend them.
%
-% The problems to solve are
+% The problems to solve here are
% \begin{itemize}
% \item which tree structure is sensible
% \item how to escape if needed the input (or which tools are needed to allow
% the users to correctly escape their input)
% \item how interface to input data should look
% \end{itemize}
+%
+% Regarding the pdf standards the goal is to collect the requirements and
+% to set check how to set them.
% \end{documentation}
%
@@ -80,7 +85,7 @@
\RequirePackage{pdfresources}
\RequirePackage{new-pdfescape} %temporarly!!
% \end{macrocode}
-%
+% \section{XMP-metadata}
% \begin{macrocode}
%<@@=pdf>
% we need a command to write a BOM to the pdf:
@@ -126,6 +131,49 @@
}
}
% \end{macrocode}
+%
+% \section{standards (work in progress)}
+% \subsection{pdf/A}
+% \begin{macrocode}
+\prop_new:c { g_@@_meta_standard_pdf/A-1b }
+\prop_set_from_keyval:cn { g_@@_meta_standard_pdf/A-1b }
+ {
+ ,name = pdf/A-1b
+ ,year = 2005
+ ,pdf_version = 1.4 %minimum
+ ,encryption = false
+ ,external_content = false % no F, FFilter, or FDecodeParms in stream dicts
+ ,embed_content = false, %no EF key in filespec, no /Type/EmbeddedFiles
+ ,max_string_size = 65535
+ ,max_array_size = 8191
+ ,max_dict_size = 4095
+ ,max_obj_num = 8388607
+ ,max_nest_qQ = 28
+ ,Catalog/OCProperties = false
+ % to be continued https://docs.verapdf.org/validation/pdfa-part1/
+ }
+
+% ["pdf/a-1b:2005"] = {
+% pdf_version = 1.4,
+% format_name = "pdf/a-1b:2005",
+% xmp_file = "lpdf-pda.xml",
+% gts_flag = "GTS_PDFA1",
+% gray_scale = true,
+% cmyk_colors = true,
+% rgb_colors = true,
+% spot_colors = true,
+% calibrated_rgb_colors = true, -- unknown
+% cielab_colors = true, -- unknown
+% include_intents = true,
+% forms = true,
+% internal_icc_profiles = true,
+% include_cidsets = true,
+% include_charsets = true,
+% inject_metadata = function()
+% injectxmpinfo("xml://rdf:RDF","<rdf:Description rdf:about='' xmlns:pdfaid='http://www.aiim.org/pdfa/ns/id/'><pdfaid:part>1</pdfaid:part><pdfaid:conformance>B</pdfaid:conformance></rdf:Description>",false)
+% end
+% },
+% \end{macrocode}
% \begin{macrocode}
%</package>
% \end{macrocode}
More information about the latex3-commits
mailing list.