We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Headers / Footers lost When Converting from RTF to Doc

When I try to convert a doc from RTF to DOC, the headers and footers are lost. Very simply, I am doing this:

Document doc = new Document("myrtffile.rft");
doc.Save("mydocfile.doc", SaveFormat.Doc);

Is there a fix in the works for this? Or can I have a workaround?
Thanks in advance for your help! :slight_smile:

BTW - I am using aspose.words This happens with any RTF file I create with MS Word that has a header and footer.


Thanks for your request. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
As a temporary workaround, you can try using the following code:

// Open source document.
Document doc = new Document(@"Test001\in.rtf");
// Loop through all sections.
foreach(Section section in doc.Sections)
    // Create list, where we will temporary store headers/footers.
    ArrayList hfList = new ArrayList();
    foreach(HeaderFooter headerFooter in section.HeadersFooters)
        // Create copy of the header/footer.
        HeaderFooter hfNew = new HeaderFooter(doc, headerFooter.HeaderFooterType);
        // Copy all content from old header footer.
        foreach(Node node in headerFooter.ChildNodes)
    // Remove old headers/footes.
    // Add new headers/footers.
    foreach(HeaderFooter headerFooter in hfList)
// Save output document.

Hope this helps.
Best regards.

Thanks for your help. I can now copy headers and footers.

The issues you have found earlier (filed as 11088) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.