Open hausman-gdit opened 3 years ago
Thanks for the example. I'm looking into this, too.
I think the path to success on this is going to be either hiding the content on the document or removing it somehow without affecting the header. Maybe something with style and view guards. I was trying a few things last night. You're welcome for the library. I wrote it a while ago. I'm just glad it's getting noticed nowadays.
In fairness to this plugin, that older version with the table used to work in the versions of ms word available at the time. But for me, that does not seem to anymore with the latest version of word. Your branch seems close. Perhaps, a review of the xml schemas referenced will also help.
I used to get the html for these elements by generating them in a fresh word document, and then saving as mshtml, I believe, so if you can figure out a way to do that, that would probably also give you what you're looking for. My version of word no longer seems to have that option, but I'll keep trying as well. That's why it was using a table, because ms word was using a table at the time. I notice that when it changed to a div, the css rule table#googoose-headerftrtbl did not change, so there may be something in there that can fix this too. Good luck. I'll keep trying as I have time as well.
Ahh. Ok! I'll try to see if I can something working via saving the document I'm trying to emulate as .mht
/ .mhtml
.
Interestingly in the 'web view' it hides the headers & footers, but they're still there when I switch the view back.
I may be able to sanitize the document enough so that I can share a copy for testing/reference. I may need to wait on authorization to even publish a sanitized version.
I am using Office 365, I will see if I can try it on an older version of Word as well.
Please checkout 9dcdcad and modify your html header and footer areas to match googoose.html in the examples. This is working for me in Office 365 and Office 2007, which were my two test versions.
Thanks for the update! It does work better but I'm also getting a lot of additional whitespace in my test.
I tried your googoose.html
as well and had a similar whitespace issue.
I should have time today to take a closer look at things. I'm guessing you didn't have a similar issue?
I'd tried yours later, and noticed I did have that issue. I think the behavior is correct on the main html, though, because it lists a page break after and before.
<div class='googoose break'></div>
<h1>Page Breaks</h1>
<p>
You can even define and make page breaks
</p>
<div class='googoose break'></div>
I was looking into you issue. I think part of what's causing it is the amount of text in the footer.
I've taken the example.html
and trimmed out page breaks
With header & footer commented out this is what I get:
When the header & footer are not commented out I get this:
The additional space does seem to relate to the length of the header & footer text
I seem to have the same problem with this and managed to fix it by preventing the use of DIV elements in the header. p elements work ok, but img items in div are invisible, and any text in a div make the doc "infinity pages" long. I suspect the div width has something to do with it. The tables are working well now.
i,e <div>Text text</div>
will not work <p>Text text</p>
will work.
I have looked all over the internet to get any resolution for this but failed. Did anyone find any solution to this issue? I read somewhere that mso-hide can work but it doesn't do anything.
Was there a mistake in the patch-2 merge?
Headers/footers do not work for me when using the main branch that has
...class=headerArea ... class=footerArea...
Also headers and footers do not work for me without
thtml.find(options.headerarea)[0].replaceWith('');
&thtml.find(options.footerarea)[0].replaceWith('');
Using
exampleTest.html
from https://github.com/hausman-gdit/googoose I get another header & footer at the end of the document.Any ideas? I'll keep plugging away! Thanks for the neat library.
Replace this line
html += ( 'table#' + options.headerfooterid + ' {\n' ); html += '\tmargin:0in 0in 0in 900in;width:1px;height:1px;overflow:hidden;\n';
Was there a mistake in the patch-2 merge?
Headers/footers do not work for me when using the main branch that has
...class=headerArea ... class=footerArea...
Also headers and footers do not work for me without
thtml.find(options.headerarea)[0].replaceWith('');
&thtml.find(options.footerarea)[0].replaceWith('');
Using
exampleTest.html
from https://github.com/hausman-gdit/googoose I get another header & footer at the end of the document.Any ideas? I'll keep plugging away! Thanks for the neat library.