Image in footer missing when converted to PDF

Hi Team,

I hope this message finds you well.

I am experiencing an issue with a document that loses the image in the footer when converting from Word to PDF. I am currently using Aspose.Words version 25.2.0 and Aspose.PDF version 25.1.0, which are the latest stable releases.

Here is the code I used for the conversion:

// Load the Word document
Document doc = new Document(inputFilePath);

// Create PDF save options
PdfSaveOptions saveOptions = new PdfSaveOptions();

// Save the document as PDF
doc.Save(outputFilePath, saveOptions);

I also attempted to adjust the save options, but unfortunately, that did not resolve the issue. Below is the modified code I tried:

// Load the Word document
Document doc = new Document(inputFilePath);

// Create PDF save options
PdfSaveOptions saveOptions = new PdfSaveOptions
{
    FontEmbeddingMode = PdfFontEmbeddingMode.EmbedAll, // Embed all fonts
    ExportDocumentStructure = true
};

// Save the document as PDF
doc.Save(outputFilePath, saveOptions);

I have attached the testing document that is causing the issue for your reference.

Any assistance you can provide in resolving this matter would be greatly appreciated.

Thank you!

Best regards,
Dave
TestingDocument.docx (19.8 KB)

@david_j_meyer2_boeing_com

It seems you are experiencing an issue with an image in the footer disappearing when converting a Word document to PDF using Aspose.Words. This can sometimes occur due to how images are handled in headers and footers during the conversion process.

Here are a few suggestions to troubleshoot and potentially resolve the issue:

  1. Ensure Image Format Compatibility: Make sure that the image format used in the footer is supported by Aspose.Words. Common formats like PNG, JPEG, and GIF are generally safe to use.

  2. Check Image Insertion Method: When inserting images into the footer, ensure that you are using the correct method. For example, using DocumentBuilder.InsertImage is recommended for inserting images into headers and footers.

  3. Update Aspose.Words Version: You mentioned using Aspose.Words version 25.2.0. If there are any newer versions available, consider updating to the latest version, as it may contain bug fixes related to image handling.

  4. Use PdfSaveOptions: You are already using PdfSaveOptions, but you might want to experiment with additional options. For instance, try setting EmbedFullFonts to true, which can sometimes help with rendering issues.

  5. Test with a Simple Document: Create a simple Word document with just the footer image and see if it converts correctly. This can help determine if the issue is with the specific document or a broader problem.

Here’s a sample code snippet for inserting an image into the footer:

Document doc = new Document(inputFilePath);
DocumentBuilder builder = new DocumentBuilder(doc);

// Move to the footer section
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);

// Insert an image into the footer
builder.InsertImage("path_to_your_image.png", 
    RelativeHorizontalPosition.Page, 10, 
    RelativeVerticalPosition.Page, 10, 
    50, 50, WrapType.Through);

// Save the document as PDF
doc.Save(outputFilePath, new PdfSaveOptions());

If the issue persists after trying these suggestions, consider reaching out to Aspose support with the specific document you are working with, as they may provide more targeted assistance.

Feel free to ask if you have any further questions or need additional help!

Sources:
[1]: Create Header Footer | Aspose.Words Document Processing API

The image is not external, it is imbedded drawing in the document. It can be edited in Word because it was drawn using word tools.

@david_j_meyer2_boeing_com
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-27860

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.

Hi, I hope you’re doing well. Were you able to replicate the error with the document I shared?

@david_j_meyer2_boeing_com Yes, we have managed to reproduce the problem and logged it as WORDSNET-27860. We will keep you informed and let you know once it is resolved.

I copied the entire drawing object from the footer and placed it directly on the page, but it still fails to convert properly.

Could you please confirm if Aspose supports the conversion of drawing objects from a Word document to a PDF?

Do you have an estimate on how long it might take to address this issue? I hold multiple licenses with your company, including Aspose.Words for .NET C# Site Small Business and Aspose.Total for .NET C# Developer OEM.

We are currently renewing the Aspose.Words for .NET now and will be renewing the Aspose.Total for .NET soon.

To help clarify the issue, I started by deleting the Address section in the drawing object. It appears that each letter is in its own text box, as I noticed many boxes when I selected the area—one for each letter in the address. After removing that section, the document successfully converted to a PDF. I have attached this test document for your review.

Please note that we cannot modify the original Word document, as it is a defined document that has been in use for years. We need the conversion to occur without any changes to the original.

I hope this information helps pinpoint the issue in the code and expedites the resolution.
John.pdf (48.3 KB)

John.docx (68.1 KB)

@david_j_meyer2_boeing_com The issue is currently in the queue for analysis. From what I see the problem occurs with rendering metafile image in your document. Once the analysis is done we will be able to provide you more information or a fix. We will keep you updated.

Awesome, thank you.

1 Like

@david_j_meyer2_boeing_com The issue is already resolved in the current codebase. The fix will be include into the next 25.3 version (March 2025) of Aspose.Words. We will let you know once it is published.

That’s awesome, thanks for the update.

This is a production issue for us, is there anyway to get a patch before March release?

@david_j_meyer2_boeing_com 25.3 version of Aspose.Words will be published in the very beginning of March. Release preparation will start in a week. So, unfortunately, it is unlikely we can provide you a pre-release version fast.

Is there a way for us to pinpoint which documents might have trouble converting to PDF due to this specific issue? We’re trying to tackle our production challenge and would like to at least flag any documents that could have conversion problems.

@david_j_meyer2_boeing_com The problem is not in the document itself. It is in the metafile image. The problematic metafile contains META_SETPOLYFILLMODE rerecord with invalid PolyFillMode value and it was handled with exception.

Do you have an expected release date for the new version? We require the patch to fix a production issue.

Thanks, Dave

@david_j_meyer2_boeing_com We are currently in the release process. The new version with the fix will be available within the next few days.

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