Skip to content
Snippets Groups Projects
Commit f8536a36 authored by Ola Leifler's avatar Ola Leifler
Browse files

Merge branch 'pdfa' into 'master'

Add rudimentary PDF/A-2b support

See merge request olale55/liuthesis!38
parents f820a22d 0ba194b9
No related branches found
No related tags found
No related merge requests found
......@@ -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}
......
#! /usr/bin/env bash
filename=$(basename $1 .pdf)
gs -dPDFA -dBATCH -dNOPAUSE \
-sColorConversionStrategy=UseDeviceIndependentColor \
-sDEVICE=pdfwrite -dPDFACompatibilityPolicy=2 \
-sOutputFile=$filename-pdfa.pdf \
$1
File added
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment