To sum up in short, I have requirement that if a field is blank in docx file, I would replace blank field with actual content and save that document. Solution can be in Java or Python as well.
I have tried various approaches as well, but doesn't seem to help my cause. For eg. [Text-Replace in docx and save the changed file with python-docx Using above approach, When I tried to edit document.xml file, but I cant programatically find whether given field is blank or not ?
I have also tried using docx, doc4j in java, and apache poi library as well. I really cant seem to find any solution for this.
This is sample document. [https://drive.google.com/file/d/1oKzYWP1VCZ1KHkIhksQZ4c_fO349EVZ0/view?usp=sharing][1]
So basically, If Name field is null, Replace it with some value and If address field / Date field is null, replace it with some value and save document back in its actual format.