Free Support Forum - aspose.com

Background watermark to html

I am using Aspose to convert a word document with a watermark background image to html and email the resulting html file. This does not work as expected. The watermark is moved to the top of the page in the email. When I open the html file in IE, the formatting looks okay but when I open the html page in Word the formatting of the background watermark is messed up.

Workflow

1. Add a background watermark image to a word document
2. Convert this to html using Words.Document.
3. Email the resulting document using Aspose.Email API. Notice the background image is moved to the top of the page and all other text is moved down. If you open the html generated in step 2 using IE, the formatting looks fine. If you open the html file using Word, the formatting is messed up. I suspect this has something to do with how word interprets the image.

Do you have any workaround for this issue?

Hi Anand,


Thanks for your inquiry. To ensure a timely and accurate response please supply us with the following information, if you cannot supply us with this information we will not be able to investigate your issue and raise a ticket.

  • What version of Aspose.Words for .NET are you using?
  • What environment are you running on?
    • OS (Windows Version or Linux Version)
    • Architecture (32 / 64 bit)
    • .NET Framework version
    • MS Office Version
    • Any Third Party Libraries / SDK in addition to Aspose Products
  • Please supply us with the code from your application that is causing the issue
  • Please supply us with the input Word document that is causing the issue
  • Please supply us with the output HTML document showing the undesired behavior

As soon as you get these pieces of information to us we’ll start our investigation into your issue.

Many thanks,

Thanks for your reply.

1. Aspose.words for .NET - 11.11.0.0

2. Windows 64 bit/.NET 4.0/Office 2010. For this particular workflow, no additional documents are used.

3.I have attached a sample zip with source code, sample document and screenshot of generated email.

Let me know if you need any additional information.

Hi Anand,


Thanks for the additional information.

The watermark image found in your Word document is actually located inside the primary header and when converting this document to HTML format, Aspose.Words by default exports the header at the top of the HTML output (see HtmlSaveOptions.ExportHeadersFootersMode property for other options). On the other hand, when saving to HTML using Microsoft Word, it does not export the Header/Footer content to HTML format altogether. This is because it is hard to meaningfully output headers and footers to HTML because HTML is not paginated. Since there are no Headers/Footers in generated HTML and when you load the HTML produced by Aspose.Words into Microsoft Word, the watermark is displayed inside the Body of document. This is entirely by design.

If we can help you with anything else, please feel free to ask.

Best regards,