How to define index in the Doc to PDF conversion

I am using Aspose.Words latest release 17.2.0 to convert Word2Pdf. However, basic conversion (using document.save(outputFile, pdfSaveOptions) ) is working fine so far.


Opening the generated PDF in pdf viewer does not contain INDEX though the .docx contains TOC. Converting the same document to PDF from MS Word contains those INDEX in pdf viewer.

Question: is there in Aspose.Words Java API to set any property to get this INDEX available in generated PDF?
Hi,

Thanks for your inquiry. Could you please attach your input Word document and output PDF file showing the undesired behavior here for testing? We will investigate the issue on our end and provide you more information.

Best regards,

Thanks and please find files in attachment.


Regards,
Kalam Azad

Hi Kalam,


Thanks for your inquiry. I have generated a PDF file using the latest licensed version of Aspose.Words i.e. 17.3.0 and attached it here for your reference. Please create a comparison screenshot highlighting (encircle) the problematic areas in this Aspose.Words generated PDF and attach it here for our reference. We will investigate the issue further on our end and provide you more information.

Best regards,

Hi,

Thanks and here are the attached, included:

- Screen shots
- Red colored mark in 17.3.0 shows where and what missing
- Green colored mark in MSOffice2013 shows where and what is expected those INDEX.

Thanks and regards
Kalam

Hi Kalam,


Thanks for your inquiry. We are working over your query and will get back to you soon.

Best regards,

Hi,

Do you have any findings on this issue?

Thanks for your co-operation.

Br,
Kalam

Hi Kalam,


Thanks for being patient. You can meet this requirement by using the following code:

<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>Document doc = new Document(“D:\temp\input.docx”);

PdfSaveOptions opts = new PdfSaveOptions();
opts.setCompliance(PdfCompliance.PDF_A_1_A);
opts.getOutlineOptions().setExpandedOutlineLevels(9);
opts.getOutlineOptions().setHeadingsOutlineLevels(9);
opts.getOutlineOptions().setDefaultBookmarksOutlineLevel(9);

doc.save(“D:\temp\awjava-17.3.pdf”, opts);

Hope, this helps.

Best regards,

Hi,

Thanks, it works :slight_smile:

- Kalam