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

Loop start in headers and closes in body #102

Open
david-randoll opened this issue Jan 30, 2024 · 1 comment
Open

Loop start in headers and closes in body #102

david-randoll opened this issue Jan 30, 2024 · 1 comment
Labels
feature request New feature or request

Comments

@david-randoll
Copy link

david-randoll commented Jan 30, 2024

Hello,

I'm wondering if it's possible to utilize this library to initiate a tag in the header and conclude it in the footer/body. To provide context, in the attached docx file, I am initiating the "licenses" tag in the header and concluding it in the footer, all while attempting to fill information within the body.

The purpose behind this approach is related to batch report printing. Specifically, certain licenses in the array extend across multiple pages. By placing the license number in the header, we aim to associate them together when a license spans multiple pages.

{
    "licenses": [
        {
            "license_number": "1234",
            "license_information": "This is a license"
        },
        {
            "license_number": "5678",
            "license_information": "This is another license"
        },
        {
            "license_number": "91011",
            "license_information": "This is a third license"
        }
    ]
}

batch report.docx

@alonrbar
Copy link
Owner

Hi,

So I looked into it. It would require a little work but it's possible. However, I don't think I'll be getting to this very soon.
If you (or anyone else) is interested in implementing this, PRs are always welcome :)

Here are some relevant sources for future reference:

  1. This MS support page explains how to do it in Word.
  2. The programmatic solution involves manipulating the markup of sections and their headers (and footers too, since they need to be handled separately from the headers).

@alonrbar alonrbar added the feature request New feature or request label Jul 17, 2024
@alonrbar alonrbar changed the title Question: loop start in headers and closes in body Loop start in headers and closes in body Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants