PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.21k stars 2.68k forks source link

Add read only to some of the paragraphs. #1681

Open Userrup opened 5 years ago

Userrup commented 5 years ago

Hello Team, In documentation it is written that Document protection The document (or parts of it) can be password protected. But how to protect some specific text from editing. when I apply

$documentProtection = $phpWord->getSettings()->getDocumentProtection(); $documentProtection->setEditing(DocProtect::READ_ONLY);

It make full document non editable.

Is there any way to make few paragraphs editable and few non editable?

Userrup commented 5 years ago

Didnt get any solution over this issue. So I changed the way to create document. I took help of template processor. I create a document which will have one page editable and one page non editable. Then use that document as a template with template processor and changed the required values using set value.

Progi1984 commented 3 weeks ago

@Userrup Is it possible to do it with Word ?