Debian Codegraph @

texmf-dist/source/latex/pdfprivacy/pdfprivacy.dtx

raw
1 % \iffalse meta-comment
2 % File: pdfprivacy.dtx
3 % Copyright (C) 2017 Laurens Sion
4 % ---------------------------------------------------------------------
5 %
6 % This work may be distributed and/or modified under the conditions of
7 % the LaTeX Project Public License, either version 1.3c of this license
8 % or (at your option) any later version. The latest version of this
9 % license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 % This work consists of the files pdfprivacy.dtx and pdfprivacy.ins
14 % and the derived file pdfprivacy.sty.
15 %
16 % \fi
17 %
18 % \iffalse
19 %<*driver>
20 \ProvidesFile{pdfprivacy.dtx}
21 %</driver>
22 %<package>\NeedsTeXFormat{LaTeX2e}[2013/03/31]
23 %<package>\ProvidesPackage{pdfprivacy}
24 %<*driver|package>
25 [2026/05/24 v1.1 PDF Privacy package]
26 %</driver|package>
27 %
28 %<*driver>
29 \documentclass[a4paper]{ltxdoc}
30 % make sure version 1.10 is behind 1.9, not 1.1
31 \makeatletter
32 \@ifdefinable{\org@changes@}{%
33 \let\org@changes@\changes@
34 \@ifdefinable{\my@changes}{%
35 \def\my@changes v#1.#2\@nil{%
36 \org@changes@{v#1.\six@digits{#2}=v#1.#2}%
37 }%
38 \newcommand*{\six@digits}[1]{%
39 \ifnum#1<100000 0\fi
40 \ifnum#1<10000 0\fi
41 \ifnum#1<1000 0\fi
42 \ifnum#1<100 0\fi
43 \two@digits{#1}%
44 }%
45 \renewcommand*{\changes@}[1]{%
46 \my@changes#1\@nil
47 }%
48 }%
49 }
50 \makeatother
51 \usepackage[inline]{enumitem}
52 \usepackage[all]{pdfprivacy}
53 \usepackage{parskip}
54 \usepackage[hidelinks]{hyperref}
55 \usepackage{cleveref}
56 \EnableCrossrefs
57 \CodelineIndex
58 %\PageIndex
59 \RecordChanges
60 %\OnlyDescription
61 \begin{document}
62 \DocInput{pdfprivacy.dtx}
63 \end{document}
64 %</driver>
65 % \fi
66 %
67 % \CheckSum{164}
68 %
69 % \CharacterTable
70 % {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
71 % 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
72 % Digits \0\1\2\3\4\5\6\7\8\9
73 % Exclamation \! Double quote \" Hash (number) \#
74 % Dollar \$ Percent \% Ampersand \&
75 % Acute accent \' Left paren \( Right paren \)
76 % Asterisk \* Plus \+ Comma \,
77 % Minus \- Point \. Solidus \/
78 % Colon \: Semicolon \; Less than \<
79 % Equals \= Greater than \> Question mark \?
80 % Commercial at \@ Left bracket \[ Backslash \\
81 % Right bracket \] Circumflex \^ Underscore \_
82 % Grave accent \` Left brace \{ Vertical bar \|
83 % Right brace \} Tilde \~}
84 %
85 %
86 % \changes{v1.0}{2017/12/03}{Initial version}
87 % \changes{v1.1}{2023/05/24}{Support for XeLaTex and LuaLaTex. Added strict mode.}
88 %
89 % \GetFileInfo{pdfprivacy.dtx}
90 %
91 % \DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
92 % \DoNotIndex{\@badmath,\@centercr,\@cite}
93 % \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
94 % \DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
95 % \DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint}
96 % \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
97 % \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
98 % \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
99 % \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
100 % \DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
101 % \DoNotIndex{\bullet}
102 % \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
103 % \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentpackage}
104 % \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
105 % \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
106 % \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
107 % \DoNotIndex{\fbox}
108 % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
109 % \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
110 % \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
111 % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
112 % \DoNotIndex{\input}
113 % \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
114 % \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
115 % \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
116 % \DoNotIndex{\NeedsTeXFormat,\newdimen}
117 % \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
118 % \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
119 % \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
120 % \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
121 % \DoNotIndex{\protect,\Providespackage,\raggedbottom,\raggedright}
122 % \DoNotIndex{\refstepcounter,\relax,\renewcommand}
123 % \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily}
124 % \DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength}
125 % \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
126 % \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
127 % \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
128 % \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
129 % \DoNotIndex{\wd,\xiipt,\year,\z@}
130 %
131 %
132 % \title{The \textsf{pdfprivacy} package\thanks{This document
133 % corresponds to \textsf{pdfprivacy}~\fileversion, dated \filedate.}}
134 % \author{Laurens Sion \\ \texttt{[email protected]}}
135 %
136 % \maketitle
137 %
138 % \begin{abstract}
139 % \noindent
140 % 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.
141 % 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.
142 % \end{abstract}
143 %
144 % \tableofcontents
145 %
146 % \clearpage
147 %
148 % \section{Introduction}
149 %
150 % 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.
151 % The |pdfprivacy| package provides support to remove several of these meta-data fields from the resulting pdf.
152 % By default |pdfprivacy| prevents the following properties from being set:
153 % \begin{itemize}[noitemsep]
154 % \item The PDF creator (|Creator| in |hyperref|)
155 % \item The PDF producer (|Producer| in |hyperref|)
156 % \item The PDF modification date (|ModDate| in |hyperref|)
157 % \item The PDF creation date (|CreationDate| in |hyperref|)
158 % \item The PTEX.Fullbanner in the advanced PDF properties
159 % \item The PTEX.FileName with the filenames of any included pdf (e.g., images)
160 % \item The PTEX.PageNumber
161 % \item The PTEX.InfoDict
162 % \end{itemize}
163 % In addition to that, |pdfprivacy| can also remove the document meta-data: |Author|, |Title|, |Subject|, and |Keywords|;
164 % and the |pdftrailerid| which allows you to create reproducible pdfs.
165 %
166 % \section{Requirements and Supported Engines}
167 %
168 % |Pdfprivacy| supports three \TeX{} engines: pdf\LaTeX{}, Lua\LaTeX{}, and Xe\LaTeX{}.
169 % Support differs by engine due to availability of metadata suppression primitives.
170 % 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).
171 % See \cref{ssec:withouthyperref} for more details.
172 %
173 % \subsection{pdf\LaTeX{} (full support)}
174 %
175 % |Pdfprivacy| requires pdf\TeX{} version $1.40.17$ or above\footnote{\url{https://www.tug.org/texlive/Contents/live/texmf-dist/doc/pdftex/NEWS}}
176 % for full metadata removal and suppression of the pdf\TeX{} banner:
177 % \begin{quotation}
178 % \texttt{PTEX.Fullbanner This is pdfTeX, Version 3.14159265...}
179 % \end{quotation}
180 % All metadata removal options (|nodocdata|, |noproducerdata|, |noeditdata|, |noptexdata|, |nopdftrailerid|)
181 % are fully supported.
182 %
183 % \subsection{Lua\LaTeX{} (full support)}
184 %
185 % Lua\LaTeX{} provides the |\pdfvariable suppressoptionalinfo| primitive for comprehensive metadata suppression.
186 % All metadata removal options (|nodocdata|, |noproducerdata|, |noeditdata|, |noptexdata|, |nopdftrailerid|)
187 % are fully supported.
188 %
189 % \subsection{Xe\LaTeX{} (limited support)}
190 %
191 % Xe\LaTeX{} lacks several pdf\TeX{} and Lua\LaTeX{} primitives for metadata suppression.
192 % The following limitations apply:
193 % \begin{itemize}[noitemsep]
194 % \item |nodocdata| is \emph{supported}: document metadata can be cleared via the |\special{pdf:docinfo}| mechanism.
195 % \item |noproducerdata| is \emph{partially supported}: the PDF Creator can be cleared via |\special{pdf:docinfo}|,
196 % but clearing the Producer field is not possible as xdvipdfmx will override it.
197 % \item |noeditdata| is \emph{not supported}: these require engine primitives unavailable in Xe\LaTeX{}.
198 % Using this options will raise a warning.
199 % \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.
200 % \item |nopdftrailerid| is \emph{partially supported}: instead of omitting the trailer ID,
201 % an all-zero ID |<00000000...00000000>| is inserted. This may affect workflows relying on unique trailer IDs.
202 % \end{itemize}
203 %
204 % \section{Usage}
205 %
206 % To use |pdfprivacy|, simple include it:
207 %
208 %\begin{quote}
209 % |\usepackage|\oarg{options}|{pdfprivacy}|,
210 %\end{quote}
211 %
212 % Options are passed on to |pdfprivacy| as key-value pairs.
213 % By default, the options are set as follows:
214 %
215 %\begin{quote}
216 % |nodocdata=false,|\\
217 % |noeditdata=true,|\\
218 % |noproducerdata=true,|\\
219 % |noptexdata=true,|\\
220 % |nopdftrailerid=false|
221 %\end{quote}
222 %
223 % This removes/suppresses all pdf creator, producer, dates, and pdfTeX meta-data.
224 % Standard document properties such as title, author, subject, and keywords are still kept.
225 % The |pdftrailerid| is kept as well by default.
226 %
227 % \subsection{Options}
228 % All |pdfprivacy| options are boolean.
229 % 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).
230 % \begin{description}
231 % \item[nodocdata=\meta{boolean}] Specify whether document meta-data should be removed from the pdf. Document meta-data includes:
232 % \begin{enumerate*}[label=(\roman*)]
233 % \item Title,
234 % \item Subject,
235 % \item Author, and
236 % \item Keywords
237 % \end{enumerate*}.
238 % \item[noproducerdata=\meta{boolean}] Specify whether meta-data on the pdf-producing application should be removed. This includes:
239 % \begin{enumerate*}[label=(\roman*)]
240 % \item Creator, and
241 % \item Producer
242 % \end{enumerate*}.
243 % \item[noeditdata=\meta{boolean}] Specify whether meta-data on the edit and creation dates should be removed. This includes:
244 % \begin{enumerate*}[label=(\roman*)]
245 % \item creation date, and
246 % \item modification date
247 % \end{enumerate*}.
248 % \item[noptexdata=\meta{boolean}] Specify whether the PTEX meta-data entries should be suppressed. This includes:
249 % \begin{enumerate*}[label=(\roman*)]
250 % \item PTEX.Fullbanner,
251 % \item PTEX.FileName,
252 % \item PTEX.PageNumber, and
253 % \item PTEX.InfoDict
254 % \end{enumerate*}.
255 % \item[nopdftrailerid=\meta{boolean}] Specify whether the pdfrailerid should be omitted.
256 % \item[strict=\meta{boolean}] Specify strict mode.
257 % 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.
258 % \end{description}
259 %
260 % \subsection{Using pdfprivacy without hyperref}\label{ssec:withouthyperref}
261 %
262 % 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|).
263 % The |\pdfinfo| works by appending the provided properties to the pdf info dictionary.
264 % This means that any previously set properties will still be present in the resulting pdf, despite pdf viewers only showing the last one.
265 % To make sure these properties are not present, \emph{do not} manually set any of these properties, or use |hyperref| to set them.
266 % |Hyperref| will only save the last property (i.e., the empty one set by |pdfprivacy|) to the pdf.
267 % 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.}
268 %
269 % \subsection{Removing the pdftrailerid}
270 %
271 % The pdf trailer ID is a generated ID to uniquely identify a pdf.
272 % The generated ID is based on the time of creation.
273 % This ID can be removed to make reproducible pdfs, i.e., with the same cryptographic hash.
274 %
275 % \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}}
276 % Not including this entry could break some workflows that rely on the trailer ID to uniquely identify files.
277 % If this is not a concern, the |nopdftrailerid=true| option can be used to remove it as well.
278 %
279 % \StopEventually{%
280 %\clearpage%
281 %\PrintChanges}
282 %
283 % \clearpage
284 % \section{Implementation}
285 %
286 % \subsection{Loading packages}
287 %
288 % Load |ifthen| for ifthenelse and booleans for managing user preferences.
289 % \begin{macrocode}
290 \RequirePackage{ifthen}
291 % \end{macrocode}
292 % Load |kvoptions| for laoding key-value options.
293 % \begin{macrocode}
294 \RequirePackage{kvoptions}
295 % \end{macrocode}
296 % Load |iftex| to detect the TeX engine and provide clearer diagnostics.
297 % \begin{macrocode}
298 \RequirePackage{iftex}
299 % \end{macrocode}
300 %
301 % \subsection{Storage for options and settings}
302 % Some booleans for keeping track if hyperref is loaded and if all meta-data should be removed.
303 % \begin{macrocode}
304 \newboolean{pdfprivacy@hyperrefloaded}
305 \newboolean{pdfprivacy@removeall}
306 \setboolean{pdfprivacy@removeall}{false}
307 \newcommand{\pdfprivacy@enginename}{unknown engine}
308 \ifPDFTeX\renewcommand{\pdfprivacy@enginename}{pdfTeX}\fi
309 \ifXeTeX\renewcommand{\pdfprivacy@enginename}{XeTeX}\fi
310 \ifLuaTeX\renewcommand{\pdfprivacy@enginename}{LuaTeX}\fi
311 \newcommand{\pdfprivacy@unsupportedoptionerror}[2]{%
312 \ifthenelse{\boolean{pdfprivacy@strict}}{%
313 \PackageError{pdfprivacy}{Option '#1' is not supported with #2}{%
314 This option requires engine-specific PDF primitives that are unavailable.%
315 \MessageBreak Disable the option, use another engine, or use the default metadata behavior.%
316 }}{%
317 \PackageWarning{pdfprivacy}{Option '#1' is not supported with #2.
318 This option requires engine-specific PDF primitives that are unavailable.
319 Disable the option, use another engine, or use the default metadata behavior.
320 }}}
321 \newcommand{\pdfprivacy@warningorstrictfail}[2][]{%
322 \ifthenelse{\boolean{pdfprivacy@strict}}{%
323 \PackageError{pdfprivacy}{#2}{#1}}{%
324 \PackageWarning{pdfprivacy}{#2}}}
325 % \end{macrocode}
326 %
327 % \subsection{Declaring package options}
328 % Declare all the package options and their complementary ones.
329 % \begin{macrocode}
330 \DeclareBoolOption[false]{nodocdata}
331 \DeclareComplementaryOption{docdata}{nodocdata}
332 \DeclareBoolOption[true]{noproducerdata}
333 \DeclareComplementaryOption{producerdata}{noproducerdata}
334 \DeclareBoolOption[true]{noeditdata}
335 \DeclareComplementaryOption{editdata}{noeditdata}
336 \DeclareBoolOption[true]{noptexdata}
337 \DeclareComplementaryOption{ptexdata}{noptexdata}
338 \DeclareBoolOption[false]{nopdftrailerid}
339 \DeclareComplementaryOption{pdftrailerid}{nopdftrailerid}
340 \DeclareBoolOption[false]{strict}
341 % \end{macrocode}
342 % Additional |all| option to just remove everything.
343 % \begin{macrocode}
344 \DeclareVoidOption{all}{\setboolean{pdfprivacy@removeall}{true}}
345 % \end{macrocode}
346 %
347 % Process the options.
348 % \begin{macrocode}
349 \ProcessKeyvalOptions*
350 % \end{macrocode}
351 %
352 % \subsection{Process the user preferences}
353 %
354 % Check if we need to remove |all| and override the other preferences.
355 % \begin{macrocode}
356 \ifthenelse{\boolean{pdfprivacy@removeall}}{%
357 \setboolean{pdfprivacy@nodocdata}{true}
358 \setboolean{pdfprivacy@noproducerdata}{true}
359 \setboolean{pdfprivacy@noeditdata}{true}
360 \setboolean{pdfprivacy@noptexdata}{true}
361 \setboolean{pdfprivacy@nopdftrailerid}{true}
362 }{%
363 }
364 % \end{macrocode}
365 %
366 % Check if hyperref is loaded as some meta-data needs to be set using hyperref.
367 % \begin{macrocode}
368 \AtBeginDocument{
369 \@ifpackageloaded{hyperref}{\setboolean{pdfprivacy@hyperrefloaded}{true}}{\setboolean{pdfprivacy@hyperrefloaded}{false}}
370 }
371 % \end{macrocode}
372 %
373 %
374 % \subsection{Remove or suppress all the necessary meta-data}
375 %
376 % Process all preferences grouped by TeX engine.
377 % The implementation first dispatches on engine, then handles all option
378 % processing within the selected engine branch.
379 % \begin{macrocode}
380 \AtBeginDocument{
381 % \end{macrocode}
382 % \subsubsection{Processing pdftex}
383 % In the pdftex branch, do removal and suppression with the pdftex primitives.
384 % \begin{macrocode}
385 \ifpdftex
386 % \end{macrocode}
387 %
388 % Process the document meta-data.
389 % \begin{macrocode}
390 \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
391 \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
392 \hypersetup{pdfinfo={ Author={}, Subject={}, Title={}, Keywords={} }}%
393 }{%
394 \pdfinfo{/Author () /Title () /Subject () /Keywords () }%
395 }
396 }{}
397 % \end{macrocode}
398 %
399 % Process the producer meta-data.
400 % \begin{macrocode}
401 \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
402 \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
403 \hypersetup{pdfinfo={ Creator={}, Producer={} }}%
404 }{%
405 \pdfinfo{/Creator () /Producer ()}%
406 }
407 }{}
408 % \end{macrocode}
409 %
410 % Process the edit dates meta-data.
411 % \begin{macrocode}
412 \ifthenelse{\boolean{pdfprivacy@noeditdata}}{%
413 \pdfinfoomitdate1
414 }{}
415 % \end{macrocode}
416 %
417 % Process the ptex meta-data.
418 % \begin{macrocode}
419 \ifthenelse{\boolean{pdfprivacy@noptexdata}}{%
420 \pdfsuppressptexinfo-1
421 }{}
422 % \end{macrocode}
423 %
424 % Process the trailerid.
425 % \begin{macrocode}
426 \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{%
427 \pdftrailerid{}
428 }{}
429
430 % \end{macrocode}
431 % \subsubsection{Processing xetex}
432 % In the xetex branch, unsupported options produce package errors,
433 % while any primitive-backed behavior is retained if available.
434 % \begin{macrocode}
435 \else\ifxetex
436 % \end{macrocode}
437 %
438 % Process the document meta-data.
439 % \begin{macrocode}
440 \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
441 \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
442 \hypersetup{pdfinfo={ Author={}, Subject={}, Title={}, Keywords={} }}%
443 }{%
444 \special{pdf:docinfo << /Title () /Author () /Subject () /Keywords () >>}%
445 }
446 }{}
447 % \end{macrocode}
448 %
449 % Process the producer meta-data.
450 % \begin{macrocode}
451 \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
452 \pdfprivacy@warningorstrictfail[]{Clearing the PDF producer not supported with XeTeX. Only the PDF creator property will be cleared.}
453 \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
454 \hypersetup{pdfinfo={ Creator={}, Producer={} }}%
455 }{%
456 \special{pdf:docinfo << /Creator () /Producer () >>}%
457 }
458 }{}
459 \ifthenelse{\boolean{pdfprivacy@noeditdata}}{%
460 \pdfprivacy@unsupportedoptionerror{noeditdata}{XeTeX}
461 }{}
462 \ifthenelse{\boolean{pdfprivacy@noptexdata}}{%
463 \PackageInfo{pdfprivacy}{Option 'noptexdata' is not supported with XeTeX. XeTeX does not seem to emit PTEX meta-data entries in the resulting pdf.}
464 }{}
465 \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{%
466 \pdfprivacy@warningorstrictfail[]{No trailerid is not supported for XeTeX. Instead, an all 0 trailerid will be inserted into the pdf.
467 This might break some pdf workflows that rely on the trailerid.%
468 }
469 \special{pdf:trailerid [
470 <00000000000000000000000000000000>
471 <00000000000000000000000000000000>
472 ]}
473 }{}
474 \else\ifluatex
475 % \end{macrocode}
476 % \subsubsection{Processing luatex}
477 % In the Lua\TeX{} branch, all metadata suppression is handled via
478 % |\pdfvariable suppressoptionalinfo| with a bitmask computed from the
479 % active options. Document metadata (nodocdata) is cleared separately
480 % via |hyperref| or |\pdfinfo| since those fields are not covered by
481 % |\pdfvariable suppressoptionalinfo|.
482 %
483 % Process the document meta-data.
484 % \begin{macrocode}
485 \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
486 \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
487 \hypersetup{pdfinfo={ Author={}, Subject={}, Title={}, Keywords={} }}%
488 }{%
489 \pdfextension info { /Title () /Author () /Subject () /Keywords () }
490 }
491 }{}
492 % \end{macrocode}
493 %
494 % Compute the |\pdfvariable suppressoptionalinfo| bitmask from the active
495 % options and apply it. The bit values are:
496 % \begin{itemize}[noitemsep]
497 % \item $1{+}2{+}4{+}8 = 15$: \texttt{PTEX.FullBanner}, \texttt{PTEX.FileName},
498 % \texttt{PTEX.PageNumber}, \texttt{PTEX.InfoDict} (|noptexdata|)
499 % \item $16{+}128 = 144$: \texttt{Creator}, \texttt{Producer} (|noproducerdata|)
500 % \item $32{+}64 = 96$: \texttt{CreationDate}, \texttt{ModDate} (|noeditdata|)
501 % \item $512$: \texttt{ID} (|nopdftrailerid|)
502 % \end{itemize}
503 % When hyperref is loaded, Creator and Producer are also cleared via
504 % |\hypersetup| since hyperref writes those fields independently of the engine.
505 % \begin{macrocode}
506 \newcount\pdfprivacy@suppressbits
507 \pdfprivacy@suppressbits=0
508 \ifthenelse{\boolean{pdfprivacy@noptexdata}}{\advance\pdfprivacy@suppressbits by 15}{}%
509 \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{\advance\pdfprivacy@suppressbits by 144}{}%
510 \ifthenelse{\boolean{pdfprivacy@noeditdata}}{\advance\pdfprivacy@suppressbits by 96}{}%
511 \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{\advance\pdfprivacy@suppressbits by 512}{}%
512 \pdfvariable suppressoptionalinfo\pdfprivacy@suppressbits
513 \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
514 \ifthenelse{\boolean{pdfprivacy@hyperrefloaded}}{%
515 \hypersetup{pdfinfo={ Creator={}, Producer={} }}%
516 }{}%
517 }{}
518 \else
519 % \end{macrocode}
520 %
521 % As a fallback for unknown engines, enabled options are reported as
522 % unsupported using the generic engine name for diagnostics.
523 % \begin{macrocode}
524 \ifthenelse{\boolean{pdfprivacy@nodocdata}}{%
525 \pdfprivacy@unsupportedoptionerror{nodocdata}{\pdfprivacy@enginename}
526 }{}
527 \ifthenelse{\boolean{pdfprivacy@noproducerdata}}{%
528 \pdfprivacy@unsupportedoptionerror{noproducerdata}{\pdfprivacy@enginename}
529 }{}
530 \ifthenelse{\boolean{pdfprivacy@noeditdata}}{%
531 \pdfprivacy@unsupportedoptionerror{noeditdata}{\pdfprivacy@enginename}
532 }{}
533 \ifthenelse{\boolean{pdfprivacy@noptexdata}}{%
534 \pdfprivacy@unsupportedoptionerror{noptexdata}{\pdfprivacy@enginename}
535 }{}
536 \ifthenelse{\boolean{pdfprivacy@nopdftrailerid}}{%
537 \pdfprivacy@unsupportedoptionerror{nopdftrailerid}{\pdfprivacy@enginename}
538 }{}
539 \fi\fi\fi
540 }
541 % \end{macrocode}
542 %
543 %
544 %
545 % \Finale
546 \endinput