Keep Word Headings as PDF Bookmarks When Converting Word to PDF in C#

Start from version 7.3.3, Spire.Doc supports keeping Word headings as PDF bookmarks when converting Word to PDF. This article demonstrates how to use Spire.Doc to accomplish this functionality.

The input Word document:

Keep Word Headings as PDF Bookmarks When Converting Word to PDF in C#

Example code

using Spire.Doc;

namespace Keep_word_headings_as_pdf_bookmarks
{
    class Program
    {
        static void Main(string[] args)
        {
            Document doc = new Document();
            doc.LoadFromFile("Input.docx");

            ToPdfParameterList topdf = new ToPdfParameterList();
            topdf.CreateWordBookmarks = true;
            topdf.CreateWordBookmarksUsingHeadings = true;

            doc.SaveToFile("Output.pdf", topdf);
        }
    }
}

The output PDF document:

Keep Word Headings as PDF Bookmarks When Converting Word to PDF in C#