diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9/pdfbase.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/pdfbase.sty | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/pdfbase.sty b/Master/texmf-dist/tex/latex/media9/pdfbase.sty index b736a571417..9d4715256b5 100644 --- a/Master/texmf-dist/tex/latex/media9/pdfbase.sty +++ b/Master/texmf-dist/tex/latex/media9/pdfbase.sty @@ -99,11 +99,12 @@ % The Current Maintainer of this work is A. Grahn. \RequirePackage{expl3} +\RequirePackage{l3regex} \RequirePackage{l3keys2e} -\RequirePackage{atbegshi} +\RequirePackage{atenddvi} -\def\g@pbs@date@tl{2015/10/28} -\def\g@pbs@version@tl{0.1} +\def\g@pbs@date@tl{2015/11/02} +\def\g@pbs@version@tl{0.2} \ProvidesExplPackage{pdfbase}{\g@pbs@date@tl}{\g@pbs@version@tl} {driver independent access to low-level PDF features} @@ -132,6 +133,7 @@ \bool_new:N\g_pbs_pkgbigfiles_bool \bool_new:N\g_pbs_dvipdfmx_bool +\bool_new:N\g_pbs_twocolumn_bool \keys_define:nn{pdfbase}{ xetex .bool_gset:N = \g_pbs_dvipdfmx_bool, @@ -144,7 +146,9 @@ unknown .code:n = { \msg_error:nnx{pdfbase}{unknown~package~option}{\l_keys_key_tl} - } + }, + + twocolumn .bool_gset:N = \g_pbs_twocolumn_bool } \ProcessKeysOptions{pdfbase} \sys_if_engine_xetex:T{\bool_gset_true:N\g_pbs_dvipdfmx_bool} @@ -207,25 +211,47 @@ \cs_new:Nn\pbs_pdfcatalog:n{\pdfcatalog{#1}} \int_new:N\g_pbs_oc_int % object ID + \cs_new:Nn\pbs_pdfbdc:nn{ \pdfliteral~direct~{#1/rm@oc\int_use:N\g_pbs_oc_int\space BDC} - \tl_if_empty:NTF\@anim@ocmap{ - \tl_gset:cx{@anim@ocmap}{/rm@oc\int_use:N\g_pbs_oc_int\space#2} + \tl_if_empty:NTF\g_pbs_ocmap_tl{ + \tl_gset:Nx\g_pbs_ocmap_tl{/rm@oc\int_use:N\g_pbs_oc_int\space#2} }{ - \tl_gput_right:cx{@anim@ocmap}{~/rm@oc\int_use:N\g_pbs_oc_int\space#2} + \tl_gput_right:Nx\g_pbs_ocmap_tl{~/rm@oc\int_use:N\g_pbs_oc_int\space#2} } + \tl_set:Nx\l_pbs_pdfpageresources_tl{\the\pdfpageresources} + \regex_replace_all:NnN\l_pbs_regex{}\l_pbs_pdfpageresources_tl \group_begin: \tl_set:Nx\l_pbs_temp_tl{\group_end: - \global\pdfpageresources{\the\pdfpageresources - /Properties<<\@anim@ocmap>> + \global\pdfpageresources{ + \l_pbs_pdfpageresources_tl + /Properties<<\g_pbs_ocmap_tl>> } }\l_pbs_temp_tl \int_gincr:N\g_pbs_oc_int } - \tl_if_exist:cF{@anim@ocmap}{ - \tl_gset:cn{@anim@ocmap}{} - \AtBeginShipout{\tl_gset:cn{@anim@ocmap}{}} + \tl_new:N\g_pbs_ocmap_tl + \regex_const:Nn\l_pbs_regex{\/Properties<<(?:\s*\/rm@oc[^R]+R\s*)+>>} + + %modify output routine to purge \pdfpageresources from OCG properties + \int_new:N\g_pbs_columns_int + \tl_gset:Nx\g_pbs_output_tl{\the\output} + \global\output{ + \g_pbs_output_tl + \int_gincr:N\g_pbs_columns_int + \bool_if:nT{ + !\g_pbs_twocolumn_bool || \int_if_even_p:n{\int_use:N\g_pbs_columns_int} + }{ + \tl_gclear:N\g_pbs_ocmap_tl + \tl_set:Nx\l_pbs_pdfpageresources_tl{\the\pdfpageresources} + \regex_replace_all:NnN\l_pbs_regex{}\l_pbs_pdfpageresources_tl + \group_begin: + \tl_set:Nx\l_pbs_temp_tl{\group_end: + \global\pdfpageresources{\l_pbs_pdfpageresources_tl} + }\l_pbs_temp_tl + } } + \cs_new:Nn\pbs_pdfemc:{\pdfliteral~direct~{EMC}} }{ %pgf + transparency related settings |