From bd031e64d0627026284118a2a8ceaf112f7e04e9 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sun, 1 May 2022 03:03:29 +0000
Subject: CTAN sync 202205010303

---
 macros/latex/contrib/bxpdfver/bxpdfver.sty | 84 ++++++++++++++++++++++++------
 1 file changed, 69 insertions(+), 15 deletions(-)

(limited to 'macros/latex/contrib/bxpdfver/bxpdfver.sty')

diff --git a/macros/latex/contrib/bxpdfver/bxpdfver.sty b/macros/latex/contrib/bxpdfver/bxpdfver.sty
index 826eef3efd..ccc9825f6f 100644
--- a/macros/latex/contrib/bxpdfver/bxpdfver.sty
+++ b/macros/latex/contrib/bxpdfver/bxpdfver.sty
@@ -1,7 +1,7 @@
 %%
 %% This is file 'bxpdfver.sty'.
 %%
-%% Copyright (c) 2014-2021 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2014-2022 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxpdfver}[2021/02/14 v0.5a]
+\ProvidesPackage{bxpdfver}[2022/04/28 v0.6]
 \def\bxpv@pkgname{bxpdfver}
 
 %% preparations
@@ -27,8 +27,9 @@
 \let\bxpv@version\relax   % version value (eg. 1.4)
 \let\bxpv@compress=t      % use compression?
 \let\bxpv@obj@compress=t  % use object stream?
-\chardef\bxpv@infolevel=2 % info-log level
+\let\bxpv@infolevel\relax % info-log level
 \let\bxpv@new@dvipdfmx=f  % assume new dvipdfmx?
+\let\bxpv@ignore@pdfmanagement=f
 
 %% \bxpv@valid@versions
 \def\bxpv@valid@versions{1.4,1.5,1.6,1.7,2.0}
@@ -82,6 +83,10 @@
   \let\bxpv@drv@type=0%
   \def\bxpv@drv@name{nodvidriver}%
 }
+\DeclareOption{resetdvidriver}{%
+  \let\bxpv@drv@type\relax
+  \let\bxpv@drv@name\relax
+}
 \DeclareOption{new-dvipdfmx}{%
   \let\bxpv@drv@type=d%
   \let\bxpv@new@dvipdfmx=t%
@@ -91,10 +96,34 @@
 \DeclareOption{lenient}{%
   \chardef\bxpv@infolevel=1
 }
+\DeclareOption{nolenient}{%
+  \chardef\bxpv@infolevel=2
+}
+\DeclareOption{lenient+}{%
+  \chardef\bxpv@infolevel=0
+}
+\DeclareOption{nolenient+}{%
+  \chardef\bxpv@infolevel=2
+}
+\DeclareOption{ignorepdfmanagement}{%
+  \let\bxpv@ignore@pdfmanagement=t
+}
+\DeclareOption{noignorepdfmanagement}{%
+  \let\bxpv@ignore@pdfmanagement=f
+}
 
 %% process
 \ProcessOptions*
 
+%% default infolevel value
+\ifx\bxpv@infolevel\relax
+  \if 0\bxpv@drv@type
+    \chardef\bxpv@infolevel=0 %'lenient+'
+  \else
+    \chardef\bxpv@infolevel=2 %'nolenient'
+  \fi
+\fi
+
 %--------------------------------------- helpers
 
 %% unique tokens
@@ -115,6 +144,17 @@
   \def#3{#2}%
 }
 
+%% \bxpv@warn{<message>}
+% Issues a warning.
+\@onlypreamble\bxpv@warn
+\def\bxpv@warn#1{%
+  \ifcase\bxpv@infolevel % info when lenient+
+    \PackageInfo\bxpv@pkgname{#1\@gobble}%
+  \else % warn otherwise
+    \PackageWarningNoLine\bxpv@pkgname{#1}%
+  \fi
+}
+
 %% \bxpv@fail{<message>}
 % Issues an error or a warning.
 \@onlypreamble\bxpv@fail
@@ -193,9 +233,13 @@
   \bxpv@check@hyperref % must come first
 }
 
-%% 'disabled' driver
-\if 0\bxpv@drv@type
-  \chardef\bxpv@infolevel=0
+%% check for new PDF management
+\if t\bxpv@ignore@pdfmanagement\else
+  \ifx\IfPDFManagementActiveTF\@undefined\else
+    \IfPDFManagementActiveTF{%
+      \global\let\bxpv@drv@type=m%
+    }{}
+  \fi
 \fi
 
 %% adjust internal dispatchers
@@ -218,8 +262,13 @@
 \bxpv@check@prim\outputmode{\chardef\bxpv@pdfoutput\outputmode}
 \bxpv@check@prim\ngbanner{\chardef\bxpv@pdfoutput\@ne}
 
-%% when in PDF mode
-\ifnum\bxpv@pdfoutput>\z@
+%% switch
+\if m\bxpv@drv@type
+  %% when in new PDF management
+  \bxpv@warn
+   {New PDF management is active}%
+\else\ifnum\bxpv@pdfoutput>\z@
+  %% when in PDF mode
   \global\let\bxpv@drv@type=p
   \global\let\bxpv@@compresslevel\pdfcompresslevel
   \global\let\bxpv@@objcompresslevel\pdfobjcompresslevel
@@ -320,17 +369,22 @@
     \global\let\bxpv@preserve@destinations\relax
   \fi
 \else
+  %% when in DVI mode
   % XeTeX should do just as dvipdfmx.
   \bxpv@check@prim\XeTeXversion{%
     \global\let\bxpv@drv@type=d%
   }
-\fi
-
-%% when in DVI mode
+  % strange engines
+  \bxpv@check@prim\HINTversion{%
+    \global\let\bxpv@drv@type=X%
+  }
+\fi\fi
 \if x\bxpv@drv@type % 'bad' driver
-  \bxpv@fail{Unsupported driver '\bxpv@drv@name'}%
-  % no further errors
-  \global\chardef\bxpv@infolevel=0
+  \bxpv@warn
+   {Unsupported driver '\bxpv@drv@name'}%
+\else\if X\bxpv@drv@type % strange engine
+  \bxpv@warn
+   {Unsupported engine}%
 \else\if d\bxpv@drv@type % 'dvipdfmx'
   \global\let\bxpv@suppress@compress\relax
   \global\let\bxpv@suppress@obj@compress\relax
@@ -349,7 +403,7 @@
   \bxpv@fail
    {No driver option is given}%
   \global\chardef\bxpv@infolevel=0
-\fi\fi\fi
+\fi\fi\fi\fi
 
 \endgroup
 \fi                                     %--------
-- 
cgit v1.2.3

