texlive[64210] Master/texmf-dist: pdfoverlay (27aug22)
commits+karl at tug.org
commits+karl at tug.org
Sat Aug 27 22:22:00 CEST 2022
Revision: 64210
http://tug.org/svn/texlive?view=revision&revision=64210
Author: karl
Date: 2022-08-27 22:21:59 +0200 (Sat, 27 Aug 2022)
Log Message:
-----------
pdfoverlay (27aug22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/pdfoverlay/README.md
trunk/Master/texmf-dist/doc/latex/pdfoverlay/pdfoverlay.pdf
trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.dtx
trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.ins
trunk/Master/texmf-dist/tex/latex/pdfoverlay/pdfoverlay.sty
Modified: trunk/Master/texmf-dist/doc/latex/pdfoverlay/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pdfoverlay/README.md 2022-08-27 20:21:38 UTC (rev 64209)
+++ trunk/Master/texmf-dist/doc/latex/pdfoverlay/README.md 2022-08-27 20:21:59 UTC (rev 64210)
@@ -58,7 +58,7 @@
## Licence
```
-Copyright (c) 2018-2021 David Purton <dcpurton at marshwiggle.net>
+Copyright (c) 2018-2022 David Purton <dcpurton at marshwiggle.net>
This work may be distributed and/or modified under the conditions of
the LaTeX Project2 Public License, either version 1.3c of this license
Modified: trunk/Master/texmf-dist/doc/latex/pdfoverlay/pdfoverlay.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.dtx 2022-08-27 20:21:38 UTC (rev 64209)
+++ trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.dtx 2022-08-27 20:21:59 UTC (rev 64210)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (c) 2018-2021 David Purton <dcpurton at marshwiggle.net>
+% Copyright (c) 2018-2022 David Purton <dcpurton at marshwiggle.net>
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3c of this license
@@ -23,10 +23,11 @@
% \changes{v1.2}{2020/10/29}{Update to use \pkg{l3hooks}}
% \changes{v1.2a}{2021/02/25}{Ensure backend loaded before counting pages}
% \changes{v1.2b}{2021/11/01}{Protect unexpandable macros}
+% \changes{v1.3}{2022/08/27}{Allow PDF file name to be passed in as macro}
%
% \title{The \pkg{pdfoverlay} package}
% \author{David Purton\thanks{Email: \url{dcpurton at marshwiggle.net}}}
-% \date{2021/11/01 v1.2b}
+% \date{2022/08/27 v1.3}
%
% \maketitle
%
@@ -165,7 +166,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\ProvidesExplPackage{pdfoverlay}{2021/11/01}{1.2b}
+\ProvidesExplPackage{pdfoverlay}{2022/08/27}{1.3}
{Overlay text on an existing PDF document (DCP)}
% \end{macrocode}
%
@@ -177,7 +178,7 @@
%
% \noindent Call \cs{@@_output_pdf_page:} on every page.
% \begin{macrocode}
-\AddToHook { shipout/background } { \@@_output_pdf_page: }
+\hook_gput_code:nnn { shipout/background } { pdfoverlay } { \@@_output_pdf_page: }
% \end{macrocode}
%
% \noindent Add an empty \cs{hbox:n} to the end of the document if an action
@@ -184,7 +185,7 @@
% is pending. This is required to ensure that the last requested page from the
% PDF file is output even if there isn't any other content on the page.
% \begin{macrocode}
-\AtEndDocument {
+\hook_gput_code:nnn { enddocument } { pdfoverlay } {
\bool_if:NT \g_@@_action_pending_bool
{
\hbox:n { }
@@ -258,10 +259,10 @@
%
% \subsection{Private Variables and Helper Functions}
%
-% \begin{macro}{\g_@@_pdf_file_name_str}
+% \begin{macro}{\g_@@_pdf_file_name_tl}
% Store the PDF file name.
% \begin{macrocode}
-\str_new:N \g_@@_pdf_file_name_str
+\tl_new:N \g_@@_pdf_file_name_tl
% \end{macrocode}
% \end{macro}
%
@@ -333,7 +334,7 @@
{
{ \bool_if_p:N \g_@@_output_active_bool }
{ \bool_not_p:n
- { \str_if_empty_p:N \g_@@_pdf_file_name_str } }
+ { \tl_if_empty_p:N \g_@@_pdf_file_name_tl } }
{ \int_compare_p:n
{ \c_zero_int <= \g_@@_page_int
< \g_@@_page_count_int } }
@@ -370,7 +371,7 @@
{
\exp_not:N \includegraphics
[ \clist_use:Nn \g_@@_graphics_options_clist { , } ]
- { \g_@@_pdf_file_name_str }
+ { \g_@@_pdf_file_name_tl }
}
}
}
@@ -393,7 +394,7 @@
% The PDF page to be placed is available as the coffin
% \cs{g_@@_pdf_page_coffin}.
% \begin{macrocode}
-\cs_new:Nn \@@_place_pdf_page:
+\cs_new_protected:Nn \@@_place_pdf_page:
{
\put ( 0.5 \paperwidth, -0.5 \paperheight )
{
@@ -405,7 +406,7 @@
% \end{macro}
%
% \begin{macro}{\@@_count_pdf_pages:}
-% Count the number of pages in the current \cs{g_@@_pdf_file_name_str} and
+% Count the number of pages in the current \cs{g_@@_pdf_file_name_tl} and
% store the result in \cs{g_@@_pdf_page_count_int}. If no PDF has been set
% with \cs{pdfoverlay_set_pdf} then \cs{g_@@_pdf_page_count_int} is set to
% zero.
@@ -413,7 +414,7 @@
\cs_new_protected:Nn \@@_count_pdf_pages:
{
\int_gzero:N \g_@@_page_count_int
- \str_if_empty:NTF \g_@@_pdf_file_name_str
+ \tl_if_empty:NTF \g_@@_pdf_file_name_tl
{
\msg_error:nn { pdfoverlay } { file-not-set }
}
@@ -422,7 +423,7 @@
{
\int_gset:Nn \g_@@_page_count_int
{
- \XeTeXpdfpagecount " \g_@@_pdf_file_name_str "
+ \XeTeXpdfpagecount " \g_@@_pdf_file_name_tl "
}
}
{
@@ -434,7 +435,7 @@
{
\sys_if_engine_pdftex:TF
{
- \pdfximage { \g_@@_pdf_file_name_str }
+ \pdfximage { \g_@@_pdf_file_name_tl }
\int_gset_eq:NN
\g_@@_page_count_int
\pdflastximagepages
@@ -443,7 +444,7 @@
\sys_if_engine_luatex:TF
{
\saveimageresource
- { \g_@@_pdf_file_name_str }
+ { \g_@@_pdf_file_name_tl }
\int_gset_eq:NN
\g_@@_page_count_int
\lastsavedimageresourcepages
@@ -470,7 +471,7 @@
% \begin{macrocode}
\prg_new_conditional:Nnn \@@_if_page_exists:n { p, T, F, TF }
{
- \str_if_empty:NTF \g_@@_pdf_file_name_str
+ \tl_if_empty:NTF \g_@@_pdf_file_name_tl
{
\msg_error:nn { pdfoverlay } { file-not-set }
\prg_return_false:
@@ -485,7 +486,7 @@
}
{
\msg_error:nnxxx { pdfoverlay } { page-not-found }
- { \str_use:N \g_@@_pdf_file_name_str }
+ { \g_@@_pdf_file_name_tl }
{ \int_eval:n { #1 } }
{ \int_use:N \g_@@_page_count_int }
\prg_return_false:
@@ -508,7 +509,7 @@
% \begin{macrocode}
\file_if_exist:nTF { #1 }
{
- \str_gset:Nn \g_@@_pdf_file_name_str { #1 }
+ \tl_gset:Nn \g_@@_pdf_file_name_tl { #1 }
% \end{macrocode}
% Find the number of pages in the PDF file.
% \begin{macrocode}
@@ -521,7 +522,7 @@
\bool_gset_false:N \g_@@_action_pending_bool
}
{
- \msg_error:nnn { pdfoverlay } { file-not-found } { #1 }
+ \msg_error:nnx { pdfoverlay } { file-not-found } { #1 }
}
}
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.ins 2022-08-27 20:21:38 UTC (rev 64209)
+++ trunk/Master/texmf-dist/source/latex/pdfoverlay/pdfoverlay.ins 2022-08-27 20:21:59 UTC (rev 64210)
@@ -1,6 +1,6 @@
\iffalse meta-comment
-Copyright (c) 2018-2021 David Purton <dcpurton at marshwiggle.net>
+Copyright (c) 2018-2022 David Purton <dcpurton at marshwiggle.net>
This work may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3c of this license
@@ -19,7 +19,7 @@
This is a generated file.
-Copyright (c) 2018-2021 David Purton <dcpurton at marshwiggle.net>
+Copyright (c) 2018-2022 David Purton <dcpurton at marshwiggle.net>
This work may be distributed and/or modified under the conditions of
the LaTeX Project2 Public License, either version 1.3c of this license
Modified: trunk/Master/texmf-dist/tex/latex/pdfoverlay/pdfoverlay.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfoverlay/pdfoverlay.sty 2022-08-27 20:21:38 UTC (rev 64209)
+++ trunk/Master/texmf-dist/tex/latex/pdfoverlay/pdfoverlay.sty 2022-08-27 20:21:59 UTC (rev 64210)
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (c) 2018-2021 David Purton <dcpurton at marshwiggle.net>
+%% Copyright (c) 2018-2022 David Purton <dcpurton at marshwiggle.net>
%%
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project2 Public License, either version 1.3c of this license
@@ -25,11 +25,11 @@
%% and the derived files pdfoverlay.sty and pdfoverlay.pdf
%%
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\ProvidesExplPackage{pdfoverlay}{2021/11/01}{1.2b}
+\ProvidesExplPackage{pdfoverlay}{2022/08/27}{1.3}
{Overlay text on an existing PDF document (DCP)}
\RequirePackage{graphicx}
-\AddToHook { shipout/background } { \__pdfoverlay_output_pdf_page: }
-\AtEndDocument {
+\hook_gput_code:nnn { shipout/background } { pdfoverlay } { \__pdfoverlay_output_pdf_page: }
+\hook_gput_code:nnn { enddocument } { pdfoverlay } {
\bool_if:NT \g__pdfoverlay_action_pending_bool
{
\hbox:n { }
@@ -60,7 +60,7 @@
{ #1~not~supported. }
{ The~#1~engine~is~not~supported. \\
Use~one~of~pdftex,~luatex,~or~xetex. }
-\str_new:N \g__pdfoverlay_pdf_file_name_str
+\tl_new:N \g__pdfoverlay_pdf_file_name_tl
\int_new:N \g__pdfoverlay_page_count_int
\int_new:N \g__pdfoverlay_page_int
\bool_new:N \g__pdfoverlay_output_active_bool
@@ -80,7 +80,7 @@
{
{ \bool_if_p:N \g__pdfoverlay_output_active_bool }
{ \bool_not_p:n
- { \str_if_empty_p:N \g__pdfoverlay_pdf_file_name_str } }
+ { \tl_if_empty_p:N \g__pdfoverlay_pdf_file_name_tl } }
{ \int_compare_p:n
{ \c_zero_int <= \g__pdfoverlay_page_int
< \g__pdfoverlay_page_count_int } }
@@ -100,11 +100,11 @@
{
\exp_not:N \includegraphics
[ \clist_use:Nn \g__pdfoverlay_graphics_options_clist { , } ]
- { \g__pdfoverlay_pdf_file_name_str }
+ { \g__pdfoverlay_pdf_file_name_tl }
}
}
}
-\cs_new:Nn \__pdfoverlay_place_pdf_page:
+\cs_new_protected:Nn \__pdfoverlay_place_pdf_page:
{
\put ( 0.5 \paperwidth, -0.5 \paperheight )
{
@@ -115,7 +115,7 @@
\cs_new_protected:Nn \__pdfoverlay_count_pdf_pages:
{
\int_gzero:N \g__pdfoverlay_page_count_int
- \str_if_empty:NTF \g__pdfoverlay_pdf_file_name_str
+ \tl_if_empty:NTF \g__pdfoverlay_pdf_file_name_tl
{
\msg_error:nn { pdfoverlay } { file-not-set }
}
@@ -124,7 +124,7 @@
{
\int_gset:Nn \g__pdfoverlay_page_count_int
{
- \XeTeXpdfpagecount " \g__pdfoverlay_pdf_file_name_str "
+ \XeTeXpdfpagecount " \g__pdfoverlay_pdf_file_name_tl "
}
}
{
@@ -136,7 +136,7 @@
{
\sys_if_engine_pdftex:TF
{
- \pdfximage { \g__pdfoverlay_pdf_file_name_str }
+ \pdfximage { \g__pdfoverlay_pdf_file_name_tl }
\int_gset_eq:NN
\g__pdfoverlay_page_count_int
\pdflastximagepages
@@ -145,7 +145,7 @@
\sys_if_engine_luatex:TF
{
\saveimageresource
- { \g__pdfoverlay_pdf_file_name_str }
+ { \g__pdfoverlay_pdf_file_name_tl }
\int_gset_eq:NN
\g__pdfoverlay_page_count_int
\lastsavedimageresourcepages
@@ -165,7 +165,7 @@
}
\prg_new_conditional:Nnn \__pdfoverlay_if_page_exists:n { p, T, F, TF }
{
- \str_if_empty:NTF \g__pdfoverlay_pdf_file_name_str
+ \tl_if_empty:NTF \g__pdfoverlay_pdf_file_name_tl
{
\msg_error:nn { pdfoverlay } { file-not-set }
\prg_return_false:
@@ -180,7 +180,7 @@
}
{
\msg_error:nnxxx { pdfoverlay } { page-not-found }
- { \str_use:N \g__pdfoverlay_pdf_file_name_str }
+ { \g__pdfoverlay_pdf_file_name_tl }
{ \int_eval:n { #1 } }
{ \int_use:N \g__pdfoverlay_page_count_int }
\prg_return_false:
@@ -191,7 +191,7 @@
{
\file_if_exist:nTF { #1 }
{
- \str_gset:Nn \g__pdfoverlay_pdf_file_name_str { #1 }
+ \tl_gset:Nn \g__pdfoverlay_pdf_file_name_tl { #1 }
\__pdfoverlay_count_pdf_pages:
\int_gzero:N \g__pdfoverlay_page_int
\bool_gset_true:N \g__pdfoverlay_output_active_bool
@@ -198,7 +198,7 @@
\bool_gset_false:N \g__pdfoverlay_action_pending_bool
}
{
- \msg_error:nnn { pdfoverlay } { file-not-found } { #1 }
+ \msg_error:nnx { pdfoverlay } { file-not-found } { #1 }
}
}
\cs_new_protected:Nn \pdfoverlay_set_graphics_options:n
More information about the tex-live-commits
mailing list.