Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Feb 24, 2021 5:23 pm

Hello,

I am editing a word document and then I need to convert it to PDF with the code below.

Code: Select all
using (MemoryStream ms = new MemoryStream())

            {
                ms.Position = 0;
                document.SaveToStream(ms, new ToPdfParameterList
                {
                    CreateWordBookmarks = true,
                    //CreateWordBookmarksUsingHeadings = true,
                    IsEmbeddedAllFonts = true,
                    //CreateWordBookmarksUsingHeadings = true,
                    WordBookmarksTitle = "root",
                    WordBookmarksColor = System.Drawing.Color.Black
                });
                pdf = ms.ToArray();
            }


Is there a way to remove the bookmark title in the result pdf ? It seems like spire doc is creating a root bookmark and then adding all word bookmarks, is there a way to have only the word bookmarks in the pdf file?

If I save the file with the code above I get something like :
- root
- actual bookmarks from word

I would like the pdf to have :
-bookmarks from word
-another bookmark
etc..

How can I do this?

Thanks,

joaomota34
 
Posts: 2
Joined: Wed Feb 24, 2021 5:15 pm

Thu Feb 25, 2021 5:56 am

Hello,

Thanks for your inquiry.
I did an initial test and did find that our Spire.Doc would create a root bookmark in the generated PDF. You want to generate bookmarks like the one below, right? Sorry our Spire.Doc doesn’t support this yet, but I have posted this requirement to our Dev team to investigate whether it can be achieved. If there is any progress, we will let you know. Apologize for the inconvenience caused.
screenshot.png


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Thu Feb 25, 2021 10:12 am

Hi Brian,

Yes exactly like that. Let me know when you find a solution.
For now im just putting all bookmarks into a list and add them manually to the pdf.

I found another bug, it seems like bookmarks page is always -1. Was this bug already posted?

Thank you,

joaomota34
 
Posts: 2
Joined: Wed Feb 24, 2021 5:15 pm

Fri Feb 26, 2021 5:50 am

Hello,

Thanks for your feedback.
I used Adobe Acrobat to open the result pdf file I generated, but I found the Destination page index of the bookmark was correct. What tool did you use to open your result file? Please provide your input file and your pdf file generated by our Spire.Doc.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Jun 04, 2021 11:21 am

Hello,

Greetings from E-iceblue!
Glad to inform you that we just released Spire.Doc Pack Version:9.6 which will not create a root bookmark in the generated PDF when convert word to pdf, please download it from the following links to test on your side. Looking forward to your test result.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Doc/9.6.0

Sincerely,
Brian
E-icelblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Tue Jun 15, 2021 10:57 am

Hello,

How is your issue now? Does this hotfix solve your issue? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc