texlive[43267] Build/source/texk/web2c/pdftexdir: /MediaBox override,

commits+karl at tug.org commits+karl at tug.org
Sun Feb 19 00:50:55 CET 2017


Revision: 43267
          http://tug.org/svn/texlive?view=revision&revision=43267
Author:   karl
Date:     2017-02-19 00:50:55 +0100 (Sun, 19 Feb 2017)
Log Message:
-----------
/MediaBox override, sync from pdftex r767

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=767

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
    trunk/Build/source/texk/web2c/pdftexdir/NEWS
    trunk/Build/source/texk/web2c/pdftexdir/pdftex.web

Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2017-02-18 23:08:26 UTC (rev 43266)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2017-02-18 23:50:55 UTC (rev 43267)
@@ -1,3 +1,11 @@
+2017-02-18  Heiko Oberdiek  <heiko.oberdiek at googlemail.com>
+
+	* pdftex.web (substr_of_str): move earlier.
+	(Write out page object): if \MediaBox was given in \pdfpageattr,
+	do not output our own.
+	Mail from Michael Altmann to pdftex, 9 Feb 2017 13:19:05.
+	http://tug.org/pipermail/pdftex/2017-February/009097.html
+
 2017-02-16  Karl Berry  <karl at freefriends.org>
 
 	* regex/regex_internal.h (alloca) [!alloca]: do not try

Modified: trunk/Build/source/texk/web2c/pdftexdir/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/NEWS	2017-02-18 23:08:26 UTC (rev 43266)
+++ trunk/Build/source/texk/web2c/pdftexdir/NEWS	2017-02-18 23:50:55 UTC (rev 43267)
@@ -1,9 +1,13 @@
+pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
 - changes:
   - rename envvar SOURCE_DATE_EPOCH_TEX_PRIMITIVES to FORCE_SOURCE_DATE;
     no changes in functionality.
+  - if the \pdfpageattr token list contains the string "/MediaBox",
+    omitting output of the default /MediaBox.
 
 - bugfixes:
   - \pdflastmatch more reliable when there was no match
+
 ---------------------------------------------------
 pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016)  (May 20, 2016)
 - changes:
@@ -28,6 +32,7 @@
 
 - bugfixes:
   - do not crash if font size of a vf >= 2048pt.
+
 ---------------------------------------------------
 pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015)
 - changes:
@@ -37,6 +42,7 @@
 
 - bugfixes:
   - ensure line-ending after a group dict in the output.
+
 ---------------------------------------------------
 pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014)
 - changes:

Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2017-02-18 23:08:26 UTC (rev 43266)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2017-02-18 23:50:55 UTC (rev 43267)
@@ -1,4 +1,4 @@
-% Copyright 1996-2016 Han Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh,
+% Copyright 1996-2017 Han Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh,
 % <thanh@@pdftex.org>
 
 % This file is part of pdfTeX.
@@ -18813,6 +18813,28 @@
     end;
 end;
 
+@ |substr_of_str| is used in |pdf_ship_out| and |pdf_print_info|.
+ at p function substr_of_str(s, t: str_number):boolean;
+label continue,exit;
+var j, k, kk: pool_pointer; {running indices}
+begin
+    k:=str_start[t];
+    while (k < str_start[t+1] - length(s)) do begin
+        j:=str_start[s];
+        kk:=k;
+        while (j < str_start[s+1]) do begin
+            if str_pool[j] <> str_pool[kk] then
+                goto continue;
+            incr(j);
+            incr(kk);
+        end;
+        substr_of_str:=true;
+        return;
+        continue: incr(k);
+    end;
+    substr_of_str:=false;
+end;
+
 @ |pdf_ship_out| is used instead of |ship_out| to shipout a box to PDF
 output. If |shipping_page| is not set then the output will be a Form object,
 otherwise it will be a Page object.
@@ -18820,6 +18842,8 @@
 @p procedure pdf_ship_out(p: pointer; shipping_page: boolean); {output the box |p|}
 label done, done1;
 var i,j,k:integer; {general purpose accumulators}
+s: pool_pointer; {index into |str_pool|}
+mediabox_given: boolean;
 save_font_list: pointer; {to save |pdf_font_list| during flushing pending forms}
 save_obj_list: pointer; {to save |pdf_obj_list|}
 save_ximage_list: pointer; {to save |pdf_ximage_list|}
@@ -19092,10 +19116,18 @@
 pdf_print_ln("/Type /Page");
 pdf_indirect_ln("Contents", pdf_last_stream);
 pdf_indirect_ln("Resources", pdf_last_resources);
-pdf_print("/MediaBox [0 0 ");
-pdf_print_mag_bp(cur_page_width); pdf_out(" ");
-pdf_print_mag_bp(cur_page_height);
-pdf_print_ln("]");
+mediabox_given:=false;
+if pdf_page_attr <> null then begin
+    s:=tokens_to_string(pdf_page_attr);
+    mediabox_given:=substr_of_str("/MediaBox", s);
+    flush_str(s);
+end;
+if not mediabox_given then begin
+    pdf_print("/MediaBox [0 0 ");
+    pdf_print_mag_bp(cur_page_width); pdf_out(" ");
+    pdf_print_mag_bp(cur_page_height);
+    pdf_print_ln("]");
+end;
 if pdf_page_attr <> null then
     pdf_print_toks_ln(pdf_page_attr);
 @<Generate parent pages object@>;
@@ -19973,28 +20005,7 @@
 |/Producer| and |/Creator| are only set if the token list
 |pdf_info_toks| converted to a string does not contain these key strings.
 
- at p function substr_of_str(s, t: str_number):boolean;
-label continue,exit;
-var j, k, kk: pool_pointer; {running indices}
-begin
-    k:=str_start[t];
-    while (k < str_start[t+1] - length(s)) do begin
-        j:=str_start[s];
-        kk:=k;
-        while (j < str_start[s+1]) do begin
-            if str_pool[j] <> str_pool[kk] then
-                goto continue;
-            incr(j);
-            incr(kk);
-        end;
-        substr_of_str:=true;
-        return;
-        continue: incr(k);
-    end;
-    substr_of_str:=false;
-end;
-
-procedure pdf_print_info; {print info object}
+ at p procedure pdf_print_info; {print info object}
 var s: str_number;
     creator_given, producer_given, creationdate_given, moddate_given, trapped_given: boolean;
 begin



More information about the tex-live-commits mailing list