user478636
user478636

Reputation: 3424

Php docx modification

I'm looking to preserve the formatting of the document. Any changes to the original document will be highlighted In red color. This will saved as another document.

So far I have extracted raw text from a docx file. I can make a function that finds the modified parts. But is there any way I can highlight the changed/added text to the original document to red color.

Upvotes: 1

Views: 269

Answers (2)

Yoong Kim
Yoong Kim

Reputation: 310

no, not so easy! I tried and it's very hard to generate the right attributes values. Example, I can modify the XML files to insert an image into a document (word/document.xml, word/media/imageXX.jpg, word/_rels/document.xml.rels) but the problem is the value of the attributes!

Upvotes: 0

symcbean
symcbean

Reputation: 48357

Yes, but you'll need to backtrack a bit and work on the parsed XML, not the raw text. Also you're only going to be able to identify a continuous string with no intervening markup (not strictly true, but the code gets very complex).

Upvotes: 2

Related Questions