Skip to content
Snippets Groups Projects

Add rudimentary PDF/A-2b support

Merged Jan-Åke Larsson requested to merge janla64/liuthesis:pdfa into master
All threads resolved!
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
+ 62
3
@@ -118,6 +118,7 @@
\createvariable{examiner}
\createvariable{titleenglish}
\createvariable{titleswedish}
\renewcommand{\@title}{\ifx\@titleenglish\@empty\@titleswedish\else\@titleenglish\fi}
\createvariable{keywords}
\createvariable{keywordsswedish}
\createvariable{department}
@@ -301,14 +302,72 @@
\LoadClass{memoir}
\RequirePackage{color}
\RequirePackage[svgnames]{xcolor}
\RequirePackage[cmyk,svgnames,hyperref]{xcolor}
\RequirePackage{pdfpages}
\RequirePackage{tikz}
\RequirePackage{pbox}
\RequirePackage{ifthen}
\RequirePackage{geometry}
\RequirePackage[pdfusetitle]{hyperref}
%%%%%%%%%% PDF/A and PDF/X support
% https://tex.stackexchange.com/questions/474197/pdfx-incomplete-cidset-in-some-fonts/474336#474336
\ifluatex
\pdfvariable omitcidset=1
\fi
\RequirePackage[pdfa,pdfusetitle,bookmarks=false]{hyperref} %bookmarks are incompatible with PDF/X<6
\RequirePackage{hyperxmp}[2020/06/15]
\RequirePackage{cmap}
\RequirePackage{colorprofiles}
\ifxetex
\def\OBJ@CMYK{@colorprofile}%
\immediate\special{pdf:fstream \OBJ@CMYK (\colorpro@cmyk@profile) <</N 4>>}%
\def\pdfcatalog#1{\special{pdf:put @catalog <<#1>>}}
\def\pdfpageattr#1{\special{pdf:put @thispage <<#1>>}}
\else
\immediate\pdfobj stream attr{/N 4} file {\colorpro@cmyk@profile}%
\edef\OBJ@CMYK{\the\pdflastobj\space 0 R}%
\fi
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \OBJ@CMYK
/OutputConditionIdentifier (\colorpro@cmyk@intent)
/Info(FOGRA39L)
/OutputCondition(\colorpro@cmyk@identifier)
/RegistryName(\colorpro@cmyk@registry)
>>
<<
/Type /OutputIntent
/S/GTS_PDFX
/DestOutputProfile \OBJ@CMYK
/OutputConditionIdentifier (\colorpro@cmyk@intent)
/Info(FOGRA39L)
/OutputCondition(\colorpro@cmyk@identifier)
/RegistryName(\colorpro@cmyk@registry)
>> ]
}
% Bugfix of hyperref to produce CMYK links
\let\HyColor@HyperrefBorderColor\HyColor@XZeroOneThreeFour
% Tell PDF/X the final format of the paper
\@tempdima=0.99626400996264009962\paperwidth
\edef\boxwd{\strip@pt\@tempdima}
\@tempdima=0.99626400996264009962\paperheight
\edef\boxht{\strip@pt\@tempdima}
\edef\next{%
\protect\pdfpageattr{
/TrimBox[0.0 0.0 \boxwd\space \boxht]
}%
}
\next
\hypersetup{%
pdfdisplaydoctitle=true,
pdftrapped=False,
pdfapart=2,
pdfaconformance=B,
pdfuapart=1,
pdfxstandard={PDF/X-4},
}
%%%%%%%%%% end PDF/A and PDF/X support
\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{etoolbox}
Loading