dolanmiu / docx

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
https://docx.js.org/
MIT License
4.06k stars 463 forks source link

Images in header and footer are transparent by default in Microsoft Word #2692

Open arthaud-proust opened 2 weeks ago

arthaud-proust commented 2 weeks ago

Hello, thanks a lot for this package ! I think there is an issue with images in header/footer

Problem

Inserted image in footer or header appear transparent when you open the .docx file with Microsoft Word 16.76 (non-activated)

Reproduction

TL;DR : You can reproduce by opening the file generated by the demo9-images-in-header-and-footer

Steps:

  1. Clone the repo
  2. Run npm i
  3. Run npm run demo
  4. Select 9-images-in-header-and-footer
  5. Open the generated file My Document.docx
  6. Observe that the gif image is transparent (more lighter than the original asset in /demo/images/pizza.gif)

Comparison

In the word file

Capture d’écran 2024-06-19 à 17 03 24

The original gif

Capture d’écran 2024-06-19 à 17 04 23

Other observations