-提取页面功能保留书签的功能在勾选清理文档选项后会失效(fixed #156)

This commit is contained in:
WMJ
2023-04-06 16:49:02 +08:00
parent 1ec825e6fc
commit 94de0ec0bc
2 changed files with 5 additions and 22 deletions
+4 -22
View File
@@ -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 + ">>。");
}
+1
View File
@@ -65,6 +65,7 @@
添加不存在的文件到重命名文件列表会导致程序崩溃。
合并文件功能自动旋转页面适应源图像尺寸选项无效。
点击生成书签功能“忽略文本”表头会导致程序崩溃。
提取页面功能保留书签的功能在勾选清理文档选项后会失效。
0.6.2.0 2021年11月9日
新增功能: