diff options
author | Karl Berry <karl@freefriends.org> | 2017-02-18 23:50:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-02-18 23:50:55 +0000 |
commit | 2a58bc861e6d6f07d2353626c354b4bfcf4e7288 (patch) | |
tree | 76b6c3dd29fe42a8b7c424efd5c8a4f5121a881a /Build | |
parent | d9791e563ad0373c954a61edcde91977740d7fdf (diff) |
/MediaBox override, sync from pdftex r767
git-svn-id: svn://tug.org/texlive/trunk@43267 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/NEWS | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftex.web | 65 |
3 files changed, 52 insertions, 27 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index 07fab84b503..940e1871e1c 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,11 @@ +2017-02-18 Heiko Oberdiek <heiko.oberdiek@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@freefriends.org> * regex/regex_internal.h (alloca) [!alloca]: do not try diff --git a/Build/source/texk/web2c/pdftexdir/NEWS b/Build/source/texk/web2c/pdftexdir/NEWS index e35738463ef..3a66ff8dd50 100644 --- a/Build/source/texk/web2c/pdftexdir/NEWS +++ b/Build/source/texk/web2c/pdftexdir/NEWS @@ -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 @@ pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016) (May 20, 2016) - 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 @@ pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015) - bugfixes: - ensure line-ending after a group dict in the output. + --------------------------------------------------- pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014) - changes: diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web index 15147b33ab3..74e7c4ee675 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftex.web +++ b/Build/source/texk/web2c/pdftexdir/pdftex.web @@ -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 @@ begin end; end; +@ |substr_of_str| is used in |pdf_ship_out| and |pdf_print_info|. +@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 @@ otherwise it will be a Page object. @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_begin_dict(pdf_last_page, 1); 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 @@ defined which value is choosen by an application. Therefore the keys |/Producer| and |/Creator| are only set if the token list |pdf_info_toks| converted to a string does not contain these key strings. -@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} +@p procedure pdf_print_info; {print info object} var s: str_number; creator_given, producer_given, creationdate_given, moddate_given, trapped_given: boolean; begin |