texlive[72125] Master/texmf-dist: media9 (28aug24)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 28 23:05:45 CEST 2024


Revision: 72125
          https://tug.org/svn/texlive?view=revision&revision=72125
Author:   karl
Date:     2024-08-28 23:05:45 +0200 (Wed, 28 Aug 2024)
Log Message:
-----------
media9 (28aug24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/media9/ChangeLog
    trunk/Master/texmf-dist/doc/latex/media9/media9.pdf
    trunk/Master/texmf-dist/tex/latex/media9/media9.sty
    trunk/Master/texmf-dist/tex/latex/media9/pdfbase.sty

Modified: trunk/Master/texmf-dist/doc/latex/media9/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/latex/media9/ChangeLog	2024-08-28 21:05:34 UTC (rev 72124)
+++ trunk/Master/texmf-dist/doc/latex/media9/ChangeLog	2024-08-28 21:05:45 UTC (rev 72125)
@@ -1,3 +1,10 @@
+2024-08-28
+	* v1.26 : media9.sty
+	* v0.56 : pdfbase.sty
+	* fix : dvi magnification by \mag internal TeX command (pdfbase.sty);
+	PDF/A compliance (fixes agrahn/ocgx2#21)
+	* new: hooks for adding actions at begin and end of text column
+
 2022-08-04
 	* v1.25 : media9.sty
 	* v0.55 : pdfbase.sty

Modified: trunk/Master/texmf-dist/doc/latex/media9/media9.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/media9/media9.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/media9/media9.sty	2024-08-28 21:05:34 UTC (rev 72124)
+++ trunk/Master/texmf-dist/tex/latex/media9/media9.sty	2024-08-28 21:05:45 UTC (rev 72125)
@@ -39,8 +39,8 @@
 %
 % The Current Maintainer of this work is A. Grahn.
 
-\def\g at mix@date at tl{2022/08/04}
-\def\g at mix@version at tl{1.25}
+\def\g at mix@date at tl{2024/08/28}
+\def\g at mix@version at tl{1.26}
 
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplPackage{media9}{\g at mix@date at tl}{\g at mix@version at tl}
@@ -2446,8 +2446,8 @@
 %
 % The Current Maintainer of this work is A. Grahn.
 
-\def\g at mix@date at tl{2022/08/04}
-\def\g at mix@version at tl{1.25}
+\def\g at mix@date at tl{2024/08/28}
+\def\g at mix@version at tl{1.26}
 
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplPackage{media9}{\g at mix@date at tl}{\g at mix@version at tl}

Modified: trunk/Master/texmf-dist/tex/latex/media9/pdfbase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/media9/pdfbase.sty	2024-08-28 21:05:34 UTC (rev 72124)
+++ trunk/Master/texmf-dist/tex/latex/media9/pdfbase.sty	2024-08-28 21:05:45 UTC (rev 72125)
@@ -156,8 +156,8 @@
 %
 % The Current Maintainer of this work is A. Grahn.
 
-\def\g at pbs@date at tl{2022/08/04}
-\def\g at pbs@version at tl{0.55}
+\def\g at pbs@date at tl{2024/08/28}
+\def\g at pbs@version at tl{0.56}
 
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplPackage{pdfbase}{\g at pbs@date at tl}{\g at pbs@version at tl}
@@ -220,11 +220,11 @@
     {dvipdfmx}{
       \bool_gset_true:N\g_pbs_dvipdfmx_bool
       \bool_gset_false:N\g_pbs_dvisvgm_bool
-    }  
+    }
     {dvisvgm}{
       \bool_gset_false:N\g_pbs_dvipdfmx_bool
       \bool_gset_true:N\g_pbs_dvisvgm_bool
-    }  
+    }
   }{ % otherwise let the L3 backend code decide
     \str_case_e:nn{\c_sys_backend_str}{
       {dvisvgm}{
@@ -270,6 +270,12 @@
 \seq_new:N\g_pbs_bop_seq
 \seq_new:N\g_pbs_eop_seq
 
+% column (boc, eoc) hooks
+\cs_new_protected:Nn\pbs_boc_action:n{\seq_gput_right:Nn\g_pbs_boc_seq{#1}}
+\cs_new_protected:Nn\pbs_eoc_action:n{\seq_gput_right:Nn\g_pbs_eoc_seq{#1}}
+\seq_new:N\g_pbs_boc_seq
+\seq_new:N\g_pbs_eoc_seq
+
 \bool_new:N\g_pbs_lscape_bool %if we are inside landscape env
 \bool_new:N\g_pbs_ocgbase_loaded_bool
 \AtBeginDocument{
@@ -1105,8 +1111,8 @@
         \mode_leave_vertical:        % resources are managed automatically
         %rescale box to fit within the papersize while distilling
         \tl_gset:cx{scale_{pbs at obj\int_use:N\g_pbs_obj_int}}{\fp_eval:n{min(1.0,
-          \dim_ratio:nn{\paperwidth}{\box_wd:N#5},
-          \dim_ratio:nn{\paperheight}{\box_ht:N#5+\box_dp:N#5}
+          \dim_ratio:nn{\paperwidth}{\box_wd:N#5}/\the\mag*1000,
+          \dim_ratio:nn{\paperheight}{\box_ht:N#5+\box_dp:N#5}/\the\mag*1000
         )}}
         \box_scale:Nnn#5{
           \tl_use:c{scale_{pbs at obj\int_use:N\g_pbs_obj_int}}
@@ -1302,33 +1308,39 @@
   \tl_gput_left:Nx\g_pbs_fields_tl{#1\space}
 }
 
-%modify output routine for output box insertions
-\bool_new:N\l_pbs_is_vertical_bool
+% modify page output routine for inserting actions at begin and end
 \cs_set_eq:NN\pbs_outputpage_orig:\@outputpage
 \cs_set_protected_nopar:Npn\@outputpage{
-  \int_gincr:N\g_pbs_page_int
-  \box_if_vertical:cTF{@outputbox}{
-    \bool_set_true:N\l_pbs_is_vertical_bool
-  }{
-    \bool_set_false:N\l_pbs_is_vertical_bool
-  }
-  \hbox_set:Nn\@outputbox{
+  \vbox_set:Nn\@outputbox{
     %begin of page
-    \hbox_overlap_right:n{\seq_map_inline:Nn\g_pbs_bop_seq{##1}}
+    \seq_map_inline:Nn\g_pbs_bop_seq{##1}
     \box_use_drop:N\@outputbox
     %end of page
-    \hbox_overlap_right:n{\seq_map_inline:Nn\g_pbs_eop_seq{##1}}
+    \seq_map_inline:Nn\g_pbs_eop_seq{##1}
   }
-  \bool_if:NT\l_pbs_is_vertical_bool{
-    \vbox_set:Nn\@outputbox{\box_use_drop:N\@outputbox}
-  }
   \pbs_outputpage_orig:
 }
 
+% modify column making routine for inserting actions at begin and end
+\cs_set_eq:NN\pbs_makecol_orig:\@makecol
+\cs_set_protected_nopar:Npn\@makecol{
+  \vbox_set:Nn\@cclv{
+    %begin of column
+    \seq_map_inline:Nn\g_pbs_boc_seq{##1}
+    \vbox_unpack_drop:N\@cclv
+    %end of column
+    \seq_map_inline:Nn\g_pbs_eoc_seq{##1}
+  }
+  \pbs_makecol_orig:
+}
+
+\AddToHook{shipout}{\int_gincr:N\g_pbs_page_int}
+
 \AddToHook{shipout/foreground}{
   %insert /Properties into current page's resources
   \put(0,0){\pbs_insert_properties_entry:}
 }
+
 \AddToHook{shipout/background}{
   % workaround for curious AR bug (pdf annot or link placed on
   % OCG remains active although OCG is hidden)
@@ -1336,8 +1348,14 @@
   % somewhere on the page.
   \bool_if:NT\g_pbs_ocgbase_loaded_bool{
     \put(1,-1){
+      \tl_if_exist:NF\g_pbs_blank_xform_tl{
+        \hbox_set:Nn\l_tmpa_box{\phantom{\rule{1pt}{1pt}}}
+        \pbs_pdfxform:nnnnn{}{1}{}{}{\l_tmpa_box}
+        \tl_const:Ne\g_pbs_blank_xform_tl{\pbs_pdflastxform:}
+      }
       \pbs_pdfannot:nnnn{3bp}{\c_zero_dim}{3bp}{
-        /Ff~65537/FT/Btn/Subtype/Widget
+        /Ff~65537/FT/Btn/Subtype/Widget/F~4
+        /AP~<</N~<</On~\g_pbs_blank_xform_tl>>>>
         /T~(pbs at ARFix@\int_use:N\g_pbs_page_int)
       }
     }
@@ -1435,8 +1453,8 @@
 %        `fstream', then
 %           {stream attributes as PDF key-value dictionary}{file name}
 %
-%     if #3 && #1 are both empty, an object reference will be reserved for later
-%     use as #1
+%     if #3 && #1 are both empty, an object reference will be reserved for
+%     later use as #1
 %
 %   \pbs_pdflastobj:
 %     inserts object ID of PDF object created/processed during most recent call
@@ -1471,9 +1489,9 @@
 %   --------
 %
 %   \pbs_pdfxform:nnnnn
-%     #1: add pgf/tikz resources (transparency, shading)? (0|1) %dvipdfmx/xetex
+%     #1: add pgf/tikz resources (transparency, shading)? (0|1); dvipdfmx/xetex
 %     #2: write immediately to PDF? (0|1); eg 1 for appearances; pdftex/luatex
-%     #3: additional resources                                  %all BUT dvips
+%     #3: additional resources; all BUT dvips
 %     #4: additional dictionary entries
 %     #5: savebox number
 %     creates PDF Form XObject from savebox content
@@ -1539,8 +1557,8 @@
 %
 % The Current Maintainer of this work is A. Grahn.
 
-\def\g at pbs@date at tl{2022/08/04}
-\def\g at pbs@version at tl{0.55}
+\def\g at pbs@date at tl{2024/08/28}
+\def\g at pbs@version at tl{0.56}
 
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplPackage{pdfbase}{\g at pbs@date at tl}{\g at pbs@version at tl}
@@ -1603,11 +1621,11 @@
     {dvipdfmx}{
       \bool_gset_true:N\g_pbs_dvipdfmx_bool
       \bool_gset_false:N\g_pbs_dvisvgm_bool
-    }  
+    }
     {dvisvgm}{
       \bool_gset_false:N\g_pbs_dvipdfmx_bool
       \bool_gset_true:N\g_pbs_dvisvgm_bool
-    }  
+    }
   }{ % otherwise let the L3 backend code decide
     \str_case_e:nn{\c_sys_backend_str}{
       {dvisvgm}{
@@ -1653,8 +1671,16 @@
 \seq_new:N\g_pbs_bop_seq
 \seq_new:N\g_pbs_eop_seq
 
+% column (boc, eoc) hooks
+\cs_new_protected:Nn\pbs_boc_action:n{\seq_gput_right:Nn\g_pbs_boc_seq{#1}}
+\cs_new_protected:Nn\pbs_eoc_action:n{\seq_gput_right:Nn\g_pbs_eoc_seq{#1}}
+\seq_new:N\g_pbs_boc_seq
+\seq_new:N\g_pbs_eoc_seq
+
+\bool_new:N\g_pbs_ocgbase_loaded_bool
+\AddToHook{package/ocgbase/after}{\bool_gset_true:N\g_pbs_ocgbase_loaded_bool}
+
 \bool_new:N\g_pbs_lscape_bool %if we are inside landscape env
-\bool_new:N\g_pbs_ocgbase_loaded_bool
 \AtBeginDocument{
   \iow_now:Nx\@mainaux{
     \token_to_str:N\providecommand\token_to_str:N\pbs at newkey[2]{}
@@ -1666,7 +1692,6 @@
     \tl_put_right:Nn\landscape{\bool_gset_true:N\g_pbs_lscape_bool}
     \tl_put_left:Nn\endlandscape{\bool_gset_false:N\g_pbs_lscape_bool}
   }
-  \@ifpackageloaded{ocgbase}{\bool_gset_true:N\g_pbs_ocgbase_loaded_bool}{}
 }
 
 % writing to core objects in the PDF, using the new pdfmanagement interface
@@ -1851,7 +1876,9 @@
       \xsb_addto_props:n{/rm at oc\int_use:N\g_pbs_oc_int\space#2}
       \int_gincr:N\g_pbs_oc_int
     }{
-      \pdf_bdcobject:nx{#1}{\tl_use:c{g_pbs_objname_#2_tl}}
+      \tl_if_exist:cT{g_pbs_objname_#2_tl}{
+        \exp_args:Nne\pdf_bdcobject:nn{#1}{\tl_use:c{g_pbs_objname_#2_tl}}
+      }
     }
   }
 
@@ -1868,9 +1895,7 @@
   %pgf + transparency related settings
   \bool_new:N\g_pbs_pgfloaded_bool
   \bool_gset_false:N\g_pbs_pgfloaded_bool
-  \AtBeginDocument{
-    \@ifpackageloaded{pgf}{\bool_gset_true:N\g_pbs_pgfloaded_bool}{}
-  }
+  \AddToHook{package/pgf/after}{\bool_gset_true:N\g_pbs_pgfloaded_bool}
   \int_new:N\g_pbs_obj_int %object ID
   \bool_if:NTF\g_pbs_dvipdfmx_bool{ %dvipdfmx/XeTeX
     \AtBeginDocument{
@@ -2042,7 +2067,9 @@
     }
 
     \cs_new_protected_nopar:Nn\pbs_pdfbdc:nn{
-      \pdf_bdcobject:nx{#1}{\tl_use:c{g_pbs_objname_#2_tl}}
+      \tl_if_exist:cT{g_pbs_objname_#2_tl}{
+        \exp_args:Nne\pdf_bdcobject:nn{#1}{\tl_use:c{g_pbs_objname_#2_tl}}
+      }
     }
   }{
     \bool_if:NTF\g_pbs_dvisvgm_bool{
@@ -2436,8 +2463,8 @@
         \mode_leave_vertical:        % resources are managed automatically
         %rescale box to fit within the papersize while distilling
         \tl_gset:cx{scale_{pbs at obj\int_use:N\g_pbs_obj_int}}{\fp_eval:n{min(1.0,
-          \dim_ratio:nn{\paperwidth}{\box_wd:N#5},
-          \dim_ratio:nn{\paperheight}{\box_ht:N#5+\box_dp:N#5}
+          \dim_ratio:nn{\paperwidth}{\box_wd:N#5}/\the\mag*1000,
+          \dim_ratio:nn{\paperheight}{\box_ht:N#5+\box_dp:N#5}/\the\mag*1000
         )}}
         \box_scale:Nnn#5{
           \tl_use:c{scale_{pbs at obj\int_use:N\g_pbs_obj_int}}
@@ -2602,7 +2629,6 @@
     }
   }
 }
-\cs_generate_variant:Nn\pdf_bdcobject:nn{nx}
 \cs_new_eq:NN\pbs_pdfemc:\pdf_emc:
 
 \cs_new_nopar:Nn\pbs_pdflastobj:{\g_pbs_pdflastobj_tl}
@@ -2610,29 +2636,34 @@
 \cs_new_nopar:Nn\pbs_pdflastxform:{\g_pbs_pdflastxform_tl}
 \cs_new_nopar:Nn\pbs_pdflastximage:{\g_pbs_pdflastximage_tl}
 
-%modify output routine for output box insertions
-\bool_new:N\l_pbs_is_vertical_bool
+% modify page output routine for inserting actions at begin and end
 \cs_set_eq:NN\pbs_outputpage_orig:\@outputpage
 \cs_set_protected_nopar:Npn\@outputpage{
-  \int_gincr:N\g_pbs_page_int
-  \box_if_vertical:cTF{@outputbox}{
-    \bool_set_true:N\l_pbs_is_vertical_bool
-  }{
-    \bool_set_false:N\l_pbs_is_vertical_bool
-  }
-  \hbox_set:Nn\@outputbox{
+  \vbox_set:Nn\@outputbox{
     %begin of page
-    \hbox_overlap_right:n{\seq_map_inline:Nn\g_pbs_bop_seq{##1}}
+    \seq_map_inline:Nn\g_pbs_bop_seq{##1}
     \box_use_drop:N\@outputbox
     %end of page
-    \hbox_overlap_right:n{\seq_map_inline:Nn\g_pbs_eop_seq{##1}}
+    \seq_map_inline:Nn\g_pbs_eop_seq{##1}
   }
-  \bool_if:NT\l_pbs_is_vertical_bool{
-    \vbox_set:Nn\@outputbox{\box_use_drop:N\@outputbox}
-  }
   \pbs_outputpage_orig:
 }
 
+% modify column making routine for inserting actions at begin and end
+\cs_set_eq:NN\pbs_makecol_orig:\@makecol
+\cs_set_protected_nopar:Npn\@makecol{
+  \vbox_set:Nn\@cclv{
+    %begin of column
+    \seq_map_inline:Nn\g_pbs_boc_seq{##1}
+    \vbox_unpack_drop:N\@cclv
+    %end of column
+    \seq_map_inline:Nn\g_pbs_eoc_seq{##1}
+  }
+  \pbs_makecol_orig:
+}
+
+\AddToHook{shipout}{\int_gincr:N\g_pbs_page_int}
+
 \AddToHook{shipout/background}{
   % workaround for curious AR bug (pdf annot or link placed on
   % OCG remains active although OCG is hidden)
@@ -2640,8 +2671,14 @@
   % somewhere on the page.
   \bool_if:NT\g_pbs_ocgbase_loaded_bool{
     \put(1,-1){
+      \tl_if_exist:NF\g_pbs_blank_xform_tl{
+        \hbox_set:Nn\l_tmpa_box{\phantom{\rule{1pt}{1pt}}}
+        \pbs_pdfxform:nnnnn{}{1}{}{}{\l_tmpa_box}
+        \tl_const:Ne\g_pbs_blank_xform_tl{\pbs_pdflastxform:}
+      }
       \pbs_pdfannot:nnnn{3bp}{\c_zero_dim}{3bp}{
-        /Ff~65537/FT/Btn/Subtype/Widget
+        /Ff~65537/FT/Btn/Subtype/Widget/F~4
+        /AP~<</N~<</On~\g_pbs_blank_xform_tl>>>>
         /T~(pbs at ARFix@\int_use:N\g_pbs_page_int)
       }
     }



More information about the tex-live-commits mailing list.