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

Patcher does not replace content in Footer #2396

Closed
0x1234567890 opened this issue Oct 25, 2023 · 2 comments
Closed

Patcher does not replace content in Footer #2396

0x1234567890 opened this issue Oct 25, 2023 · 2 comments

Comments

@0x1234567890
Copy link

In the patcher, the text in the footer is not being replaced. It remains as it is. I have also observed the same issue with inserted text boxes.

Code:

patchDocument(fs.readFileSync("template.docx"), {
    patches: {
		footer: {
            type: PatchType.PARAGRAPH,
            children: [new TextRun("My Text in the Footer")],
        },
    },
}).then((doc) => {
    fs.writeFileSync("output.docx", doc);
});
@0x1234567890
Copy link
Author

0x1234567890 commented Oct 27, 2023

I had seen that the text {{footer}} was probably in a placeholder for something inside. That did not work. I have now replaced the entire footer with normal text and now it works.

This was due to the fact that in the template was already a field deposited, which is apparently not parsed.

@0x1234567890
Copy link
Author

I had seen that the text {{footer}} was probably in a placeholder for something inside. That did not work. I have now replaced the entire footer with normal text and now it works.

This was due to the fact that in the template was already a field deposited, which is apparently not parsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant