diff --git a/src/net/NetPDF/InternalConst.cs b/src/net/NetPDF/InternalConst.cs index 3386b839..cded3f04 100644 --- a/src/net/NetPDF/InternalConst.cs +++ b/src/net/NetPDF/InternalConst.cs @@ -28,6 +28,7 @@ class CLIParam public const string CommonLoggingConfiguration = "CommonLoggingConfiguration"; public const string LogPath = "LogPath"; public const string FontCachePath = "FontCachePath"; + public const string UsePureJavaCMYKConversion = "UsePureJavaCMYKConversion"; } /// diff --git a/src/net/NetPDF/NetPDFCore.cs b/src/net/NetPDF/NetPDFCore.cs index 5b17bd35..365a86bc 100644 --- a/src/net/NetPDF/NetPDFCore.cs +++ b/src/net/NetPDF/NetPDFCore.cs @@ -63,6 +63,11 @@ public override IEnumerable CommandLineArguments Name = CLIParam.FontCachePath, Help = "The path where font cache will be stored.", }, + new ArgumentMetadata() + { + Name = CLIParam.UsePureJavaCMYKConversion, + Help = "Add on command line to enable pure Java CMYK conversion.", + }, }); return lst; } @@ -106,6 +111,7 @@ protected override string[] ProcessCommandLine() } _logPath = ParsedArgs.Get(CLIParam.LogPath); _fontCachePath = ParsedArgs.Get(CLIParam.FontCachePath); + _usePureJavaCMYKConversion = ParsedArgs.Exist(CLIParam.UsePureJavaCMYKConversion); return result; } /// @@ -155,6 +161,11 @@ protected virtual void PrepareMainClassToRun(string className) /// public static string ApplicationFontCachePath { get; set; } + /// + /// to enable pure Java CMYK conversion + /// + public static bool? ApplicationUsePureJavaCMYKConversion { get; set; } + /// /// value can be overridden in subclasses /// @@ -182,6 +193,12 @@ protected virtual void PrepareMainClassToRun(string className) /// public virtual string FontCachePath { get { return ApplicationFontCachePath ?? _fontCachePath; } } + bool _usePureJavaCMYKConversion; + /// + /// The log folder + /// + public virtual bool UsePureJavaCMYKConversion { get { return !ApplicationUsePureJavaCMYKConversion.HasValue ? _usePureJavaCMYKConversion : ApplicationUsePureJavaCMYKConversion.Value; } } + /// /// The log4j configuration /// @@ -224,6 +241,11 @@ protected override IDictionary Options options.Add("pdfbox.fontcache", FontCachePath); } + if (UsePureJavaCMYKConversion) + { + options.Add("org.apache.pdfbox.rendering.UsePureJavaCMYKConversion", "true"); + } + return options; } }