diff --git a/GhostScriptSharp/GhostscriptSharp.cs b/GhostScriptSharp/GhostscriptSharp.cs
index 581080b..f97d05e 100644
--- a/GhostScriptSharp/GhostscriptSharp.cs
+++ b/GhostScriptSharp/GhostscriptSharp.cs
@@ -209,6 +209,12 @@ private static string[] GetArgs(string inputPath,
args.Add(String.Format("-dDEVICEXRESOLUTION={0}", settings.Resolution.Width));
args.Add(String.Format("-dDEVICEYRESOLUTION={0}", settings.Resolution.Height));
+ // Password
+ if (settings.Password != null)
+ {
+ args.Add(String.Format("-sPDFPassword={0}", settings.Password.Password));
+ }
+
// Files
args.Add(String.Format("-sOutputFile={0}", outputPath));
args.Add(inputPath);
@@ -227,6 +233,7 @@ public class GhostscriptSettings
private Settings.GhostscriptPages _pages = new Settings.GhostscriptPages();
private System.Drawing.Size _resolution;
private Settings.GhostscriptPageSize _size = new Settings.GhostscriptPageSize();
+ private Settings.GhostscriptPassword _password = new Settings.GhostscriptPassword();
public Settings.GhostscriptDevices Device
{
@@ -251,11 +258,35 @@ public Settings.GhostscriptPageSize Size
get { return this._size; }
set { this._size = value; }
}
+ public Settings.GhostscriptPassword Password
+ {
+ get { return this._password; }
+ set { this._password = value; }
+ }
}
}
namespace GhostscriptSharp.Settings
{
+ ///
+ /// Password for pdf file
+ ///
+ public class GhostscriptPassword
+ {
+ private string _password;
+ public string Password
+ {
+ set
+ {
+ this._password = value;
+ }
+ get
+ {
+ return this._password;
+ }
+ }
+ }
+
///
/// Which pages to output
///
diff --git a/ThirdParty/gsdll32.dll b/ThirdParty/gsdll32.dll
index 221cb1d..d22bbda 100644
Binary files a/ThirdParty/gsdll32.dll and b/ThirdParty/gsdll32.dll differ