diff options
author | Karl Berry <karl@freefriends.org> | 2024-09-15 19:56:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-09-15 19:56:18 +0000 |
commit | 7a7070d962dfea1a2211a7b2075d63ca3fe964ca (patch) | |
tree | 029507bd8ebf380548eba96cf4bd42392bbdb176 /Master | |
parent | cd4c4dd5a86d54c7187926bb4209667893366277 (diff) |
ocgx2 (15sep24)
git-svn-id: svn://tug.org/texlive/trunk@72288 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/ocgx2/ChangeLog | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty | 21 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 253 |
3 files changed, 147 insertions, 132 deletions
diff --git a/Master/texmf-dist/doc/latex/ocgx2/ChangeLog b/Master/texmf-dist/doc/latex/ocgx2/ChangeLog index 2aa9c201796..5d97fd93b17 100644 --- a/Master/texmf-dist/doc/latex/ocgx2/ChangeLog +++ b/Master/texmf-dist/doc/latex/ocgx2/ChangeLog @@ -1,3 +1,8 @@ +2024-09-15 + * v0.59: ocgx2.sty + * v0.24: ocgbase.sty + * fix: pdf/a compliance (issue #22); log output (issue #20) + 2024-08-28 * v0.58: ocgx2.sty * v0.23: ocgbase.sty diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty index 690bd593ce6..e182f8670d5 100644 --- a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty +++ b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty @@ -100,8 +100,8 @@ % % The Current Maintainer of this work is A. Grahn. -\def\g@ocgbase@date@tl{2024/08/28} -\def\g@ocgbase@version@tl{0.23} +\def\g@ocgbase@date@tl{2024/09/15} +\def\g@ocgbase@version@tl{0.24} \ProvidesExplPackage{ocgbase}{\g@ocgbase@date@tl}{\g@ocgbase@version@tl} {support package for ocgx2.sty} @@ -424,8 +424,8 @@ % % The Current Maintainer of this work is A. Grahn. -\def\g@ocgbase@date@tl{2024/08/28} -\def\g@ocgbase@version@tl{0.23} +\def\g@ocgbase@date@tl{2024/09/15} +\def\g@ocgbase@version@tl{0.24} \ProvidesExplPackage{ocgbase}{\g@ocgbase@date@tl}{\g@ocgbase@version@tl} {support package for ocgx2.sty} @@ -514,11 +514,14 @@ } \pdfmanagement_add:nnx{Catalog/OCProperties}{OCGs}{\g_ocgbase_ocgs_tl} \pdfmanagement_add:nnx{Catalog/OCProperties}{D}{<< - /AS~[ - <</Event/View /Category[/View] /OCGs~\l_ocgbase_ocgarray_tl>> - <</Event/Print /Category[/Print] /OCGs~\l_ocgbase_ocgarray_tl>> - <</Event/Export/Category[/Export]/OCGs~\l_ocgbase_ocgarray_tl>> - ] + /Name~(OC~default~configuration) + \pdfmeta_standard_verify:nT{Catalog_OCProperties_no_AS}{ %for pdf/a compliance + /AS~[ + <</Event/View /Category[/View] /OCGs~\l_ocgbase_ocgarray_tl>> + <</Event/Print /Category[/Print] /OCGs~\l_ocgbase_ocgarray_tl>> + <</Event/Export/Category[/Export]/OCGs~\l_ocgbase_ocgarray_tl>> + ] + } /BaseState/ON~\l_ocgbase_offocgentry_tl \l_ocgbase_ocgorderentry_tl \l_ocgbase_rbgroupsentry_tl diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty index 8a45995b8c8..16eb0d3a1b8 100644 --- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty +++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty @@ -43,11 +43,11 @@ % % The Current Maintainer of this work is A. Grahn. - \def\g@ocgxii@date@tl{2024/08/28} - \def\g@ocgxii@version@tl{0.58} + \def\g@ocgxii@date@tl{2024/09/15} + \def\g@ocgxii@version@tl{0.59} \ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl} - {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} + {ports~`ocgx'~functionality~to~dvips+ps2pdf,~xelatex~and~dvipdfmx} %creating global definitions \cs_new_protected:Npn\ocgxii@newkey#1#2{\tl_gset:cx{#1}{#2}} @@ -1579,11 +1579,11 @@ % % The Current Maintainer of this work is A. Grahn. -\def\g@ocgxii@date@tl{2024/08/28} -\def\g@ocgxii@version@tl{0.58} +\def\g@ocgxii@date@tl{2024/09/15} +\def\g@ocgxii@version@tl{0.59} \ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl} -{ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} +{ports~`ocgx'~functionality~to~dvips+ps2pdf,~xelatex~and~dvipdfmx} %creating global definitions \cs_new_protected:Npn\ocgxii@newkey#1#2{\tl_gset:cx{#1}{#2}} @@ -2385,104 +2385,132 @@ % \bool_if:nTF{\l_ocgxii_nobreak_bool || \l_ocgxii_mouse_triggers_bool}{ \hbox_set:Nn\l_tmpa_box{#6} - \bool_if:NTF\l_ocgxii_mouse_triggers_bool{ - % e,d,x mouse triggers require (non-breakable) /Widget annot - \pdfannot_dict_put:nnn{link/GoTo}{Subtype}{/Widget} - \pdfannot_dict_remove:nn{link/GoTo}{Border} - }{ - \pdfannot_dict_put:nnn{link/GoTo}{Border}{[0~0~0]} - } - \pdfannot_dict_remove:nn{link/GoTo}{C} - \pbs_pdfannot:nnnn{ - \dim_use:N\box_wd:N\l_tmpa_box}{ - \dim_use:N\box_ht:N\l_tmpa_box}{ - \dim_use:N\box_dp:N\l_tmpa_box - }{ - \pdfannot_dict_use:n{link/GoTo} + % suppress annots with SetOCGState Action Subtype for pdf/a compliance + \pdfmeta_standard_verify:nT{annot_action_A}{ \bool_if:NTF\l_ocgxii_mouse_triggers_bool{ - /Ff~65536/FT/Btn/BS<</W~0>> - /T~(ocgx2@\int_use:N\g_ocgxii_widcount_int) - %treat mouse-up as mouse-click --> handle through /A dictionary - \str_if_eq:eeF{}{ - \l_ocgxii_toswitch_u_tl\l_ocgxii_toshow_u_tl\l_ocgxii_tohide_u_tl - }{ - /A <</S/SetOCGState/State [ - \str_if_eq:VnF\l_ocgxii_toswitch_u_tl{}{ - /Toggle~\l_ocgxii_toswitch_u_tl - } - \str_if_eq:VnF\l_ocgxii_toshow_u_tl{}{ - /ON~\l_ocgxii_toshow_u_tl - } - \str_if_eq:VnF\l_ocgxii_tohide_u_tl{}{ - /OFF~\l_ocgxii_tohide_u_tl - } - ]>> - } - % other mouse triggers need add. actions dict - /AA << - %\str_if_eq:eeF{}{ % mouse-up - % \l_ocgxii_toswitch_u_tl\l_ocgxii_toshow_u_tl\l_ocgxii_tohide_u_tl - %}{ - % /U <</S/SetOCGState/State [ - % \str_if_eq:VnF\l_ocgxii_toswitch_u_tl{}{ - % /Toggle~\l_ocgxii_toswitch_u_tl - % } - % \str_if_eq:VnF\l_ocgxii_toshow_u_tl{}{ - % /ON~\l_ocgxii_toshow_u_tl - % } - % \str_if_eq:VnF\l_ocgxii_tohide_u_tl{}{ - % /OFF~\l_ocgxii_tohide_u_tl - % } - % ]>> - %} - \str_if_eq:eeF{}{ % mouse-down - \l_ocgxii_toswitch_d_tl\l_ocgxii_toshow_d_tl\l_ocgxii_tohide_d_tl - }{ - /D <</S/SetOCGState/State [ - \str_if_eq:VnF\l_ocgxii_toswitch_d_tl{}{ - /Toggle~\l_ocgxii_toswitch_d_tl - } - \str_if_eq:VnF\l_ocgxii_toshow_d_tl{}{ - /ON~\l_ocgxii_toshow_d_tl - } - \str_if_eq:VnF\l_ocgxii_tohide_d_tl{}{ - /OFF~\l_ocgxii_tohide_d_tl - } - ]>> - } - \str_if_eq:eeF{}{ % mouse-enter - \l_ocgxii_toswitch_e_tl\l_ocgxii_toshow_e_tl\l_ocgxii_tohide_e_tl - }{ - /E <</S/SetOCGState/State [ - \str_if_eq:VnF\l_ocgxii_toswitch_e_tl{}{ - /Toggle~\l_ocgxii_toswitch_e_tl - } - \str_if_eq:VnF\l_ocgxii_toshow_e_tl{}{ - /ON~\l_ocgxii_toshow_e_tl - } - \str_if_eq:VnF\l_ocgxii_tohide_e_tl{}{ - /OFF~\l_ocgxii_tohide_e_tl - } - ]>> - } - \str_if_eq:eeF{}{ % mouse-exit - \l_ocgxii_toswitch_x_tl\l_ocgxii_toshow_x_tl\l_ocgxii_tohide_x_tl + % e,d,x mouse triggers require (non-breakable) /Widget annot + \pdfannot_dict_put:nnn{link/GoTo}{Subtype}{/Widget} + \pdfannot_dict_remove:nn{link/GoTo}{Border} + }{ + \pdfannot_dict_put:nnn{link/GoTo}{Border}{[0~0~0]} + } + \pdfannot_dict_remove:nn{link/GoTo}{C} + \pbs_pdfannot:nnnn{ + \dim_use:N\box_wd:N\l_tmpa_box}{ + \dim_use:N\box_ht:N\l_tmpa_box}{ + \dim_use:N\box_dp:N\l_tmpa_box + }{ + \pdfannot_dict_use:n{link/GoTo} + \bool_if:NTF\l_ocgxii_mouse_triggers_bool{ + /Ff~65536/FT/Btn/BS<</W~0>> + /T~(ocgx2@\int_use:N\g_ocgxii_widcount_int) + %treat mouse-up as mouse-click --> handle through /A dictionary + \str_if_eq:eeF{}{ + \l_ocgxii_toswitch_u_tl\l_ocgxii_toshow_u_tl\l_ocgxii_tohide_u_tl }{ - /X <</S/SetOCGState/State [ - \str_if_eq:VnF\l_ocgxii_toswitch_x_tl{}{ - /Toggle~\l_ocgxii_toswitch_x_tl + /A <</S/SetOCGState/State [ + \str_if_eq:VnF\l_ocgxii_toswitch_u_tl{}{ + /Toggle~\l_ocgxii_toswitch_u_tl } - \str_if_eq:VnF\l_ocgxii_toshow_x_tl{}{ - /ON~\l_ocgxii_toshow_x_tl + \str_if_eq:VnF\l_ocgxii_toshow_u_tl{}{ + /ON~\l_ocgxii_toshow_u_tl } - \str_if_eq:VnF\l_ocgxii_tohide_x_tl{}{ - /OFF~\l_ocgxii_tohide_x_tl + \str_if_eq:VnF\l_ocgxii_tohide_u_tl{}{ + /OFF~\l_ocgxii_tohide_u_tl } ]>> } - >> - }{ - %mouse-up alone + % other mouse triggers need add. actions dict + /AA << + %\str_if_eq:eeF{}{ % mouse-up + % \l_ocgxii_toswitch_u_tl\l_ocgxii_toshow_u_tl\l_ocgxii_tohide_u_tl + %}{ + % /U <</S/SetOCGState/State [ + % \str_if_eq:VnF\l_ocgxii_toswitch_u_tl{}{ + % /Toggle~\l_ocgxii_toswitch_u_tl + % } + % \str_if_eq:VnF\l_ocgxii_toshow_u_tl{}{ + % /ON~\l_ocgxii_toshow_u_tl + % } + % \str_if_eq:VnF\l_ocgxii_tohide_u_tl{}{ + % /OFF~\l_ocgxii_tohide_u_tl + % } + % ]>> + %} + \str_if_eq:eeF{}{ % mouse-down + \l_ocgxii_toswitch_d_tl\l_ocgxii_toshow_d_tl\l_ocgxii_tohide_d_tl + }{ + /D <</S/SetOCGState/State [ + \str_if_eq:VnF\l_ocgxii_toswitch_d_tl{}{ + /Toggle~\l_ocgxii_toswitch_d_tl + } + \str_if_eq:VnF\l_ocgxii_toshow_d_tl{}{ + /ON~\l_ocgxii_toshow_d_tl + } + \str_if_eq:VnF\l_ocgxii_tohide_d_tl{}{ + /OFF~\l_ocgxii_tohide_d_tl + } + ]>> + } + \str_if_eq:eeF{}{ % mouse-enter + \l_ocgxii_toswitch_e_tl\l_ocgxii_toshow_e_tl\l_ocgxii_tohide_e_tl + }{ + /E <</S/SetOCGState/State [ + \str_if_eq:VnF\l_ocgxii_toswitch_e_tl{}{ + /Toggle~\l_ocgxii_toswitch_e_tl + } + \str_if_eq:VnF\l_ocgxii_toshow_e_tl{}{ + /ON~\l_ocgxii_toshow_e_tl + } + \str_if_eq:VnF\l_ocgxii_tohide_e_tl{}{ + /OFF~\l_ocgxii_tohide_e_tl + } + ]>> + } + \str_if_eq:eeF{}{ % mouse-exit + \l_ocgxii_toswitch_x_tl\l_ocgxii_toshow_x_tl\l_ocgxii_tohide_x_tl + }{ + /X <</S/SetOCGState/State [ + \str_if_eq:VnF\l_ocgxii_toswitch_x_tl{}{ + /Toggle~\l_ocgxii_toswitch_x_tl + } + \str_if_eq:VnF\l_ocgxii_toshow_x_tl{}{ + /ON~\l_ocgxii_toshow_x_tl + } + \str_if_eq:VnF\l_ocgxii_tohide_x_tl{}{ + /OFF~\l_ocgxii_tohide_x_tl + } + ]>> + } + >> + }{ + %mouse-up alone + /A <</S/SetOCGState + /State [ + \str_if_eq:VnF{\l_ocgxii_toswitch_u_tl}{}{ + /Toggle~\l_ocgxii_toswitch_u_tl}~ + \str_if_eq:VnF{\l_ocgxii_toshow_u_tl}{}{/ON~\l_ocgxii_toshow_u_tl}~ + \str_if_eq:VnF{\l_ocgxii_tohide_u_tl}{}{/OFF~\l_ocgxii_tohide_u_tl} + ] + >> + } + } + \bool_if:NT\l_ocgxii_mouse_triggers_bool{ + \pbs_appendtofields:n{\pbs_pdflastann:} + \int_gincr:N\g_ocgxii_widcount_int + } + } + \box_use_drop:N\l_tmpa_box + }{ + % suppress annots with SetOCGState Action Subtype for pdf/a compliance + \pdfmeta_standard_verify:nTF{annot_action_A}{ + \bool_if:NF\g_ocgxii_hyperref_loaded_bool{ + \pdfannot_dict_put:nnn{link/GoTo}{Border}{[0~0~0]} + } + %line-breakable annotation + \pbs_pdflink:nn{ + %look and feel of hyperref internal links + \pdfannot_dict_use:n{link/GoTo} /A <</S/SetOCGState /State [ \str_if_eq:VnF{\l_ocgxii_toswitch_u_tl}{}{ @@ -2491,33 +2519,12 @@ \str_if_eq:VnF{\l_ocgxii_tohide_u_tl}{}{/OFF~\l_ocgxii_tohide_u_tl} ] >> + }{ + \hook_use:n{pdfannot/link/GoTo/begin} + #6 + \hook_use:n{pdfannot/link/GoTo/end} } - }\box_use_drop:N\l_tmpa_box - \bool_if:NT\l_ocgxii_mouse_triggers_bool{ - \pbs_appendtofields:n{\pbs_pdflastann:} - \int_gincr:N\g_ocgxii_widcount_int - } - }{ - \bool_if:NF\g_ocgxii_hyperref_loaded_bool{ - \pdfannot_dict_put:nnn{link/GoTo}{Border}{[0~0~0]} - } - %line-breakable annotation - \pbs_pdflink:nn{ - %look and feel of hyperref internal links - \pdfannot_dict_use:n{link/GoTo} - /A <</S/SetOCGState - /State [ - \str_if_eq:VnF{\l_ocgxii_toswitch_u_tl}{}{ - /Toggle~\l_ocgxii_toswitch_u_tl}~ - \str_if_eq:VnF{\l_ocgxii_toshow_u_tl}{}{/ON~\l_ocgxii_toshow_u_tl}~ - \str_if_eq:VnF{\l_ocgxii_tohide_u_tl}{}{/OFF~\l_ocgxii_tohide_u_tl} - ] - >> - }{ - \hook_use:n{pdfannot/link/GoTo/begin} - #6 - \hook_use:n{pdfannot/link/GoTo/end} - } + }{#6} } \group_end: } |