Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers and footers for docx #632

Open
SimJeg opened this issue Dec 19, 2024 · 0 comments
Open

Headers and footers for docx #632

SimJeg opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@SimJeg
Copy link

SimJeg commented Dec 19, 2024

Hi,

MsWordDocumentBackend does not support headers and footers while other packages do (e.g. docx2txt). The docx package allow them to extract quite easily for each document section. Maybe it could be done as follows:

for section in docx_obj.sections:
    handle section.header.paragraphs
    run walk_linear on the section objects
    handle section.footer.paragraphs

Note that it can't be perfect because header and footers might change for even / odd pages and it's not really feasible to get the pagination without rendering the document (see here). But defaulting to the odd pages (as done in section.header and section.footer would be great already).

@SimJeg SimJeg added the enhancement New feature or request label Dec 19, 2024
@maxmnemonic maxmnemonic self-assigned this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants