diff --git a/Pechkin/GlobalSettings.cs b/Pechkin/GlobalSettings.cs
index 292f6c1..4aec0ed 100644
--- a/Pechkin/GlobalSettings.cs
+++ b/Pechkin/GlobalSettings.cs
@@ -41,10 +41,18 @@ public enum PaperOrientation
[WkhtmltopdfSetting("collate")]
public bool? Collate { get; set; }
+ [WkhtmltopdfSetting("colorMode")]
+ internal string StringColorMode
+ {
+ get
+ {
+ return this.ColorMode == DocumentColorMode.Color ? "grayscale" : "color";
+ }
+ }
+
///
/// Whether to print in color or grayscale. (Default: color)
///
- [WkhtmltopdfSetting("colorMode")]
public DocumentColorMode ColorMode { get; set; }
///
diff --git a/Pechkin/SettingApplicator.cs b/Pechkin/SettingApplicator.cs
index 60f24d1..6200ebc 100644
--- a/Pechkin/SettingApplicator.cs
+++ b/Pechkin/SettingApplicator.cs
@@ -47,13 +47,13 @@ public static void ApplySettings(IntPtr config, object settings, bool global = f
private static string GetStringValue(PropertyInfo property, object value)
{
- var u = Nullable.GetUnderlyingType(property.PropertyType);
+ var type = property.PropertyType;
- if (property.PropertyType == typeof(double?))
+ if (type == typeof(double?) || type == typeof(double))
{
return ((double?)value).Value.ToString("0.##", CultureInfo.InvariantCulture);
}
- else if (property.PropertyType == typeof(bool?))
+ else if (type == typeof(bool?) || type == typeof(bool))
{
return ((bool?)value).Value ? "true" : "false";
}