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日 新增功能: