Skip to content

Commit 2e68001

Browse files
committed
set the pdfa key automatically if an A-standard is
set in \DocumentMetadata. issue #387
1 parent 294223e commit 2e68001

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

ChangeLog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-06-17 Ulrike Fischer
2+
* hyperref.dtx: set the pdfa key automatically if an A-standard is
3+
set in \DocumentMetadata. issue #387
4+
15
2025-06-01 Ulrike Fischer
26
* hyperref.dtx: change hyperindexformat to hyperxindexformat, issue #386
37

hyperref.dtx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6502,9 +6502,18 @@
65026502
\define@key{Hyp}{pdfdisplaydoctitle}[true]{%
65036503
\Hy@boolkey{pdfdisplaydoctitle}{#1}%
65046504
}
6505-
\define@key{Hyp}{pdfa}[true]{%
6506-
\Hy@boolkey{pdfa}{#1}%
6505+
\define@key{Hyp}{pdfa}[true]{%
6506+
\IfDocumentMetadataTF
6507+
{
6508+
\PackageWarning{hyperref}{%
6509+
\string\DocumentMetadata\space detected.\MessageBreak
6510+
The 'pdfa' key will be ignored.\MessageBreak
6511+
Please set the PDF/A standard in \string\DocumentMetadata\MessageBreak
6512+
with the 'pdfstandard' key.}
6513+
}
6514+
{\Hy@boolkey{pdfa}{#1}}%
65076515
}
6516+
65086517
\define@key{Hyp}{pdfnewwindow}[true]{%
65096518
\def\Hy@temp{#1}%
65106519
\ifx\Hy@temp\@empty
@@ -6833,8 +6842,21 @@
68336842
% \end{macrocode}
68346843
%
68356844
% \subsection{PDF/A}
6836-
%
6845+
% If an A-standard has been set in \cs{DocumentMetadata} hyperref should set the pdfa
6846+
% key too.
68376847
% \begin{macrocode}
6848+
\ExplSyntaxOn
6849+
\IfDocumentMetadataT
6850+
{
6851+
\tl_if_empty:eTF{\GetDocumentProperties{document/pdfstandard}}
6852+
{
6853+
\Hy@pdfafalse
6854+
}
6855+
{
6856+
\Hy@pdfatrue
6857+
}
6858+
}
6859+
\ExplSyntaxOff
68386860
\Hy@DisableOption{pdfa}
68396861
% \end{macrocode}
68406862
%

0 commit comments

Comments
 (0)