Aspose.Words looses footnotes converting DOCX to PDF

Scenario: Convert DOCX to PDF.

Issue:

  • Aspose.Words 24.12 – No footnotes on the first page of the generated PDF.
  • Aspose.Words 25.1 – Pdf cannot be generated. NullReferenceException is thrown is thrown.

Attachments:

var doc = new Document(@"sample.docx");
doc.Save(@"sample.docx.pdf", new PdfSaveOptions());

Thanks,
Oleksii

For internal reference: ENGR-8321

@oleksii88

It seems you are experiencing issues with footnotes when converting a DOCX document to PDF using Aspose.Words. Here are some insights and potential solutions based on your description:

  1. Footnotes Missing in PDF: If you are using Aspose.Words version 24.12 and the footnotes are not appearing on the first page of the generated PDF, this could be a rendering issue specific to that version. It is advisable to check if the footnotes are correctly formatted in the DOCX file and ensure that they are not being excluded during the conversion process.

  2. NullReferenceException in Version 25.1: The NullReferenceException you are encountering in version 25.1 suggests that there might be an issue with the document structure or the way the conversion is being handled in that version. This could be due to changes in the library that affect how certain elements are processed.

Suggested Steps to Resolve the Issues:

  • Update to the Latest Version: Ensure you are using the latest version of Aspose.Words, as updates often include bug fixes and improvements. If you are already on the latest version, consider rolling back to a previous stable version if the issue persists.

  • Check Document Structure: Open the DOCX file in Microsoft Word or another compatible editor to verify that the footnotes are correctly placed and formatted. Sometimes, issues in the document itself can lead to problems during conversion.

  • Use PdfSaveOptions: When saving the document, you can customize the PdfSaveOptions to ensure that all elements, including footnotes, are processed correctly. For example, you can set options related to exporting bookmarks or handling headers and footers, which might affect footnote visibility.

Here is a sample code snippet that demonstrates how to save a document with specific PDF options:

var doc = new Document("sample.docx");
PdfSaveOptions saveOptions = new PdfSaveOptions
{
    // Customize options as needed
    // Example: saveOptions.HeaderFooterBookmarksExportMode = HeaderFooterBookmarksExportMode.All;
};
doc.Save("output.pdf", saveOptions);
  • Check for Warnings: Implement a warning callback to capture any warnings that occur during the conversion process. This can help identify if there are specific issues with the document that need to be addressed.

If these steps do not resolve the issue, consider reaching out to Aspose support with the specific details of your document and the errors you are encountering. They may provide additional insights or fixes based on your scenario.

Additional Resources

For more detailed information on using PdfSaveOptions, you can refer to the official documentation or examples provided by Aspose.

If you have any further questions or need additional assistance, feel free to ask!

Sources:
[1]: Working with PdfSaveOptions

@oleksii88
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27812

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as WORDSNET-27812) have been fixed in this Aspose.Words for .NET 25.2 update also available on NuGet.