none
Footnote text is getting overlapped when i save the document as webpage and view it in browser. RRS feed

  • Question

  • Hi,

    I have a word document with a footnote of 3 lines in that document and save this document as webpage using File->Save As. Now if i open this webpage the 3 lined footnote is getting overlapped and it is displayed in single line. Please someone let me know why it is happening like this and what needs to be done to see the footnote same as the one which is in word document after saving and opening it as webpage.

    Please, some one help me out to solve this issue. Thanks in advance.

    Regards, Chetan.

    Wednesday, June 22, 2011 7:37 AM

Answers

  • Hi Victor

    Thank you for the reproduction steps. I tried in Word 2007 (since it's what I have installed on this machine) and now see an overlap. The second line comes up over the first.

    The problem comes from the footnote/endnote reference. If you open the document in a browser (IE) then View Source, you'll see an entry under styles:

    span.MsoEndnoteReference

    Part of the definition of this <span> is: vertical-align:super;

    This raises the reference (superscript). In doing so, however, it appears that the browser interprets this as meaning it needs to push down the line of text that appears next to the footnote/endnote. But it doesn't make the logical leap that all following lines would also need to be "dropped", thus the overlap.

    I can "fix" the problem by removing vertical-align:super; from the style definition. The result is that the first line of the footnote/endnote is directly in-line with the reference and the next line follows correctly.

    On the Word side, all I need to do is change the style definition "Endnote Reference" to remove the superscript from the font definition and set a smaller (appropriate) font size. Please note that this will also affect the way the reference is displayed in the document text, as well (which also improves display on the HTML page).

    The line of code to make the change to the style from within Word:

       activeDocument.Styles("Endnote Reference").Font.Superscript = false


    Cindy Meister, VSTO/Word MVP

    Thursday, July 12, 2012 3:50 PM
    Moderator

All replies

  • Hi Chetan

    This forum focuses on programming questions. Your question is an end-user question (there's not programming interface for influencing how Word saves files to a different file format), so you need to ask it in a forum that supports end-user issues. Unfortunately, I can't move messages to that forum:

    http://answers.microsoft.com/en-us/office/forum/word

    When you post there, please remember to mention the version of Word you're using.


    Cindy Meister, VSTO/Word MVP
    Wednesday, June 22, 2011 12:28 PM
    Moderator
  • Thanks Cindy.

    For directing me to appropriate forum.

    I am doing the above programatically by using WordApp API for saving as html and displaying it in webpage.

    But when i tried to do the same as End user i.e, creating a test document with 3lines footnote in it and saving the document as webpage and opening the webpage. i was able to replicate the issue(i.e, overlapping of footnote).

     

    Regards, Chetan.

    Thursday, June 23, 2011 5:35 AM
  • Hi Chetan

    Yes, then you need to ask this question in the end-user forum, as those are the folks who will best know whether there's any way to convince the converter to not do this.

    Otherwise, you'll need to take the text out of the footnote and make it part of the document body. Which probably would be a topic for this forum :-), but you want to check with the end-user forum, first, whether there's a "better way".

    If you do need to fix this using the Word API you need to tell us: 1) Where the footnotes are currently located in relation to the rest of the document and 2) Where you want them to appear in the HMLT result.


    Cindy Meister, VSTO/Word MVP
    Thursday, June 23, 2011 9:01 AM
    Moderator
  • Dear Chetan
    Hope you find your answer here
    Regards
    Mona
    Thursday, June 23, 2011 8:54 PM
  • Hi Cindy,

    I raised this question in end user forum but i did not proper fix/solution form that.

    Cindy, please let me know the fix using Word API.

    a. The footnote is located at the bottom of word document.

    b. I want the footnote to appear in same way/place as in word document, it is displaying at the bottom of html page but i need to concentrate on 1st and 2nd line of my footnote, the 2nd line is overlapping on the 1st line of the footnote and the 3rd line of the footnote is displaying correctly(i.e, in the next line(its not overlapping with first line)).

     

    Thanks in advance,

    Friday, July 1, 2011 9:38 AM
  • Dear Mona,

    The link which you shared guides us as to how to write the footnote in word document.

    The issue i am facing is bit different, I have a word document it contains footnote of 3-4 lines, now if i try to view the document in webpage, the footnote is getting overlapped(i.e, 2nd line of footnote is overlapped on 1st line of footnote and the rest all lines of footnote are displaying correctly without overlapping).

    Thanks in advance,

    Chetan.

    Friday, July 1, 2011 9:44 AM
  • Hi Chetan

    I was setting up a test situation and ran into a conflict with your description. you say the footnote is located at "the bottom of the word document". But footnotes are either at the bottom of a page or below the text.

    An end-note can be at the bottom of the document, but then it's not the same part of the object model as a footnote.

    Is this a footnote (and the document is simply so short that the bottom of the page is also the end of the document)?

    If it's a footnote and you change it to an endnote (which would make more sense when saving as HTML, anyway) does the problem you're seeing go away?

    You say your footnote is three lines of text. Is this just "plain text" or is there anything special in it, such as bold or different fonts or graphics...?


    Cindy Meister, VSTO/Word MVP
    Saturday, July 2, 2011 11:36 AM
    Moderator
  • Hi Cindy,

    The footnote occurs at bottom of every page. But when i save it as html, all the footnotes are put together at the end of the document.

    Yes, It is just a plain text.

    Thanks in advance,Chetan.

    Thursday, July 14, 2011 11:52 AM
  • Hi Chetan

    An HTML document does not layout in "pages". It's a single page. So it makes sense that all footnotes are at the end of the document. So I ask the question again: If you change the footnotes to endnotes before you "Save As" to the HTML file format does the problem you're seeing go away?

    Programmatically that would be: ActiveDocument.Footnotes.Convert


    Cindy Meister, VSTO/Word MVP
    Thursday, July 14, 2011 12:15 PM
    Moderator
  • Dear Cindy,

    To re-produce the issue create a new Word 2010 document, type some random text, add a footnote or an endnote, - does not matter.
    Save that document as *.html and open it in IE.
    Y
    ou will immediately see the problem. A next row after footnote would be ugly.

    For us it is a huge problem, and before converting MS Word docs to html through C# and API we have manually tweak hundreds of documents.
    Converting notes to endnotes or footnotes does not help.

    Please open Word and try yourself, super easy to reproduce the effect.

    Thanks.

    Thursday, July 12, 2012 3:01 PM
  • Hi Victor

    Thank you for the reproduction steps. I tried in Word 2007 (since it's what I have installed on this machine) and now see an overlap. The second line comes up over the first.

    The problem comes from the footnote/endnote reference. If you open the document in a browser (IE) then View Source, you'll see an entry under styles:

    span.MsoEndnoteReference

    Part of the definition of this <span> is: vertical-align:super;

    This raises the reference (superscript). In doing so, however, it appears that the browser interprets this as meaning it needs to push down the line of text that appears next to the footnote/endnote. But it doesn't make the logical leap that all following lines would also need to be "dropped", thus the overlap.

    I can "fix" the problem by removing vertical-align:super; from the style definition. The result is that the first line of the footnote/endnote is directly in-line with the reference and the next line follows correctly.

    On the Word side, all I need to do is change the style definition "Endnote Reference" to remove the superscript from the font definition and set a smaller (appropriate) font size. Please note that this will also affect the way the reference is displayed in the document text, as well (which also improves display on the HTML page).

    The line of code to make the change to the style from within Word:

       activeDocument.Styles("Endnote Reference").Font.Superscript = false


    Cindy Meister, VSTO/Word MVP

    Thursday, July 12, 2012 3:50 PM
    Moderator
  • Thanks Cindy,

    You have described the problem I am experiencing correctly.
    Thanks for your suggestions, this might work for me very well !!!!

    I will give it a try, and post my results in this thread.

    Thanks for a prompt reply !




    Thursday, July 12, 2012 3:56 PM
  •  

    Thanks Cindy,

    I did try what you suggested and it worked excellent. Thank you very much for your help !!

    Victor

         doc.Styles["Footnote Reference"].Font.Superscript = 0;
         doc.Styles["Footnote Reference"].Font.Color = Microsoft.Office.Interop.Word.WdColor.wdColorLightBlue;
         doc.Styles["Endnote Reference"].Font.Superscript = 0;
         doc.Styles["Endnote Reference"].Font.Color = Microsoft.Office.Interop.Word.WdColor.wdColorLightBlue;

    Monday, July 16, 2012 3:51 PM