mammoth.js icon indicating copy to clipboard operation
mammoth.js copied to clipboard

Support header/footer

Open JohnMcLear opened this issue 10 years ago • 9 comments

As per title

JohnMcLear avatar Dec 16 '13 15:12 JohnMcLear

I've been researching docx converters recently. Many seem to have issues with headers and footers. Is it possible to explain why it's tough to implement this?

stepjanssen avatar Aug 23 '17 15:08 stepjanssen

I don't know about other tools, but Mammoth doesn't convert headers and footers because it's not obvious what the correct behaviour when converting to HTML would be in the general case.

mwilliamson avatar Aug 23 '17 16:08 mwilliamson

@mwilliamson I started to make some progress trying to put headers and footers at the ends and after every hard page break. I have only been playing around with mammoth for 1 day, so I could probably be doing a whole lot of things better. Your feedback would be greatly appreciated - https://github.com/shubhamgoyal/python-mammoth/commit/57e5d29e8979477cfb4e0c7c56ea044dd1e68380

shubhamgoyal avatar Nov 12 '17 14:11 shubhamgoyal

I'm hoping to use Mammoth in a workflow preparing docx files for epub. For that, I have to access page information (page numbers etc) that's in the headers of the docx pages.

Even if header and footer information was default ignored by Mammoth, it would be fantastic if I could somehow inject their content via the style map.

jasobar avatar Mar 09 '18 06:03 jasobar

Hi all, do we have any updates on this issue?

alekmeckaroski avatar Jun 02 '20 13:06 alekmeckaroski

+1 for feature request, at least in raw text if not html.

rpsirois avatar Apr 08 '23 18:04 rpsirois

As this functionality has already been added to the python version I ported that PR to this library in my PR https://github.com/mwilliamson/mammoth.js/pull/373. Not sure the reasoning behind flat out refusing to add the feature to this library, and I doubt my PR will ever be merged, but hopefully some find it useful.

moo2u2 avatar Jul 24 '23 10:07 moo2u2

+1 for this feature, totally necessary

gastonparente avatar Aug 23 '23 03:08 gastonparente

I'm not sure when or if I'll get time to work on it, but having a minimal example document and the HTML you'd expect to see generated for each of your use cases would be useful.

mwilliamson avatar Aug 27 '23 09:08 mwilliamson