Add the bookmarks in pdf when converting from word file.

This commit is contained in:
Weirui Wang committed 2023-12-27 15:53:53 +08:00
1 parent 3b42c75c27
commit c91f33192e
1 file changed
+12 -1
@@ -100,7 +100,18 @@ namespace FileConverter.ConversionJobs
this.UserState = Properties.Resources.ConversionStateConversion;
Diagnostics.Debug.Log("Convert word document to pdf.");
this.document.ExportAsFixedFormat(this.intermediateFilePath, Word.WdExportFormat.wdExportFormatPDF);
// this.document.ExportAsFixedFormat(this.intermediateFilePath, Word.WdExportFormat.wdExportFormatPDF);
this.document.ExportAsFixedFormat(this.intermediateFilePath,
Word.WdExportFormat.wdExportFormatPDF,
false,
Word.WdExportOptimizeFor.wdExportOptimizeForPrint,
Word.WdExportRange.wdExportAllDocument,
1, 1,
Word.WdExportItem.wdExportDocumentContent,
true,
true,
Word.WdExportCreateBookmarks.wdExportCreateHeadingBookmarks,
true);
Diagnostics.Debug.Log("Close word document '{0}'.", this.InputFilePath);
this.document.Close(Word.WdSaveOptions.wdDoNotSaveChanges);