From 94de0ec0bc3fa3520628fb5a706aa5cfd985bc52 Mon Sep 17 00:00:00 2001 From: WMJ Date: Thu, 6 Apr 2023 16:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=8D=E6=8F=90=E5=8F=96=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=9D=E7=95=99=E4=B9=A6=E7=AD=BE=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=9C=A8=E5=8B=BE=E9=80=89=E6=B8=85=E7=90=86?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E9=80=89=E9=A1=B9=E5=90=8E=E4=BC=9A=E5=A4=B1?= =?UTF-8?q?=E6=95=88=EF=BC=88fixed=20#156=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Processor/PdfPageExtractor.cs | 26 ++++---------------------- 更新历史.txt | 1 + 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/App/Processor/PdfPageExtractor.cs b/App/Processor/PdfPageExtractor.cs index 9f60b7b..1610a33 100644 --- a/App/Processor/PdfPageExtractor.cs +++ b/App/Processor/PdfPageExtractor.cs @@ -205,35 +205,17 @@ namespace PDFPatcher.Processor else if (pdf.Catalog == pdf.Trailer.GetAsDict(PdfName.INFO)) { FixIncorrectTrailerInfo(pdf); } + if (options.EnableFullCompression) { + pdf.RemoveUnusedObjects(); + w.SetFullCompression(); + } if (bm != null) { pdf.Catalog.Put(PdfName.OUTLINES, OutlineManager.WriteOutline(w.Writer, bm, ranges.TotalPages)); w.ViewerPreferences = PdfWriter.PageModeUseOutlines; } w.Writer.Info.Put(PdfName.PRODUCER, new PdfString(String.Concat(Application.ProductName, " ", Application.ProductVersion))); Tracker.TraceMessage("保存文件:" + targetFile); - if (options.EnableFullCompression) { - pdf.RemoveUnusedObjects(); - w.SetFullCompression(); - } w.Close(); - //Document doc = new Document (); - //PdfSmartCopy w = new PdfSmartCopy (doc, s); - //if (impOptions.ImportDocProperties) { - // w.Info.Merge (info ?? new PdfDictionary ()); - //} - //w.Info.Put (PdfName.CREATOR, new PdfString (String.Concat (Application.ProductName, " ", Application.ProductVersion))); - //doc.Open (); - //var creator = new PdfDocumentCreator (options, impOptions, doc, w); - //creator.ProcessFile (options.SourceItems[0]); - //Tracker.TraceMessage ("保存文件:" + targetFile); - //var bm = creator.PdfBookmarks; - //if (bm != null && bm.DocumentElement != null && bm.DocumentElement.HasChildNodes) { - // Tracker.TraceMessage ("自动生成文档书签。"); - // PdfBookmarkUtility.WriteOutline (w, bm.DocumentElement, w.PageEmpty ? w.CurrentPageNumber - 1 : w.CurrentPageNumber); - // w.ViewerPreferences = PdfWriter.PageModeUseOutlines; - //} - //doc.Close (); - //w.Close (); } Tracker.TraceMessage(Tracker.Category.Alert, "成功提取文件内容到 <<" + targetFile + ">>。"); } diff --git a/更新历史.txt b/更新历史.txt index df652f6..e9bb34a 100644 --- a/更新历史.txt +++ b/更新历史.txt @@ -65,6 +65,7 @@ 添加不存在的文件到重命名文件列表会导致程序崩溃。 合并文件功能自动旋转页面适应源图像尺寸选项无效。 点击生成书签功能“忽略文本”表头会导致程序崩溃。 + 提取页面功能保留书签的功能在勾选清理文档选项后会失效。 0.6.2.0 2021年11月9日 新增功能: