Skip to content

Commit

Permalink
-提取页面功能保留书签的功能在勾选清理文档选项后会失效(fixed wmjordan#156
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Apr 8, 2023
1 parent 1ec825e commit 94de0ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
26 changes: 4 additions & 22 deletions App/Processor/PdfPageExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,35 +205,17 @@ static void ExtractPages(ExtractPageOptions options, string sourceFile, FilePath
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 + ">>。");
}
Expand Down
1 change: 1 addition & 0 deletions 更新历史.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
添加不存在的文件到重命名文件列表会导致程序崩溃。
合并文件功能自动旋转页面适应源图像尺寸选项无效。
点击生成书签功能“忽略文本”表头会导致程序崩溃。
提取页面功能保留书签的功能在勾选清理文档选项后会失效。

0.6.2.0 2021年11月9日
新增功能:
Expand Down

0 comments on commit 94de0ec

Please sign in to comment.