Comments (4)
if( fvis ) {
var new_footer = thtml.find(options.footerarea)[0].outerHTML;
thtml.find(options.footerarea).replaceWith('');
thtml.find('table#' + options.headerfooterid + ' .f').append(
GG.footerstart() + new_footer + GG.footerend());
thtml.find('#'+options.headerfooterid+'').append('Adding random text here fixes this issue')
html = thtml[0].outerHTML;
}
As shown above, fixes the problem, but really not sure what the root of this issue really is, it has something to do with the
var thtml = $(html);
which somehow modifies the HTML text using jquery, this then fails within word doc.
Above my pay grade!
from googoose.
GG.convert_hdrftr = function( html ) {
if( options.debug )
GG.debug_fn('GG.convert_hdrftr');
var hvis = options.headerarea && $(options.headerarea).length;
var fvis = options.footerarea && $(options.footerarea).length;
if( hvis || fvis ) {
var thtml = $('<div>' + html + '</div>' );
var hdrftr = $('<div id=\'' + options.headerfooterid + '\'></div>');
hdrftr.append('<div><div class=headerArea></div><div class=footerArea></div></div>');
thtml.append(hdrftr);
html = thtml[0].outerHTML;
html = GG.convert_totalpage(html);
html = GG.convert_currentpage(html);
}
var thtml = $(html);
if( hvis ) {
var new_header = thtml.find(options.headerarea)[0].outerHTML;
thtml.find(options.headerarea).replaceWith('');
thtml.find('#' + options.headerfooterid + ' .h').append(
GG.headerstart() + new_header + GG.headerend() );
html = thtml[0].outerHTML;
}
if( fvis ) {
var new_footer = thtml.find(options.footerarea)[0].outerHTML;
thtml.find(options.footerarea).replaceWith('');
thtml.find('#' + options.headerfooterid + ' .f').append(
GG.footerstart() + new_footer + GG.footerend());
html = thtml[0].outerHTML;
}
return html;
}
Rather than appending random text, changing the header and footers to divs rather than tables has worked to fix the square question mark icon issue in ms word.
from googoose.
GG.convert_hdrftr = function( html ) { if( options.debug ) GG.debug_fn('GG.convert_hdrftr'); var hvis = options.headerarea && $(options.headerarea).length; var fvis = options.footerarea && $(options.footerarea).length; if( hvis || fvis ) { var thtml = $('<div>' + html + '</div>' ); var hdrftr = $('<div id=\'' + options.headerfooterid + '\'></div>'); hdrftr.append('<div><div class=headerArea></div><div class=footerArea></div></div>'); thtml.append(hdrftr); html = thtml[0].outerHTML; html = GG.convert_totalpage(html); html = GG.convert_currentpage(html); } var thtml = $(html); if( hvis ) { var new_header = thtml.find(options.headerarea)[0].outerHTML; thtml.find(options.headerarea).replaceWith(''); thtml.find('#' + options.headerfooterid + ' .h').append( GG.headerstart() + new_header + GG.headerend() ); html = thtml[0].outerHTML; } if( fvis ) { var new_footer = thtml.find(options.footerarea)[0].outerHTML; thtml.find(options.footerarea).replaceWith(''); thtml.find('#' + options.headerfooterid + ' .f').append( GG.footerstart() + new_footer + GG.footerend()); html = thtml[0].outerHTML; } return html; }
Rather than appending random text, changing the header and footers to divs rather than tables has worked to fix the square question mark icon issue in ms word.
Yes @jondo89, it is working fine with your fix.
but one typo, we need to replace headerArea and footerArea class with h and f respectively to work perfectly
from googoose.
Thanks for the discussion. I've been gone from this project for a long time, but I'm going to try to actually maintain it now. I've merged your changes.
from googoose.
Related Issues (17)
- Footer adds page break in Word
- Unicode UTF-8 HOT 2
- 404 Not found HOT 2
- Using Googoose i Can't Get Base64 Images HOT 3
- Nothing happens HOT 1
- Document in landscape format HOT 1
- Header Footer issue, Images issue, Other languages showing wrong issue. (Resolved)
- How to get rid of the small box below header and footer HOT 2
- Header/Footer Not Working Properly HOT 12
- When add note, Header/Footer will display on the right. HOT 2
- Images are not visible in Google docs and Ms Word
- The document could not be opened in Mac OS
- Footer current page total page not working HOT 1
- call to undefined js element window.location.path HOT 2
- Word interprets downloaded doc file as html
- How to remove header and footer from cover page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googoose.