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

Question: Can this library convert markdown to an existing docx? #1

Open
VaclavElias opened this issue Dec 17, 2024 · 4 comments
Open

Comments

@VaclavElias
Copy link

If I have an empty docx file with headers, logo and footers and I would like to convert markdown to this file, would it work?

If not, would you know about any work workaround?

Thanks.

@manfromarce
Copy link
Owner

Hello,
this feature is currently not available because the Markdown renderer uses styles from an internal Docx file in resources.
I am working on a commit to handle images that will restructure some things and I can easily add an option to use a custom template.

Until then, I'm afraid the only workaround is to manually add/copy headers and footers into the final document using the Open XML SDK (which is referenced from this library anyway).

@VaclavElias
Copy link
Author

Thanks for a quick reply. Of course, there is a template. If I added a footer and header to the template in the Resource folder, would it be transferred to the final document? Or the template is only for the styling purposes?

@manfromarce
Copy link
Owner

Yes, it's for styling purposes but you can do the following:

  • comment the CleanContents line here
  • add header and footer, and delete any other content in the template file

@VaclavElias
Copy link
Author

Thanks. I will test it.

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

2 participants