Search code examples
javadocxdocx4j

Set visible background picture to a docx document with docx4j


I tried BackgroundImage.java sample from docx4j github repository, but the result is a blank document with a paragraph containing lines "to see your background, go to 'web layout' or 'full screen reading' document view.

I need the resulting document to be the same like in the next use case in Word 2016:

> New blank document - > Design - > Page color - > Fill effects - >
> Picture tab - > Select picture

The resulting document has the background picture visible. Can I do it with docx4j ?

Thanks.


Solution

  • Please see now https://github.com/plutext/docx4j/commit/0fa7220c49a6c3c8c19e9aedde340b933f21ea5a

    The missing ingredient was the <w:displayBackgroundShape/> setting