% \iffalse meta-comment
% File: pdfprivacy.dtx
% Copyright (C) 2017 Laurens Sion
% ---------------------------------------------------------------------
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3c of this license 
% or (at your option) any later version. The latest version of this 
% license is in:
%
%   http://www.latex-project.org/lppl.txt
%
% This work consists of the files pdfprivacy.dtx and pdfprivacy.ins
% and the derived file pdfprivacy.sty.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{pdfprivacy.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[2013/03/31]
%<package>\ProvidesPackage{pdfprivacy}
%<*driver|package>
    [2026/05/24 v1.1 PDF Privacy package]
%</driver|package>
%
%<*driver>
\documentclass[a4paper]{ltxdoc}
% make sure version 1.10 is behind 1.9, not 1.1
\makeatletter
\@ifdefinable{\org@changes@}{%
  \let\org@changes@\changes@
  \@ifdefinable{\my@changes}{%
    \def\my@changes v#1.#2\@nil{%
      \org@changes@{v#1.\six@digits{#2}=v#1.#2}%
    }%
    \newcommand*{\six@digits}[1]{%
      \ifnum#1<100000 0\fi
      \ifnum#1<10000 0\fi
      \ifnum#1<1000 0\fi
      \ifnum#1<100 0\fi
      \two@digits{#1}%
    }%
    \renewcommand*{\changes@}[1]{%
      \my@changes#1\@nil
    }%
  }%
}
\makeatother
\usepackage[inline]{enumitem}
\usepackage[all]{pdfprivacy}
\usepackage{parskip}
\usepackage[hidelinks]{hyperref}
\usepackage{cleveref}
\EnableCrossrefs         
\CodelineIndex
%\PageIndex
\RecordChanges
%\OnlyDescription
\begin{document}
  \DocInput{pdfprivacy.dtx}
\end{document}
%</driver>
% \fi
%
%  \CheckSum{164}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
% \changes{v1.0}{2017/12/03}{Initial version}
% \changes{v1.1}{2023/05/24}{Support for XeLaTex and LuaLaTex. Added strict mode.}
%
% \GetFileInfo{pdfprivacy.dtx}
%
% \DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
% \DoNotIndex{\@badmath,\@centercr,\@cite}
% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
% \DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
% \DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint}
% \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
% \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
% \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
% \DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
% \DoNotIndex{\bullet}
% \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
% \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentpackage}
% \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
% \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
% \DoNotIndex{\fbox}
% \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
% \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
% \DoNotIndex{\input}
% \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
% \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
% \DoNotIndex{\NeedsTeXFormat,\newdimen}
% \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
% \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
% \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
% \DoNotIndex{\protect,\Providespackage,\raggedbottom,\raggedright}
% \DoNotIndex{\refstepcounter,\relax,\renewcommand}
% \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily}
% \DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength}
% \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
% \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
% \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
% \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
% \DoNotIndex{\wd,\xiipt,\year,\z@}
% 
%
% \title{The \textsf{pdfprivacy} package\thanks{This document
%   corresponds to \textsf{pdfprivacy}~\fileversion, dated \filedate.}}
% \author{Laurens Sion \\ \texttt{laurens@sion.info}}
%
% \maketitle
%
% \begin{abstract}
% \noindent
% Creating pdfs with pdf\LaTeX{} populates several pdf meta-data fields such as date/time of creation/modification, information about the latex installation (e.g., pdf\TeX{} version), and the relative paths of included pdfs.
% The |pdfprivacy| package provides support for emptying several of these pdf meta-data fields as well as suppressing some pdf\TeX{} meta-data entries in the resulting pdf.
% \end{abstract}
%
% \tableofcontents
%
% \clearpage
%
% \section{Introduction}
%
% By default, pdfs created by pdf\LaTeX{} contain several meta-data fields populated with information about the application used to create them, date/time information, and information about the \LaTeX{} installation.
% The |pdfprivacy| package provides support to remove several of these meta-data fields from the resulting pdf.
% By default |pdfprivacy| prevents the following properties from being set:
% \begin{itemize}[noitemsep]
%	\item The PDF creator (|Creator| in |hyperref|)
%	\item The PDF producer (|Producer| in |hyperref|)
%	\item The PDF modification date (|ModDate| in |hyperref|)
%	\item The PDF creation date (|CreationDate| in |hyperref|)
%	\item The PTEX.Fullbanner in the advanced PDF properties
%	\item The PTEX.FileName with the filenames of any included pdf (e.g., images)
%	\item The PTEX.PageNumber
%	\item The PTEX.InfoDict
% \end{itemize}
% In addition to that, |pdfprivacy| can also remove the document meta-data: |Author|, |Title|, |Subject|, and |Keywords|;
% and the |pdftrailerid| which allows you to create reproducible pdfs.
%
% \section{Requirements and Supported Engines}
%
% |Pdfprivacy| supports three \TeX{} engines: pdf\LaTeX{}, Lua\LaTeX{}, and Xe\LaTeX{}.
% Support differs by engine due to availability of metadata suppression primitives.
% Note that there are caveats when you use certain primitives with certain engines (e.g., |\pdfinfo| appends entries to the dictionary instead of replacing them). 
% See \cref{ssec:withouthyperref} for more details.
%
% \subsection{pdf\LaTeX{} (full support)}
%
% |Pdfprivacy| requires pdf\TeX{} version $1.40.17$ or above\footnote{\url{https://www.tug.org/texlive/Contents/live/texmf-dist/doc/pdftex/NEWS}}
% for full metadata removal and suppression of the pdf\TeX{} banner:
% \begin{quotation}
%	\texttt{PTEX.Fullbanner This is pdfTeX, Version 3.14159265...} 
% \end{quotation}
% All metadata removal options (|nodocdata|, |noproducerdata|, |noeditdata|, |noptexdata|, |nopdftrailerid|)
% are fully supported.
%
% \subsection{Lua\LaTeX{} (full support)}
%
% Lua\LaTeX{} provides the |\pdfvariable suppressoptionalinfo| primitive for comprehensive metadata suppression.
% All metadata removal options (|nodocdata|, |noproducerdata|, |noeditdata|, |noptexdata|, |nopdftrailerid|)
% are fully supported.
%
% \subsection{Xe\LaTeX{} (limited support)}
%
% Xe\LaTeX{} lacks several pdf\TeX{} and Lua\LaTeX{} primitives for metadata suppression.
% The following limitations apply:
% \begin{itemize}[noitemsep]
%	\item |nodocdata| is \emph{supported}: document metadata can be cleared via the |\special{pdf:docinfo}| mechanism.
%	\item |noproducerdata| is \emph{partially supported}: the PDF Creator can be cleared via |\special{pdf:docinfo}|,
%	  but clearing the Producer field is not possible as xdvipdfmx will override it.
%	\item |noeditdata| is \emph{not supported}: these require engine primitives unavailable in Xe\LaTeX{}.
%	  Using this options will raise a warning.
% \item |noptexdata| is \emph{not supported}: Xe\LaTeX{} does not seem to emit PTEX meta-data entries in the resulting pdf, so there is nothing to suppress. 
%	\item |nopdftrailerid| is \emph{partially supported}: instead of omitting the trailer ID,
%	  an all-zero ID |<00000000...00000000>| is inserted. This may affect workflows relying on unique trailer IDs.
% \end{itemize}
%
% \section{Usage}
%
% To use |pdfprivacy|, simple include it:
%
%\begin{quote}
%	|\usepackage|\oarg{options}|{pdfprivacy}|,
%\end{quote}
% 
% Options are passed on to |pdfprivacy| as key-value pairs.
% By default, the options are set as follows:
%
%\begin{quote}
%   |nodocdata=false,|\\
%   |noeditdata=true,|\\
%   |noproducerdata=true,|\\
%   |noptexdata=true,|\\
%   |nopdftrailerid=false|
%\end{quote}
%
% This removes/suppresses all pdf creator, producer, dates, and pdfTeX meta-data.
% Standard document properties such as title, author, subject, and keywords are still kept.
% The |pdftrailerid| is kept as well by default.
%
% \subsection{Options}
% All |pdfprivacy| options are boolean.
% Each option is prefixed with |no| to indicate you want the meta-data removed, you can specify the opposite as well (e.g., both |nodocdata=true| or |docdata=false| are valid options).
% \begin{description}
%	\item[nodocdata=\meta{boolean}] Specify whether document meta-data should be removed from the pdf. Document meta-data includes: 
%		\begin{enumerate*}[label=(\roman*)]
%			\item Title,
%			\item Subject,
%			\item Author, and
%			\item Keywords
%		\end{enumerate*}.
%	\item[noproducerdata=\meta{boolean}] Specify whether meta-data on the pdf-producing application should be removed. This includes:
%		\begin{enumerate*}[label=(\roman*)]
%			\item Creator, and
%			\item Producer
%		\end{enumerate*}.
%	\item[noeditdata=\meta{boolean}] Specify whether meta-data on the edit and creation dates should be removed. This includes:
%		\begin{enumerate*}[label=(\roman*)]
%			\item creation date, and
%			\item modification date
%		\end{enumerate*}.
%	\item[noptexdata=\meta{boolean}] Specify whether the PTEX meta-data entries should be suppressed. This includes:
%		\begin{enumerate*}[label=(\roman*)]
%			\item PTEX.Fullbanner, 
%			\item PTEX.FileName,
%			\item PTEX.PageNumber, and
%			\item PTEX.InfoDict
%		\end{enumerate*}.
%	\item[nopdftrailerid=\meta{boolean}] Specify whether the pdfrailerid should be omitted.
% \item[strict=\meta{boolean}] Specify strict mode.
% In this mode, unsupported options will raise package errors instead of warnings, and the package will fail to load if the engine does not support the required primitives for the selected options.
% \end{description}
%
% \subsection{Using pdfprivacy without hyperref}\label{ssec:withouthyperref}
%
% When using |pdfprivacy| without |hyperref|, the |\pdfinfo| command is used to set the pdf meta-data properties (i.e., |Title|, |Subject|, |Keywords|, |Author|, |Creator|, and |Producer|).
% The |\pdfinfo| works by appending the provided properties to the pdf info dictionary.
% This means that any previously set properties will still be present in the resulting pdf, despite pdf viewers only showing the last one.
% To make sure these properties are not present, \emph{do not} manually set any of these properties, or use |hyperref| to set them.
% |Hyperref| will only save the last property (i.e., the empty one set by |pdfprivacy|) to the pdf.
% To make absolutely sure that no meta-data is present in the resulting pdf, you can always manually check the pdf by opening it as a text file.\footnote{Note: privacy-sensitive content may be present in the pdf in an encoded form. When manually verifying, make sure to look for the pdf property (e.g., |/Author (|\meta{content}|)| as well to verify it is empty.}
%
% \subsection{Removing the pdftrailerid}
%
% The pdf trailer ID is a generated ID to uniquely identify a pdf.
% The generated ID is based on the time of creation. 
% This ID can be removed to make reproducible pdfs, i.e., with the same cryptographic hash.
%
% \textbf{Important:} The pdf trailer id is kept by default because it is optional but strongly recommended by the pdf standard.\footnote{\url{https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf\#G8.1639448}}
% Not including this entry could break some workflows that rely on the trailer ID to uniquely identify files.
% If this is not a concern, the |nopdftrailerid=true| option can be used to remove it as well.
%
% \StopEventually{%
%\clearpage%
%\PrintChanges}
%
% \clearpage
% \section{Implementation}
% 
% \subsection{Loading packages}
%
% Load |ifthen| for ifthenelse and booleans for managing user preferences.
%    \begin{macrocode}
\RequirePackage{ifthen}
%    \end{macrocode}
% Load |kvoptions| for laoding key-value options.
%    \begin{macrocode}
\RequirePackage{kvoptions}
%    \end{macrocode}
% Load |iftex| to detect the TeX engine and provide clearer diagnostics.
%    \begin{macrocode}
\RequirePackage{iftex}
%    \end{macrocode}
%
% \subsection{Storage for options and settings}
% Some booleans for keeping track if hyperref is loaded and if all meta-data should be removed.
%    \begin{macrocode}
\newboolean{pdfprivacy@hyperrefloaded}
\newboolean{pdfprivacy@removeall}
\setboolean{pdfprivacy@removeall}{false}
\newcommand{\pdfprivacy@enginename}{unknown engine}
\ifPDFTeX\renewcommand{\pdfprivacy@enginename}{pdfTeX}\fi
\ifXeTeX\renewcommand{\pdfprivacy@enginename}{XeTeX}\fi
\ifLuaTeX\renewcommand{\pdfprivacy@enginename}{LuaTeX}\fi
\newcommand{\pdfprivacy@unsupportedoptionerror}[2]{%
\ifthenelse{\boolean{pdfprivacy@strict}}{%
\PackageError{pdfprivacy}{Option '#1' is not supported with #2}{%
This option requires engine-specific PDF primitives that are unavailable.%
\MessageBreak Disable the option, use another engine, or use the default metadata behavior.%
}}{%
\PackageWarning{pdfprivacy}{Option '#1' is not supported with #2.
This option requires engine-specific PDF primitives that are unavailable.
Disable the option, use another engine, or use the default metadata behavior.
}}}
\newcommand{\pdfprivacy@warningorstrictfail}[2][]{%
\ifthenelse{\boolean{pdfprivacy@strict}}{%
\PackageError{pdfprivacy}{#2}{#1}}{%
\PackageWarning{pdfprivacy}{#2}}}
%    \end{macrocode}
%
% \subsection{Declaring package options}
% Declare all the package options and their complementary ones.
%    \begin{macrocode}
\DeclareBoolOption[false]{nodocdata}
\DeclareComplementaryOption{docdata}{nodocdata}
\DeclareBoolOption[true]{noproducerdata}
\DeclareComplementaryOption{producerdata}{noproducerdata}
\DeclareBoolOption[true]{noeditdata}
\DeclareComplementaryOption{editdata}{noeditdata}
\DeclareBoolOption[true]{noptexdata}
\DeclareComplementaryOption{ptexdata}{noptexdata}
\DeclareBoolOption[false]{nopdftrailerid}
\DeclareComplementaryOption{pdftrailerid}{nopdftrailerid}
\DeclareBoolOption[false]{strict}
%    \end{macrocode}
% Additional |all| option to just remove everything.
%    \begin{macrocode}
\DeclareVoidOption{all}{\setboolean{pdfprivacy@removeall}{true}}
%    \end{macrocode}
%
% Process the options.
%    \begin{macrocode}
\ProcessKeyvalOptions*
%    \end{macrocode}
%
% \subsection{Process the user preferences}
%
% Check if we need to remove |all| and override the other preferences.
%    \begin{macrocode}
\ifthenelse{\boolean{pdfprivacy@removeall}}{%
\setboolean{pdfprivacy@nodocdata}{true}
\setboolean{pdfprivacy@noproducerdata}{true}
\setboolean{pdfprivacy@noeditdata}{true}
\setboolean{pdfprivacy@noptexdata}{true}
\setboolean{pdfprivacy@nopdftrailerid}{true}
}{%
}
%    \end{macrocode}
%
% Check if hyperref is loaded as some meta-data needs to be set using hyperref.
%    \begin{macrocode}
\AtBeginDocument{
\@ifpackageloaded{hyperref}{\setboolean{pdfprivacy@hyperrefloaded}{true}}{\setboolean{pdfprivacy@hyperrefloaded}{false}}
}
%    \end{macrocode}
%
%
% \subsection{Remove or suppress all the necessary meta-data}
%
% Process all preferences grouped by TeX engine.
% The implementation first dispatches on engine, then handles all option
% processing within the selected engine branch.
%    \begin{macrocode}
\AtBeginDocument{
%    \end{macrocode}
% \subsubsection{Processing pdftex}
% In the pdftex branch, do removal and suppression with the pdftex primitives.
%    \begin{macrocode}
\ifpdftex
%    \end{macrocode}
%
% Process the document meta-data.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
    \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
      \hypersetup{pdfinfo={ Author={}, Subject={}, Title={}, Keywords={} }}%
    }{%
      \pdfinfo{/Author () /Title () /Subject () /Keywords () }%
    }
  }{}
%    \end{macrocode}
%
% Process the producer meta-data.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
    \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
      \hypersetup{pdfinfo={ Creator={}, Producer={} }}%
    }{%
      \pdfinfo{/Creator () /Producer ()}%
    }
  }{}
%    \end{macrocode}
%
% Process the edit dates meta-data.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@noeditdata}}{%
    \pdfinfoomitdate1
  }{}
%    \end{macrocode}
%
% Process the ptex meta-data.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@noptexdata}}{%
    \pdfsuppressptexinfo-1
  }{}
%    \end{macrocode}
%
% Process the trailerid.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{%
    \pdftrailerid{}
  }{}

%    \end{macrocode}
% \subsubsection{Processing xetex}
% In the xetex branch, unsupported options produce package errors,
% while any primitive-backed behavior is retained if available.
%    \begin{macrocode}
\else\ifxetex
%    \end{macrocode}
%
% Process the document meta-data.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
    \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
      \hypersetup{pdfinfo={ Author={}, Subject={}, Title={}, Keywords={} }}%
    }{%
      \special{pdf:docinfo << /Title () /Author () /Subject () /Keywords () >>}%
    }
  }{}
%    \end{macrocode}
%
% Process the producer meta-data.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
    \pdfprivacy@warningorstrictfail[]{Clearing the PDF producer not supported with XeTeX. Only the PDF creator property will be cleared.}
    \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
      \hypersetup{pdfinfo={ Creator={}, Producer={} }}%
    }{%
      \special{pdf:docinfo << /Creator () /Producer () >>}%
    }
  }{}
  \ifthenelse{\boolean{pdfprivacy@noeditdata}}{%
    \pdfprivacy@unsupportedoptionerror{noeditdata}{XeTeX}
  }{}
  \ifthenelse{\boolean{pdfprivacy@noptexdata}}{%
    \PackageInfo{pdfprivacy}{Option 'noptexdata' is not supported with XeTeX. XeTeX does not seem to emit PTEX meta-data entries in the resulting pdf.}
  }{}
  \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{%
    \pdfprivacy@warningorstrictfail[]{No trailerid is not supported for XeTeX. Instead, an all 0 trailerid will be inserted into the pdf.
This might break some pdf workflows that rely on the trailerid.%
}
    \special{pdf:trailerid [
    <00000000000000000000000000000000>
    <00000000000000000000000000000000>
]}
  }{}
\else\ifluatex
%    \end{macrocode}
% \subsubsection{Processing luatex}
% In the Lua\TeX{} branch, all metadata suppression is handled via
% |\pdfvariable suppressoptionalinfo| with a bitmask computed from the
% active options. Document metadata (nodocdata) is cleared separately
% via |hyperref| or |\pdfinfo| since those fields are not covered by
% |\pdfvariable suppressoptionalinfo|.
%
% Process the document meta-data.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
    \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
      \hypersetup{pdfinfo={ Author={}, Subject={}, Title={}, Keywords={} }}%
    }{%
      \pdfextension info { /Title () /Author () /Subject () /Keywords () }
    }
  }{}
%    \end{macrocode}
%
% Compute the |\pdfvariable suppressoptionalinfo| bitmask from the active
% options and apply it. The bit values are:
% \begin{itemize}[noitemsep]
%   \item $1{+}2{+}4{+}8 = 15$: \texttt{PTEX.FullBanner}, \texttt{PTEX.FileName},
%     \texttt{PTEX.PageNumber}, \texttt{PTEX.InfoDict} (|noptexdata|)
%   \item $16{+}128 = 144$: \texttt{Creator}, \texttt{Producer} (|noproducerdata|)
%   \item $32{+}64 = 96$: \texttt{CreationDate}, \texttt{ModDate} (|noeditdata|)
%   \item $512$: \texttt{ID} (|nopdftrailerid|)
% \end{itemize}
% When hyperref is loaded, Creator and Producer are also cleared via
% |\hypersetup| since hyperref writes those fields independently of the engine.
%    \begin{macrocode}
  \newcount\pdfprivacy@suppressbits
  \pdfprivacy@suppressbits=0
  \ifthenelse{\boolean{pdfprivacy@noptexdata}}{\advance\pdfprivacy@suppressbits by 15}{}%
  \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{\advance\pdfprivacy@suppressbits by 144}{}%
  \ifthenelse{\boolean{pdfprivacy@noeditdata}}{\advance\pdfprivacy@suppressbits by 96}{}%
  \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{\advance\pdfprivacy@suppressbits by 512}{}%
  \pdfvariable suppressoptionalinfo\pdfprivacy@suppressbits
  \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
    \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
      \hypersetup{pdfinfo={ Creator={}, Producer={} }}%
    }{}%
  }{}
\else
%    \end{macrocode}
%
% As a fallback for unknown engines, enabled options are reported as
% unsupported using the generic engine name for diagnostics.
%    \begin{macrocode}
  \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
    \pdfprivacy@unsupportedoptionerror{nodocdata}{\pdfprivacy@enginename}
  }{}
  \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
    \pdfprivacy@unsupportedoptionerror{noproducerdata}{\pdfprivacy@enginename}
  }{}
  \ifthenelse{\boolean{pdfprivacy@noeditdata}}{%
    \pdfprivacy@unsupportedoptionerror{noeditdata}{\pdfprivacy@enginename}
  }{}
  \ifthenelse{\boolean{pdfprivacy@noptexdata}}{%
    \pdfprivacy@unsupportedoptionerror{noptexdata}{\pdfprivacy@enginename}
  }{}
  \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{%
    \pdfprivacy@unsupportedoptionerror{nopdftrailerid}{\pdfprivacy@enginename}
  }{}
\fi\fi\fi
}
%    \end{macrocode}
%
%
%
% \Finale
\endinput