diff options
author | Karl Berry <karl@freefriends.org> | 2013-06-28 22:27:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-06-28 22:27:04 +0000 |
commit | 8cc5831a7004aa1d5c74d29b5806491fafc27323 (patch) | |
tree | 22b30ec2612b7c56b96d8055b2c8cfb98715c112 /Master/texmf-dist/tex/latex/media9/media9.sty | |
parent | 7b1f8729d0ff7cb92ac6b15eee622c02f855e1ea (diff) |
media9 (7jun13)
git-svn-id: svn://tug.org/texlive/trunk@31021 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9/media9.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/media9.sty | 104 |
1 files changed, 77 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty index 729754eca5b..557376460d6 100644 --- a/Master/texmf-dist/tex/latex/media9/media9.sty +++ b/Master/texmf-dist/tex/latex/media9/media9.sty @@ -4,7 +4,7 @@ % % multimedia inclusion package % -% Copyright 2012 Alexander Grahn +% Copyright 2012--\today Alexander Grahn % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -41,8 +41,8 @@ \RequirePackage{ifpdf} \RequirePackage{atbegshi} -\def\g@mix@date@tl{2013/03/27} -\def\g@mix@version@tl{0.27} +\def\g@mix@date@tl{2013/06/03} +\def\g@mix@version@tl{0.28} \def\g@mix@liiikerneldate{2012/07/16} \def\g@mix@liiipkgdate{2012/07/16} @@ -434,6 +434,32 @@ as~image~resources. } +%excessive DVI resolution message +\group_begin: +\char_set_catcode_active:N\+\let+\space +\tl_gset:Nx\g_mix_dpiwarning_tl{ + {Resolution~1200~gt~VResolution~1200~gt~or~product~(Ghostscript) + search~{pop~pop~pop~true}{pop~false}ifelse~and~{ + (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n + @@++++Warning:+DVI+resolution+greater+than+1200+dpi!+++++@@\token_to_str:N\n + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n + @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n + @@+Media+poster+and+button+faces+may+be+distorted+or+++++@@\token_to_str:N\n + @@+invisible.++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n + @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n + @@+Dvips+should+be+called+either+without+option+`-Ppdf':+@@\token_to_str:N\n + @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n + @@+++dvips+\c_job_name_tl\token_to_str:N\n + @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n + @@+or+with+a+different+resolution+setting:+++++++++++++++@@\token_to_str:N\n + @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n + @@+++dvips+-Ppdf+-D1200+\c_job_name_tl\token_to_str:N\n + @@+++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n) + print}~if}~?pdfmark +} +\group_end: + %commands for creating PDF objects, annots etc. \bool_if:NTF\g_mix_pdfoutput_bool{ %helper func to remove `0 R' part from pdf obj reference @@ -612,6 +638,9 @@ } } + %determine DVI resolution and output warning message if too big + \AtBeginDocument{\special{ps:\g_mix_dpiwarning_tl}} + \cs_new:Nn\mix_pdfobj:nnn{ % #1:objref; if empty, a new object number will be reserved % #2:type of object (dict|array|stream|fstream) @@ -2183,7 +2212,24 @@ \cs_generate_variant:Nn\regex_match:nnTF{nV} \cs_generate_variant:Nn\tl_if_blank:nF{c} +\bool_new:N\g_mix_btndraft_bool +\keys_define:nn{media9/mbtndraft}{ + draft .choice:, + draft / true .code:n = {\bool_gset_true:N\g_mix_btndraft_bool}, + draft / false .code:n = {\bool_gset_false:N\g_mix_btndraft_bool}, + draft .default:n = {true}, + + final .choice:, + final / true .code:n = {\bool_gset_false:N\g_mix_btndraft_bool}, + final / false .code:n = {\bool_gset_true:N\g_mix_btndraft_bool}, + final .default:n = {true}, + + unknown .code:n = {} +} \keys_define:nn{media9/mbtn}{ + draft .code:n = {}, + final .code:n = {}, + overface .code:n = { \hbox_set:Nn\l_mix_poster_box{#1} \mix_pdfxform:n{\l_mix_poster_box} @@ -2364,37 +2410,41 @@ \tl_gclear:N\g_mix_downbtn_tl \tl_gclear:N\g_mix_btnactions_tl %process options + \bool_gset_eq:NN\g_mix_btndraft_bool\g_mix_pkgdraft_bool \mix_uribegin: %treat URI characters correctly - \keys_set:nn{media9/mbtn}{#1} + \keys_set:nn{media9/mbtndraft}{#1} %detect draft/final on first pass + \bool_if:NF\g_mix_btndraft_bool{\keys_set:nn{media9/mbtn}{#1}} \mix_uriend: %normal button appearance \hbox_set:Nn\l_mix_poster_box{#2} \tl_set:Nx\width {\dim_use:N\box_wd:N\l_mix_poster_box} \tl_set:Nx\height{\dim_use:N\box_ht:N\l_mix_poster_box} \tl_set:Nx\depth {\dim_use:N\box_dp:N\l_mix_poster_box} - \mix_pdfxform:n{\l_mix_poster_box} - \tl_set:Nx\g_mix_normalbtn_tl{\g_mix_pdflastxform_tl} - %insert widget annotation - \mix_pdfannot:nnnn{\width}{\height}{\depth}{ - /Subtype/Widget - /T~(mbtn@\int_use:N\g_mix_mbtncnt_int) - /FT/Btn/Ff~65536 - /H/P - \tl_if_empty:NTF\g_mix_downbtn_tl{/H/I}{/H/P} - /AP~<< - /N~\g_mix_normalbtn_tl - \tl_if_empty:NF\g_mix_overbtn_tl{/R~\g_mix_overbtn_tl} - \tl_if_empty:NF\g_mix_downbtn_tl{/D~\g_mix_downbtn_tl} - >> - /A~<< - /S/JavaScript/JS~(app.focusRect=false;) - %sequence of actions to perform - \tl_if_empty:NF\g_mix_btnactions_tl{/Next~[\g_mix_btnactions_tl]} - >> - } - \hbox_to_wd:nn{\width}{ - \vrule~width~\c_zero_dim~height~\height~depth~\depth\hss + \bool_if:NTF\g_mix_btndraft_bool{\box_use:N\l_mix_poster_box}{ + \mix_pdfxform:n{\l_mix_poster_box} + \tl_set:Nx\g_mix_normalbtn_tl{\g_mix_pdflastxform_tl} + %insert widget annotation + \mix_pdfannot:nnnn{\width}{\height}{\depth}{ + /Subtype/Widget + /T~(mbtn@\int_use:N\g_mix_mbtncnt_int) + /FT/Btn/Ff~65536 + /H/P + \tl_if_empty:NTF\g_mix_downbtn_tl{/H/I}{/H/P} + /AP~<< + /N~\g_mix_normalbtn_tl + \tl_if_empty:NF\g_mix_overbtn_tl{/R~\g_mix_overbtn_tl} + \tl_if_empty:NF\g_mix_downbtn_tl{/D~\g_mix_downbtn_tl} + >> + /A~<< + /S/JavaScript/JS~(app.focusRect=false;) + %sequence of actions to perform + \tl_if_empty:NF\g_mix_btnactions_tl{/Next~[\g_mix_btnactions_tl]} + >> + } + \hbox_to_wd:nn{\width}{ + \vrule~width~\c_zero_dim~height~\height~depth~\depth\hss + } + \int_gincr:N\g_mix_mbtncnt_int } - \int_gincr:N\g_mix_mbtncnt_int \group_end: } |