texlive[43044] Master/texmf-dist: media9 (24jan17)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 24 22:38:53 CET 2017


Revision: 43044
          http://tug.org/svn/texlive?view=revision&revision=43044
Author:   karl
Date:     2017-01-24 22:38:53 +0100 (Tue, 24 Jan 2017)
Log Message:
-----------
media9 (24jan17)

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	2017-01-24 21:38:37 UTC (rev 43043)
+++ trunk/Master/texmf-dist/doc/latex/media9/ChangeLog	2017-01-24 21:38:53 UTC (rev 43044)
@@ -1,3 +1,9 @@
+2017-01-24
+	* v0.73 : media9.sty
+	* v0.13 : pdfbase.sty
+	* fix: pdfbase.sty: xform generation via dvips: rescale oversized boxes to
+	fit within papersize to prevent cropping
+
 2017-01-10
 	* v0.72 : media9.sty
 	* v0.12 : 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	2017-01-24 21:38:37 UTC (rev 43043)
+++ trunk/Master/texmf-dist/tex/latex/media9/media9.sty	2017-01-24 21:38:53 UTC (rev 43044)
@@ -41,8 +41,8 @@
 \RequirePackage{atbegshi}
 \RequirePackage{atenddvi}
 
-\def\g at mix@date at tl{2017/01/10}
-\def\g at mix@version at tl{0.72}
+\def\g at mix@date at tl{2017/01/24}
+\def\g at mix@version at tl{0.73}
 
 \def\g at mix@liiikerneldate{2015/09/27}
 \def\g at mix@liiipkgdate{2015/09/27}

Modified: trunk/Master/texmf-dist/tex/latex/media9/pdfbase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/media9/pdfbase.sty	2017-01-24 21:38:37 UTC (rev 43043)
+++ trunk/Master/texmf-dist/tex/latex/media9/pdfbase.sty	2017-01-24 21:38:53 UTC (rev 43044)
@@ -123,8 +123,8 @@
 \RequirePackage{l3keys2e}
 \RequirePackage{atenddvi}
 
-\def\g at pbs@date at tl{2017/01/10}
-\def\g at pbs@version at tl{0.12}
+\def\g at pbs@date at tl{2017/01/24}
+\def\g at pbs@version at tl{0.13}
 
 \ProvidesExplPackage{pdfbase}{\g at pbs@date at tl}{\g at pbs@version at tl}
 {driver independent access to low-level PDF features}
@@ -483,8 +483,8 @@
 
     \bool_if:NT\g_pbs_pkgbigfiles_bool{
       \special{psfile=\jobname.pbsdat}
-      %open auxiliary file \jobname.pbsdat for writing hex encoded streams of the
-      %files to be embedded. This file is inserted into PS during dvips run
+      %open auxiliary file \jobname.pbsdat for writing hex encoded streams of
+      %the files to be embedded. This file is inserted into PS during dvips run
       \iow_new:N\g_pbs_mstreams_stream
       \iow_open:Nn\g_pbs_mstreams_stream{\jobname.pbsdat}
       \iow_now:Nn\g_pbs_mstreams_stream{
@@ -521,17 +521,17 @@
               {stream}{/stream}
               {fstream}{/stream}
             }~
-            /OBJ~pdfmark~
+            /OBJ~pdfmark
           }
         }
         \str_case:nn{#2}{
-          {dict}{\special{ps:~mark~\l_pbs_usenum_tl~<<#3>>/PUT~pdfmark~}}
+          {dict}{\special{ps:~mark~\l_pbs_usenum_tl~<<#3>>/PUT~pdfmark}}
           {array}{
-            \special{ps:~mark~\l_pbs_usenum_tl~0~[#3]/PUTINTERVAL~pdfmark~}
+            \special{ps:~mark~\l_pbs_usenum_tl~0~[#3]/PUTINTERVAL~pdfmark}
           }
           {stream}{\special{ps::[nobreak]
             ~mark~\l_pbs_usenum_tl~(\pbs_second_of_two:nn#3)/PUT~pdfmark~
-            ~mark~\l_pbs_usenum_tl~<<\pbs_first_of_two:nn#3>>/PUT~pdfmark~
+            ~mark~\l_pbs_usenum_tl~<<\pbs_first_of_two:nn#3>>/PUT~pdfmark
           }}
           {fstream}{
             \tl_set:Nn\l_pbs_offset_tl{0}
@@ -557,7 +557,7 @@
                       \pbs_second_of_two:nn#3
                     })~
                     /ASCIIHexDecode~filter~/PUT~
-                  pdfmark~
+                  pdfmark
                 }
               }
               \tl_set:Nx\l_pbs_offset_tl{\int_eval:n{\l_pbs_offset_tl+32767}}
@@ -571,7 +571,7 @@
             }{
               \special{ps:~
                 mark~\l_pbs_usenum_tl~<<\pbs_first_of_two:nn#3>>~/PUT~pdfmark~
-                mark~\l_pbs_usenum_tl~/CLOSE~pdfmark~
+                mark~\l_pbs_usenum_tl~/CLOSE~pdfmark
               }
             }
             \message{>}
@@ -598,7 +598,7 @@
           /_objdef~{pbs at obj\int_use:N\g_pbs_obj_int}
           /Rect~[pbs at llx~pbs at lly~pbs at urx~pbs at ury]
           #4
-        /ANN~pdfmark~
+        /ANN~pdfmark
       }
       \tl_gset:Nx\g_pbs_pdflastann_tl{{pbs at obj\int_use:N\g_pbs_obj_int}}
       \int_gincr:N\g_pbs_obj_int
@@ -626,20 +626,23 @@
     }
 
     \cs_new_nopar:Nn\pbs_pdfxform:nnn{ % #1 not used
-      \bool_if:nT{
-        \dim_compare_p:n{\box_wd:N#3>\paperwidth} ||
-        \dim_compare_p:n{\box_ht:N#3+\box_dp:N#3>\paperheight}
+      %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#3},
+        \dim_ratio:nn{\paperheight}{\box_ht:N#3+\box_dp:N#3}
+      )}}
+      \box_scale:Nnn#3{
+        \tl_use:c{scale_{pbs at obj\int_use:N\g_pbs_obj_int}}
       }{
-        \msg_warning:nn{pdfbase}{content~too~large}
+        \tl_use:c{scale_{pbs at obj\int_use:N\g_pbs_obj_int}}
       }
-      %mark bbox of box#3
       \group_begin:
+        %mark bbox of box#3
         \dim_set:Nn\unitlength{1pt}
         \begin{picture}(0,0)
-        %mark BBox of the graphics
         \put(0,-\dim_to_decimal:n{\box_dp:N#3}){
           \special{ps:
-            currentpoint~/pbs at lly~exch~def~/pbs at llx~exch~def~
+            currentpoint~/pbs at lly~exch~def~/pbs at llx~exch~def
           }
         }
         \put(
@@ -647,45 +650,30 @@
           \dim_to_decimal:n{\box_ht:N#3}
         ){
           \special{ps:
-            currentpoint~/pbs at ury~exch~def~/pbs at urx~exch~def~
+            currentpoint~/pbs at ury~exch~def~/pbs at urx~exch~def
           }
         }
-        %define some length values in current PS coordinate units
-        \put(0,0){
-          \special{ps:
-            currentpoint~/origin at y~exch~def~/origin at x~exch~def~
-          }
-        }
-        \dim_set:Nn\unitlength{1in}
-        \put(1,1){
-          \special{ps:
-            currentpoint~origin at y~exch~sub~/one at inch@y~exch~def~
-            origin at x~sub~/one at inch@x~exch~def~
-          }
-        }
         \end{picture}
       \group_end:
-      \tl_gset:cx{origin:{pbs at obj\int_use:N\g_pbs_obj_int}}{
-        origin at pbs@\int_use:N\g_pbs_obj_int
-      }
       \special{ps:~
         gsave~
-        %keep a record of lower left corner coordinates
-        true~setglobal~globaldict~
-        /origin at pbs@\int_use:N\g_pbs_obj_int~[currentpoint]~cvx~put~
-        false~setglobal~
+        currentpoint~/pbs at cury~exch~def~/pbs at curx~exch~def~
         %translate graphics to upper left page corner
         \bool_if:nF{\g_pbs_powerdot_bool||\g_pbs_lscape_bool}{
           {
             pbs at llx~neg~pbs at ury~neg~translate~
-            one at inch@x~DVImag~div~neg~one at inch@y~DVImag~div~neg~translate
+            Resolution~neg~VResolution~neg~translate %one inch left, one inch up
           }?pdfmark~
         }
         %distill graphics into XObject
-        mark~
+        gsave~pbs at curx~pbs at cury~translate~ %move origin (0,0) to the current
+        mark~                              %position
           /_objdef~{pbs at obj\int_use:N\g_pbs_obj_int}
-          /BBox~[pbs at llx~pbs at lly~pbs at urx~pbs at ury]
-        /BP~pdfmark~
+          /BBox~[
+            pbs at llx~pbs at curx~sub~pbs at lly~pbs at cury~sub~
+            pbs at urx~pbs at curx~sub~pbs at ury~pbs at cury~sub
+          ]
+        /BP~pdfmark~grestore~
         \int_compare:nT{#2>\c_zero}{
           %operations needed if used as annotation appearance
           {
@@ -707,7 +695,7 @@
             }{%flip around horizontal axis in portrait mode
               [1~0~0~-1~0~pbs at lly~pbs at ury~add]~concat
             }ifelse
-          }?pdfmark~
+          }?pdfmark
         }
       }
       \begin{picture}(0,0)\put(0,0){\box_use:N#3}\end{picture}
@@ -714,9 +702,9 @@
       \special{ps:~mark~/EP~pdfmark~grestore}
       \tl_gset:Nx\g_pbs_pdflastxform_tl{{pbs at obj\int_use:N\g_pbs_obj_int}}
       \int_gincr:N\g_pbs_obj_int
-      \int_compare:nTF{#2>\c_zero}{
+      \int_compare:nT{#2>\c_zero}{
         %Form XObjects for use as annotation appearances require that
-        %dvips generated PostScript to be further precessed with ps2pdf
+        %dvips generated PostScript to be further processed with ps2pdf
         %may not have the exaggerated dpi resolution resulting from dvips
         %option `-Ppdf'.
         \tl_if_exist:NF\g_pbs_dpiwarned_tl{
@@ -723,24 +711,20 @@
           \tl_new:N\g_pbs_dpiwarned_tl
           \AtEndDvi{\special{ps::[nobreak]\pbs_dpiwarning:}}
         }
-      }{%Form XObject to be inserted using /SP pdfmark:
-        %The /SP pdfmark for placement of Form XObjects works reliably only
-        %since gs-9.14. As gs-9.14 had some other TeX-related issues, we
-        %require 9.15.
-        \tl_if_exist:NF\g_pbs_gsoldwarned_tl{
-          \tl_new:N\g_pbs_gsoldwarned_tl
-          \AtEndDvi{\special{ps::[nobreak]\pbs_gsoldwarning:}}
-        }
       }
     }
 
     \cs_new_nopar:Nn\pbs_pdfrefxform:n{% #1: xform obj ID
+      %The /SP pdfmark for placement of Form XObjects works reliably only
+      %since gs-9.14. As gs-9.14 had some other TeX-related issues, we
+      %require 9.15.
+      \tl_if_exist:NF\g_pbs_gsoldwarned_tl{
+        \tl_new:N\g_pbs_gsoldwarned_tl
+        \AtEndDvi{\special{ps::[nobreak]\pbs_gsoldwarning:}}
+      }
       \special{ps:~
-        gsave~
-        currentpoint~pop~\tl_use:c{origin:#1}~pop~sub~
-        currentpoint~exch~pop~\tl_use:c{origin:#1}~exch~pop~sub~translate~
-        mark~#1~/SP~pdfmark~
-        grestore~
+        gsave~currentpoint~translate~1~\tl_use:c{scale_#1}~div~dup~scale~
+        mark~#1~/SP~pdfmark~grestore
       }
     }
 
@@ -752,13 +736,13 @@
         ||\str_if_eq_p:Vn\l_pbs_ext_tl{eps}
       }{
         \special{ps:~
-          mark~/_objdef~{pbs at obj\int_use:N\g_pbs_obj_int}~/NI~pdfmark~
+          mark~/_objdef~{pbs at obj\int_use:N\g_pbs_obj_int}~/NI~pdfmark
         }
         \special{psfile=#1~hsize=0~vsize=0}
         \special{ps:~
           {
             0~0~1~[1~0~0~1~0~0]~{}~image~%empty dummy, in case #1 is not
-          }?pdfmark~                     %a valid raster image file
+          }?pdfmark                      %a valid raster image file
         }
         \tl_gset:Nx\g_pbs_pdflastximage_tl{{pbs at obj\int_use:N\g_pbs_obj_int}}
         \int_gincr:N\g_pbs_obj_int



More information about the tex-live-commits mailing list