Merge pull request #352 from wangweirui/integration

Add the bookmarks in pdf when converting from word file.
This commit is contained in:
Adrien Allard authored and GitHub committed 2024-01-19 11:27:30 +01:00
commit 19ba35ddc8
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);