private void RunEditor(UserSetting setting)
{
if (setting.FileType != Parameter.FileTypes.PDF) return;
var editor = new Editor();
editor.Version = setting.PDFVersion;
editor.Document = setting.Document;
editor.Permission = setting.Permission;
editor.UserPassword = setting.Password;
// 結合順序を考慮してファイルを追加する。
var head = setting.ExistedFile == Parameter.ExistedFiles.MergeHead && !string.IsNullOrEmpty(_escaped);
var tail = setting.ExistedFile == Parameter.ExistedFiles.MergeTail && !string.IsNullOrEmpty(_escaped);
if (tail) editor.Files.Add(_escaped);
editor.Files.Add(setting.OutputPath);
if (head) editor.Files.Add(_escaped);
var tmp = IoEx.Path.Combine(Path.WorkingDirectory, IoEx.Path.GetRandomFileName());
editor.Run(tmp);
AddMessage(string.Format("CubePdf.PageBinder.Save: {0}", tmp));
if (setting.WebOptimize)
{
var src = tmp;
tmp = IoEx.Path.Combine(Path.WorkingDirectory, IoEx.Path.GetRandomFileName());
RunWebOptimize(setting, src, tmp);
}
if (IoEx.File.Exists(tmp)) CubePdf.Misc.File.Copy(tmp, setting.OutputPath, true);
AddMessage("CubePdf.Converter.RunEditor: success");
}