We are using the GroupDocs.Conversion 22.6.0 NuGet Package for .NET.
I’m currently testing the GroupDocs.Conversion functionality and I want to convert a DOCX file to a PDF with automatically created bookmarks for every heading. There is such an option when you convert a DOCX to a PDF in Word: image.png (1.9 KB).
I couldn’t find an option to do this with GroupDocs.Conversion.
In the feature list of GroupDocs.Conversion there is a point about bookmarks, so I think there is probably an option to do so. image.png (4.8 KB)
Now my question: Is there such an option? And if yes, how can I do it?
Do you have any updates on this case?
We bought the license already and would like to know what this feature really can do. I didn’t find any documentation for this feature and I would really like to know what this feature can do exactly.
In the meantime I was able to make this work. My DOCX Headings now are being converted to PDF bookmarks with the following code:
// Initialize a new instance of LoadOptions
var loadOptions = new WordProcessingLoadOptions();
// Initialize a new instance of WordProcessingBookmarksOptions
var bookmarksOptions = new WordProcessingBookmarksOptions
{
// Set the BookmarksOutlineLevel
HeadingsOutlineLevels = 9 // Set the level as per your requirement
};
// Set the WordProcessingBookmarksOptions to the LoadOptions
loadOptions.BookmarkOptions = bookmarksOptions;
// Convert to PDF
using (var converter = new Converter(sourcePath, () => loadOptions))
{
var convertOptions = new PdfConvertOptions();
convertOptions.PdfOptions.FormattingOptions.PageMode = PdfPageMode.UseNone;
converter.Convert(outFileName, convertOptions);
}