Free Support Forum - aspose.com

Aspsoe Words not recognizing the header for Bookmarks

Hi,
I am using the latest Aspose Words to create a PDF with bookmarks but it fails to convert the headers to bookmarks.
Note:- This was working in the earlier Aspose.Words

Attaching the working rendition and the source document.
Following are the bookmarks.
TaskOne
TaskTwo
TaskThree

TEST.zip (535.2 KB)

Regards,
Ankur Vashishtha

You can reproduce using Aspose.Words for Java 13.6.0.0.

Regards,
Ankur Vashishtha

@AjeshEMC,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Please attach the output PDF file that shows the undesired behavior.
  • Please share the Aspose.Words’ version that generates the correct output.
  • Please create a simple Java application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi,
This is the sample code.

    public static void main(String args[]) throws Exception {
    loadLicense();

    Document doc = new Document("C:\\a.docx");
    HandleDocumentWarnings callback = new HandleDocumentWarnings();
    com.aspose.words.PdfSaveOptions saveOptions = null;
    saveOptions = new com.aspose.words.PdfSaveOptions();

    OutlineOptions outlineOptions = saveOptions.getOutlineOptions();
    outlineOptions.setExpandedOutlineLevels(1);
    outlineOptions.setHeadingsOutlineLevels(1);
    doc.save("C:\\bookmark.pdf",saveOptions);
}

Attaching the PDF generated using Aspose.Words for Java 13.6.0.0 and the latest version.
Bookmarks are getting created in the 13.6 but not in the latest version.
Input_working_non_working.zip (271.1 KB)

Regards,
Ankur Vashishtha

@AjeshEMC,

Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-16833. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,
So is it a bug?
It should be able to recognize the headers and convert to bookmarks. Right?

Regards,
Ankur

@AjeshEMC,

Thanks for your inquiry. Yes, your understanding is correct.

Hi Tahir,
Any update?

Please answer this as well:
What is the correct behavior of Aspose Words? Should the header be a part of the final rendition? Is it incorrect , if it does not render the header as bookmark. But the problem is if you save it , using the office Save as, it wont recognize the headers in this specific case. I am confused as we want to know, what is the standard behavior of Aspose Words in this case. Were the earlier versions incorrect, to render the header into bookmark or the subsequent versions of the Aspose Words are incorrect as they don’t render the header into bookmark.

Regards,
Ankur Vashishtha

Regards,
Ankur Vashishtha

@AjeshEMC,

Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-16833) as ‘Not a Bug’.

The behavior of old version of Aspose.Words is incorrect. Please note that Aspose.Words mimics the behavior of MS Word. MS Word does not create bookmarks for headings inside table when document is converted to PDF.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan