diff --git a/App/Functions/FrontPage.html b/App/Functions/FrontPage.html index 93f6b40..57cf16f 100644 --- a/App/Functions/FrontPage.html +++ b/App/Functions/FrontPage.html @@ -34,11 +34,11 @@ td {

$appName

-
+

处理 PDF 文档

Editor;Editor;修改 PDF 文件;创建或修改 PDF 文档的书签,修改 PDF 文档的设置
DocumentProcessor;Patcher;批量修改 PDF 文件;根据配置批量处理 PDF 文档,生成新的文档
-
Merger;Merger;合并 PDF 和图片文件;将多个图片和 PDF 文档合并为新的 PDF 文档
+
Merger;Merger;合并文件;将多个图片和 PDF 文档合并为新的 PDF 文档
Ocr;Ocr;识别图像文本;识别扫描 PDF 文档的文字(需微软 Office 2003或2007的光学字符识别(OCR)引擎支持)
AutoBookmark;BookmarkGenerator;自动生成书签;根据 PDF 的文本样式生成书签文件
Rename;Rename;批量重命名文件;根据 PDF 的文本属性更改文件名
@@ -62,6 +62,6 @@ td {
-
著作权所有:WMJordan;主页:$AppHomePage;电邮:wmjordan@163.com
+
著作权所有:WMJordan;主页:$appHomePage;电邮:wmjordan@163.com
\ No newline at end of file diff --git a/App/Functions/FrontPageControl.cs b/App/Functions/FrontPageControl.cs index 692d845..28ef5ba 100644 --- a/App/Functions/FrontPageControl.cs +++ b/App/Functions/FrontPageControl.cs @@ -19,19 +19,19 @@ namespace PDFPatcher bool ITabContent.CanClose => false; public override void ExecuteCommand(string commandName, params string[] parameters) { - if (commandName == Commands.Open) { - var n = AppContext.MainForm.ShowPdfFileDialog(); - if (n != null) { - AppContext.MainForm.OpenFileWithEditor(n); - } - return; - } - if (commandName == Commands.CleanUpInexistentFiles) { - AppContext.CleanUpInexistentFiles(AppContext.Recent.SourcePdfFiles); - AppContext.CleanUpInexistentFiles(AppContext.Recent.InfoDocuments); - AppContext.CleanUpInexistentFolders(AppContext.Recent.Folders); - RefreshContent(); - return; + switch (commandName) { + case Commands.Open: + var n = AppContext.MainForm.ShowPdfFileDialog(); + if (n != null) { + AppContext.MainForm.OpenFileWithEditor(n); + } + return; + case Commands.CleanUpInexistentFiles: + AppContext.CleanUpInexistentFiles(AppContext.Recent.SourcePdfFiles); + AppContext.CleanUpInexistentFiles(AppContext.Recent.InfoDocuments); + AppContext.CleanUpInexistentFolders(AppContext.Recent.Folders); + RefreshContent(); + return; } base.ExecuteCommand(commandName, parameters); } @@ -40,7 +40,7 @@ namespace PDFPatcher InitializeComponent(); Text = "主页"; RefreshContent(); - RecentFileItemClicked = (s, args) => { AppContext.MainForm.OpenFileWithEditor(args.ClickedItem.ToolTipText); }; + RecentFileItemClicked = (s, args) => AppContext.MainForm.OpenFileWithEditor(args.ClickedItem.ToolTipText); AllowDrop = true; } @@ -68,27 +68,29 @@ namespace PDFPatcher base.SetupCommand(item); } - private void RefreshContent() { + void RefreshContent() { + var s = FormHelper.GetDpiScale(this); _FrontPageBox.Text = __FrontPagePattern - .Replace(Properties.Resources.FrontPage, @"
$3
") + .Replace(Properties.Resources.FrontPage, $@"
$3
") + .Replace("$sideBarWidth", (s * 180).ToText() + "px") .Replace("$appName", Constants.AppName) - .Replace("$AppHomePage", Constants.AppHomePage) + .Replace("$appHomePage", Constants.AppHomePage) .Replace("
  • ", GetLastFileList()); } - private string GetLastFileList() { + string GetLastFileList() { var i = 0; - return String.Concat(AppContext.Recent.SourcePdfFiles.ConvertAll((s) => FileHelper.IsPathValid(s) && System.IO.File.Exists(s) + return String.Concat(AppContext.Recent.SourcePdfFiles.ConvertAll((s) => FileHelper.IsPathValid(s) && new FilePath(s).ExistsFile ? String.Concat(@"
  • ", SubstringAfter(s, '\\'), "
  • ") : String.Concat(@"
  • ", SubstringAfter(s, '\\'), "
  • "))); } - private void _FrontPageBox_LinkClicked(object sender, HtmlLinkClickedEventArgs e) { + void _FrontPageBox_LinkClicked(object sender, HtmlLinkClickedEventArgs e) { HandleLinkClicked(e.Link); e.Handled = true; } - private void _FrontPageBox_ImageLoad(object sender, HtmlImageLoadEventArgs e) { + void _FrontPageBox_ImageLoad(object sender, HtmlImageLoadEventArgs e) { LoadResourceImage(e); }