From 5303791bc4a9d5233a60e6bc84f2fb773c9c8e4e Mon Sep 17 00:00:00 2001 From: Karl Pettersson <klpn1258@gmail.com> Date: Mon, 15 Jul 2019 20:55:04 +0200 Subject: Customizable type of PDF/A for the ConTeXt writer (issue #5608) (#5610) * Let the user choose type of PDF/A generated with ConTeXt (closes #5608) * Updated ConTeXt test documents for changes in tagging * Updated color profile settings in accordance with ConTeXt wiki * Made ICC profile and output intent for PDF/A customizable * Read pdfa variable from meta (and updated manual) --- src/Text/Pandoc/Writers/ConTeXt.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 0b754dd21..7b84eb1f5 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -15,7 +15,7 @@ Conversion of 'Pandoc' format into ConTeXt. module Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where import Prelude import Control.Monad.State.Strict -import Data.Char (ord, isDigit) +import Data.Char (ord, isDigit, toLower) import Data.List (intercalate, intersperse) import Data.Maybe (mapMaybe) import Data.Text (Text) @@ -93,6 +93,9 @@ pandocToConTeXt options (Pandoc meta blocks) = do Just (('a':d:ds) :: String) | all isDigit (d:ds) -> resetField "papersize" (('A':d:ds) :: String) + _ -> id) + $ (case toLower <$> lookupMetaString "pdfa" meta of + "true" -> resetField "pdfa" ("1b:2005" :: String) _ -> id) metadata let context' = defField "context-dir" (toContextDir $ getField "dir" context) context -- cgit v1.2.3