diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-15 00:22:58 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-15 00:22:58 +0000 |
commit | 6d6729a03531e8ce4cb1c6d05f35f39fed781e33 (patch) | |
tree | 0005267f85cfcece4e5da24332dddc316766b0e0 /Build/source/texk/web2c/pdftexdir | |
parent | d7eca53499eeb13691f319eb72e360defa892896 (diff) |
pdftexdir: Add a new primitive \pdfsuppressptexinfo. Import from the upstream.
git-svn-id: svn://tug.org/texlive/trunk@39718 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftex.web | 16 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftoepdf.cc | 33 |
3 files changed, 42 insertions, 12 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index c31c62b7dcd..f09db7273bf 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,8 @@ +2016-02-15 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * pdftex.web, pdftoepdf.cc: Add \pdfsuppressptexinfo, imported from + the upstream. + 2016-01-19 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * pdftex.web: Avoid to crash for unusual virtual fonts which lead to diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web index 420900b8507..027f46fab17 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftex.web +++ b/Build/source/texk/web2c/pdftexdir/pdftex.web @@ -5689,7 +5689,8 @@ that will be defined later. @d pdf_suppress_warning_dup_map_code = pdftex_first_integer_code + 28 {suppress warning about duplicated map lines} @d pdf_suppress_warning_page_group_code = pdftex_first_integer_code + 29 {suppress warning about multiple pdfs with page group} @d pdf_info_omit_date_code = pdftex_first_integer_code + 30 {omit generating CreationDate and ModDate} -@d pdf_int_pars=pdftex_first_integer_code + 31 {total number of \pdfTeX's integer parameters} +@d pdf_suppress_ptex_info_code = pdftex_first_integer_code + 31 {suppress /PTEX.* entries in PDF dictionaries} +@d pdf_int_pars=pdftex_first_integer_code + 32 {total number of \pdfTeX's integer parameters} @# @d etex_int_base=pdf_int_pars {base for \eTeX's integer parameters} @d tracing_assigns_code=etex_int_base {show assignments} @@ -5799,6 +5800,7 @@ that will be defined later. @d pdf_suppress_warning_dup_map == int_par(pdf_suppress_warning_dup_map_code) @d pdf_suppress_warning_page_group == int_par(pdf_suppress_warning_page_group_code) @d pdf_info_omit_date == int_par(pdf_info_omit_date_code) +@d pdf_suppress_ptex_info == int_par(pdf_suppress_ptex_info_code) @# @d tracing_assigns==int_par(tracing_assigns_code) @d tracing_groups==int_par(tracing_groups_code) @@ -5905,6 +5907,7 @@ pdf_suppress_warning_dup_dest_code: print_esc("pdfsuppresswarningdupdest"); pdf_suppress_warning_dup_map_code: print_esc("pdfsuppresswarningdupmap"); pdf_suppress_warning_page_group_code:print_esc("pdfsuppresswarningpagegroup"); pdf_info_omit_date_code:print_esc("pdfinfoomitdate"); +pdf_suppress_ptex_info_code: print_esc("pdfsuppressptexinfo"); @/@<Cases for |print_param|@>@/ othercases print("[unknown integer parameter!]") endcases; @@ -6093,6 +6096,8 @@ primitive("pdfsuppresswarningpagegroup",assign_int,int_base+pdf_suppress_warning @!@:pdf_suppress_warning_page_group_}{\.{\\pdfsuppresswarningpagegroup} primitive@> primitive("pdfinfoomitdate",assign_int,int_base+pdf_info_omit_date_code);@/ @!@:pdf_info_omit_date_}{\.{\\pdfinfoomitdate} primitive@> +primitive("pdfsuppressptexinfo",assign_int,int_base+pdf_suppress_ptex_info_code);@/ +@!@:pdf_suppress_ptex_info_}{\.{\\pdfsuppressptexinfo} primitive@> @ @<Cases of |print_cmd_chr|...@>= assign_int: if chr_code<count_base then print_param(chr_code-int_base) @@ -15022,6 +15027,11 @@ begin get_pdf_suppress_warning_page_group := pdf_suppress_warning_page_group; end; +function get_pdf_suppress_ptex_info: integer; +begin + get_pdf_suppress_ptex_info := pdf_suppress_ptex_info; +end; + function get_nullfont: internal_font_number; begin get_nullfont := null_font; @@ -20025,7 +20035,9 @@ begin if not trapped_given then begin pdf_print_ln("/Trapped /False"); end; - pdf_str_entry_ln("PTEX.Fullbanner", pdftex_banner); + if pdf_suppress_ptex_info mod 2 = 0 then begin + pdf_str_entry_ln("PTEX.Fullbanner", pdftex_banner); + end; pdf_end_dict; end; diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc index a8c4a0221a3..253024fe8f1 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc +++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc @@ -66,10 +66,11 @@ extern "C" { #include <pdftexdir/ptexmac.h> #include <pdftexdir/pdftex-common.h> -// This function from pdftex.web gets declared in pdftexcoerce.h in the +// These functions from pdftex.web gets declared in pdftexcoerce.h in the // usual web2c way, but we cannot include that file here because C++ // does not allow it. extern int getpdfsuppresswarningpagegroup(void); +extern integer getpdfsuppressptexinfo(void); } // The prefix "PTEX" for the PDF keys is special to pdfTeX; @@ -77,6 +78,11 @@ extern int getpdfsuppresswarningpagegroup(void); #define pdfkeyprefix "PTEX" +#define MASK_SUPPRESS_PTEX_FULLBANNER 0x01 +#define MASK_SUPPRESS_PTEX_FILENAME 0x02 +#define MASK_SUPPRESS_PTEX_PAGENUMBER 0x04 +#define MASK_SUPPRESS_PTEX_INFODICT 0x08 + // PdfObject encapsulates the xpdf Object type, // and properly frees its resources on destruction. // Use obj-> to access members of the Object, @@ -840,6 +846,7 @@ void write_epdf(void) int rotate; double scale[6] = { 0, 0, 0, 0, 0, 0 }; bool writematrix = false; + int suppress_ptex_info = getpdfsuppressptexinfo(); static const char *pageDictKeys[] = { "LastModified", "Metadata", @@ -867,15 +874,21 @@ void write_epdf(void) pdf_puts("/FormType 1\n"); // write additional information - pdf_printf("/%s.FileName (%s)\n", pdfkeyprefix, - convertStringToPDFString(pdf_doc->file_name, - strlen(pdf_doc->file_name))); - pdf_printf("/%s.PageNumber %i\n", pdfkeyprefix, epdf_selected_page); - pdf_doc->doc->getDocInfoNF(&info); - if (info.isRef()) { - // the info dict must be indirect (PDF Ref p. 61) - pdf_printf("/%s.InfoDict ", pdfkeyprefix); - pdf_printf("%d 0 R\n", addOther(info.getRef())); + if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_FILENAME) == 0) { + pdf_printf("/%s.FileName (%s)\n", pdfkeyprefix, + convertStringToPDFString(pdf_doc->file_name, + strlen(pdf_doc->file_name))); + } + if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_PAGENUMBER) == 0) { + pdf_printf("/%s.PageNumber %i\n", pdfkeyprefix, (int) epdf_selected_page); + } + if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_INFODICT) == 0) { + pdf_doc->doc->getDocInfoNF(&info); + if (info.isRef()) { + // the info dict must be indirect (PDF Ref p. 61) + pdf_printf("/%s.InfoDict ", pdfkeyprefix); + pdf_printf("%d 0 R\n", addOther(info.getRef())); + } } // get the pagebox (media, crop...) to use. pagebox = get_pagebox(page, epdf_page_box); |